From c05b74f5706bf112805226a88d91d4012c3b8816 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 18 Jun 2026 23:44:43 +0000 Subject: [PATCH 1/2] docs: clarified OUTPUT_AUDIO_ENCODING_MP3 feat: added support for new AnswerType types feat: added support for SIP config in conversation profile feat: added support for proactive and reactive in CES app feat: added support for new knowledge suggestion PiperOrigin-RevId: 934361904 Source-Link: https://github.com/googleapis/googleapis/commit/f548abb6c8d16b0895dcb4ea2391e10e20fba4a0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/031ded3348221c7a63cc2945dda82cfe4f37e1e1 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3ctdjIvLk93bEJvdC55YW1sIiwiaCI6IjAzMWRlZDMzNDgyMjFjN2E2M2NjMjk0NWRkYTgyY2ZlNGYzN2UxZTEifQ== --- .../google-cloud-dialogflow-v2/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-dialogflow-v2/.rubocop.yml | 33 + .../google-cloud-dialogflow-v2/.toys.rb | 28 + .../google-cloud-dialogflow-v2/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-dialogflow-v2/CHANGELOG.md | 2 + .../google-cloud-dialogflow-v2/Gemfile | 14 + .../google-cloud-dialogflow-v2/LICENSE.md | 201 + .../google-cloud-dialogflow-v2/README.md | 154 + .../google-cloud-dialogflow-v2/Rakefile | 169 + .../gapic_metadata.json | 857 +++ .../google-cloud-dialogflow-v2.gemspec | 29 + .../lib/google-cloud-dialogflow-v2.rb | 21 + .../lib/google/cloud/dialogflow/v2.rb | 66 + .../v2/agent_coaching_instruction_pb.rb | 26 + .../google/cloud/dialogflow/v2/agent_pb.rb | 45 + .../cloud/dialogflow/v2/agent_services_pb.rb | 144 + .../lib/google/cloud/dialogflow/v2/agents.rb | 56 + .../cloud/dialogflow/v2/agents/client.rb | 1434 +++++ .../cloud/dialogflow/v2/agents/credentials.rb | 52 + .../cloud/dialogflow/v2/agents/operations.rb | 843 +++ .../cloud/dialogflow/v2/agents/paths.rb | 100 + .../google/cloud/dialogflow/v2/agents/rest.rb | 54 + .../cloud/dialogflow/v2/agents/rest/client.rb | 1336 +++++ .../dialogflow/v2/agents/rest/operations.rb | 947 +++ .../dialogflow/v2/agents/rest/service_stub.rb | 703 +++ .../cloud/dialogflow/v2/answer_record_pb.rb | 43 + .../v2/answer_record_services_pb.rb | 49 + .../cloud/dialogflow/v2/answer_records.rb | 56 + .../dialogflow/v2/answer_records/client.rb | 627 ++ .../v2/answer_records/credentials.rb | 52 + .../dialogflow/v2/answer_records/paths.rb | 316 + .../dialogflow/v2/answer_records/rest.rb | 54 + .../v2/answer_records/rest/client.rb | 578 ++ .../v2/answer_records/rest/service_stub.rb | 219 + .../cloud/dialogflow/v2/audio_config_pb.rb | 39 + .../cloud/dialogflow/v2/bindings_override.rb | 75 + .../google/cloud/dialogflow/v2/ces_app_pb.rb | 25 + .../google/cloud/dialogflow/v2/ces_tool_pb.rb | 25 + .../google/cloud/dialogflow/v2/context_pb.rb | 36 + .../dialogflow/v2/context_services_pb.rb | 57 + .../google/cloud/dialogflow/v2/contexts.rb | 55 + .../cloud/dialogflow/v2/contexts/client.rb | 999 ++++ .../dialogflow/v2/contexts/credentials.rb | 52 + .../cloud/dialogflow/v2/contexts/paths.rb | 195 + .../cloud/dialogflow/v2/contexts/rest.rb | 53 + .../dialogflow/v2/contexts/rest/client.rb | 922 +++ .../v2/contexts/rest/service_stub.rb | 581 ++ .../dialogflow/v2/conversation_dataset_pb.rb | 43 + .../v2/conversation_dataset_services_pb.rb | 86 + .../dialogflow/v2/conversation_datasets.rb | 59 + .../v2/conversation_datasets/client.rb | 962 +++ .../v2/conversation_datasets/credentials.rb | 52 + .../v2/conversation_datasets/operations.rb | 843 +++ .../v2/conversation_datasets/paths.rb | 69 + .../v2/conversation_datasets/rest.rb | 57 + .../v2/conversation_datasets/rest/client.rb | 892 +++ .../conversation_datasets/rest/operations.rb | 947 +++ .../rest/service_stub.rb | 410 ++ .../dialogflow/v2/conversation_event_pb.rb | 28 + .../dialogflow/v2/conversation_model_pb.rb | 58 + .../v2/conversation_model_services_pb.rb | 103 + .../dialogflow/v2/conversation_models.rb | 56 + .../v2/conversation_models/client.rb | 1371 +++++ .../v2/conversation_models/credentials.rb | 52 + .../v2/conversation_models/operations.rb | 843 +++ .../v2/conversation_models/paths.rb | 183 + .../dialogflow/v2/conversation_models/rest.rb | 54 + .../v2/conversation_models/rest/client.rb | 1273 ++++ .../v2/conversation_models/rest/operations.rb | 947 +++ .../conversation_models/rest/service_stub.rb | 693 +++ .../cloud/dialogflow/v2/conversation_pb.rb | 81 + .../dialogflow/v2/conversation_profile_pb.rb | 69 + .../v2/conversation_profile_services_pb.rb | 99 + .../dialogflow/v2/conversation_profiles.rb | 57 + .../v2/conversation_profiles/client.rb | 1158 ++++ .../v2/conversation_profiles/credentials.rb | 52 + .../v2/conversation_profiles/operations.rb | 843 +++ .../v2/conversation_profiles/paths.rb | 325 + .../v2/conversation_profiles/rest.rb | 55 + .../v2/conversation_profiles/rest/client.rb | 1074 ++++ .../conversation_profiles/rest/operations.rb | 947 +++ .../rest/service_stub.rb | 565 ++ .../dialogflow/v2/conversation_services_pb.rb | 98 + .../cloud/dialogflow/v2/conversations.rb | 56 + .../dialogflow/v2/conversations/client.rb | 1639 ++++++ .../v2/conversations/credentials.rb | 52 + .../dialogflow/v2/conversations/paths.rb | 541 ++ .../cloud/dialogflow/v2/conversations/rest.rb | 54 + .../v2/conversations/rest/client.rb | 1527 +++++ .../v2/conversations/rest/service_stub.rb | 845 +++ .../google/cloud/dialogflow/v2/document_pb.rb | 49 + .../dialogflow/v2/document_services_pb.rb | 119 + .../google/cloud/dialogflow/v2/documents.rb | 57 + .../cloud/dialogflow/v2/documents/client.rb | 1354 +++++ .../dialogflow/v2/documents/credentials.rb | 52 + .../dialogflow/v2/documents/operations.rb | 843 +++ .../cloud/dialogflow/v2/documents/paths.rb | 119 + .../cloud/dialogflow/v2/documents/rest.rb | 55 + .../dialogflow/v2/documents/rest/client.rb | 1263 ++++ .../v2/documents/rest/operations.rb | 947 +++ .../v2/documents/rest/service_stub.rb | 680 +++ .../cloud/dialogflow/v2/encryption_spec_pb.rb | 31 + .../dialogflow/v2/encryption_spec_service.rb | 56 + .../v2/encryption_spec_service/client.rb | 619 ++ .../v2/encryption_spec_service/credentials.rb | 52 + .../v2/encryption_spec_service/operations.rb | 843 +++ .../v2/encryption_spec_service/paths.rb | 50 + .../v2/encryption_spec_service/rest.rb | 54 + .../v2/encryption_spec_service/rest/client.rb | 570 ++ .../rest/operations.rb | 947 +++ .../rest/service_stub.rb | 204 + .../v2/encryption_spec_services_pb.rb | 51 + .../cloud/dialogflow/v2/entity_type_pb.rb | 46 + .../dialogflow/v2/entity_type_services_pb.rb | 143 + .../cloud/dialogflow/v2/entity_types.rb | 56 + .../dialogflow/v2/entity_types/client.rb | 1561 +++++ .../dialogflow/v2/entity_types/credentials.rb | 52 + .../dialogflow/v2/entity_types/operations.rb | 843 +++ .../cloud/dialogflow/v2/entity_types/paths.rb | 110 + .../cloud/dialogflow/v2/entity_types/rest.rb | 54 + .../dialogflow/v2/entity_types/rest/client.rb | 1456 +++++ .../v2/entity_types/rest/operations.rb | 947 +++ .../v2/entity_types/rest/service_stub.rb | 775 +++ .../cloud/dialogflow/v2/environment_pb.rb | 42 + .../dialogflow/v2/environment_services_pb.rb | 66 + .../cloud/dialogflow/v2/environments.rb | 55 + .../dialogflow/v2/environments/client.rb | 1030 ++++ .../dialogflow/v2/environments/credentials.rb | 52 + .../cloud/dialogflow/v2/environments/paths.rb | 187 + .../cloud/dialogflow/v2/environments/rest.rb | 53 + .../dialogflow/v2/environments/rest/client.rb | 953 +++ .../v2/environments/rest/service_stub.rb | 493 ++ .../cloud/dialogflow/v2/fulfillment_pb.rb | 32 + .../dialogflow/v2/fulfillment_services_pb.rb | 47 + .../cloud/dialogflow/v2/fulfillments.rb | 55 + .../dialogflow/v2/fulfillments/client.rb | 593 ++ .../dialogflow/v2/fulfillments/credentials.rb | 52 + .../cloud/dialogflow/v2/fulfillments/paths.rb | 69 + .../cloud/dialogflow/v2/fulfillments/rest.rb | 53 + .../dialogflow/v2/fulfillments/rest/client.rb | 544 ++ .../v2/fulfillments/rest/service_stub.rb | 219 + .../lib/google/cloud/dialogflow/v2/gcs_pb.rb | 24 + .../dialogflow/v2/generator_evaluation_pb.rb | 58 + .../v2/generator_evaluation_services_pb.rb | 51 + .../dialogflow/v2/generator_evaluations.rb | 56 + .../v2/generator_evaluations/client.rb | 817 +++ .../v2/generator_evaluations/credentials.rb | 52 + .../v2/generator_evaluations/operations.rb | 843 +++ .../v2/generator_evaluations/paths.rb | 158 + .../v2/generator_evaluations/rest.rb | 54 + .../v2/generator_evaluations/rest/client.rb | 754 +++ .../generator_evaluations/rest/operations.rb | 947 +++ .../rest/service_stub.rb | 326 ++ .../cloud/dialogflow/v2/generator_pb.rb | 68 + .../dialogflow/v2/generator_services_pb.rb | 57 + .../google/cloud/dialogflow/v2/generators.rb | 59 + .../cloud/dialogflow/v2/generators/client.rb | 900 +++ .../dialogflow/v2/generators/credentials.rb | 52 + .../cloud/dialogflow/v2/generators/paths.rb | 151 + .../cloud/dialogflow/v2/generators/rest.rb | 57 + .../dialogflow/v2/generators/rest/client.rb | 830 +++ .../v2/generators/rest/service_stub.rb | 403 ++ .../v2/human_agent_assistant_event_pb.rb | 23 + .../google/cloud/dialogflow/v2/intent_pb.rb | 81 + .../cloud/dialogflow/v2/intent_services_pb.rb | 95 + .../lib/google/cloud/dialogflow/v2/intents.rb | 56 + .../cloud/dialogflow/v2/intents/client.rb | 1204 ++++ .../dialogflow/v2/intents/credentials.rb | 52 + .../cloud/dialogflow/v2/intents/operations.rb | 843 +++ .../cloud/dialogflow/v2/intents/paths.rb | 195 + .../cloud/dialogflow/v2/intents/rest.rb | 54 + .../dialogflow/v2/intents/rest/client.rb | 1120 ++++ .../dialogflow/v2/intents/rest/operations.rb | 947 +++ .../v2/intents/rest/service_stub.rb | 579 ++ .../cloud/dialogflow/v2/knowledge_base_pb.rb | 34 + .../v2/knowledge_base_services_pb.rb | 54 + .../cloud/dialogflow/v2/knowledge_bases.rb | 56 + .../dialogflow/v2/knowledge_bases/client.rb | 919 +++ .../v2/knowledge_bases/credentials.rb | 52 + .../dialogflow/v2/knowledge_bases/paths.rb | 105 + .../dialogflow/v2/knowledge_bases/rest.rb | 54 + .../v2/knowledge_bases/rest/client.rb | 849 +++ .../v2/knowledge_bases/rest/service_stub.rb | 462 ++ .../cloud/dialogflow/v2/operations_pb.rb | 24 + .../cloud/dialogflow/v2/participant_pb.rb | 92 + .../dialogflow/v2/participant_services_pb.rb | 85 + .../cloud/dialogflow/v2/participants.rb | 55 + .../dialogflow/v2/participants/client.rb | 1469 +++++ .../dialogflow/v2/participants/credentials.rb | 52 + .../cloud/dialogflow/v2/participants/paths.rb | 353 ++ .../cloud/dialogflow/v2/participants/rest.rb | 53 + .../dialogflow/v2/participants/rest/client.rb | 1270 ++++ .../v2/participants/rest/service_stub.rb | 707 +++ .../lib/google/cloud/dialogflow/v2/rest.rb | 59 + .../dialogflow/v2/session_entity_type_pb.rb | 36 + .../v2/session_entity_type_services_pb.rb | 77 + .../dialogflow/v2/session_entity_types.rb | 56 + .../v2/session_entity_types/client.rb | 926 +++ .../v2/session_entity_types/credentials.rb | 52 + .../v2/session_entity_types/paths.rb | 195 + .../v2/session_entity_types/rest.rb | 54 + .../v2/session_entity_types/rest/client.rb | 856 +++ .../session_entity_types/rest/service_stub.rb | 499 ++ .../google/cloud/dialogflow/v2/session_pb.rb | 49 + .../dialogflow/v2/session_services_pb.rb | 77 + .../google/cloud/dialogflow/v2/sessions.rb | 58 + .../cloud/dialogflow/v2/sessions/client.rb | 663 +++ .../dialogflow/v2/sessions/credentials.rb | 52 + .../cloud/dialogflow/v2/sessions/paths.rb | 299 + .../cloud/dialogflow/v2/sessions/rest.rb | 56 + .../dialogflow/v2/sessions/rest/client.rb | 521 ++ .../v2/sessions/rest/service_stub.rb | 167 + .../cloud/dialogflow/v2/sip_trunk_pb.rb | 39 + .../dialogflow/v2/sip_trunk_services_pb.rb | 53 + .../google/cloud/dialogflow/v2/sip_trunks.rb | 55 + .../cloud/dialogflow/v2/sip_trunks/client.rb | 887 +++ .../dialogflow/v2/sip_trunks/credentials.rb | 52 + .../cloud/dialogflow/v2/sip_trunks/paths.rb | 69 + .../cloud/dialogflow/v2/sip_trunks/rest.rb | 53 + .../dialogflow/v2/sip_trunks/rest/client.rb | 817 +++ .../v2/sip_trunks/rest/service_stub.rb | 388 ++ .../cloud/dialogflow/v2/tool_call_pb.rb | 29 + .../lib/google/cloud/dialogflow/v2/tool_pb.rb | 56 + .../cloud/dialogflow/v2/tool_services_pb.rb | 55 + .../lib/google/cloud/dialogflow/v2/tools.rb | 57 + .../cloud/dialogflow/v2/tools/client.rb | 899 +++ .../cloud/dialogflow/v2/tools/credentials.rb | 52 + .../google/cloud/dialogflow/v2/tools/paths.rb | 109 + .../google/cloud/dialogflow/v2/tools/rest.rb | 55 + .../cloud/dialogflow/v2/tools/rest/client.rb | 829 +++ .../dialogflow/v2/tools/rest/service_stub.rb | 388 ++ .../google/cloud/dialogflow/v2/toolset_pb.rb | 25 + .../dialogflow/v2/validation_result_pb.rb | 23 + .../lib/google/cloud/dialogflow/v2/version.rb | 28 + .../google/cloud/dialogflow/v2/version_pb.rb | 36 + .../dialogflow/v2/version_services_pb.rb | 59 + .../google/cloud/dialogflow/v2/versions.rb | 55 + .../cloud/dialogflow/v2/versions/client.rb | 909 +++ .../dialogflow/v2/versions/credentials.rb | 52 + .../cloud/dialogflow/v2/versions/paths.rb | 110 + .../cloud/dialogflow/v2/versions/rest.rb | 53 + .../dialogflow/v2/versions/rest/client.rb | 839 +++ .../v2/versions/rest/service_stub.rb | 425 ++ .../google/cloud/dialogflow/v2/webhook_pb.rb | 30 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/dialogflow/v2/agent.rb | 338 ++ .../v2/agent_coaching_instruction.rb | 109 + .../cloud/dialogflow/v2/answer_record.rb | 360 ++ .../cloud/dialogflow/v2/audio_config.rb | 573 ++ .../google/cloud/dialogflow/v2/ces_app.rb | 51 + .../google/cloud/dialogflow/v2/ces_tool.rb | 39 + .../google/cloud/dialogflow/v2/context.rb | 200 + .../cloud/dialogflow/v2/conversation.rb | 1150 ++++ .../dialogflow/v2/conversation_dataset.rb | 229 + .../cloud/dialogflow/v2/conversation_event.rb | 98 + .../cloud/dialogflow/v2/conversation_model.rb | 577 ++ .../dialogflow/v2/conversation_profile.rb | 923 +++ .../google/cloud/dialogflow/v2/document.rb | 442 ++ .../cloud/dialogflow/v2/encryption_spec.rb | 81 + .../google/cloud/dialogflow/v2/entity_type.rb | 374 ++ .../google/cloud/dialogflow/v2/environment.rb | 311 + .../google/cloud/dialogflow/v2/fulfillment.rb | 153 + .../google/cloud/dialogflow/v2/gcs.rb | 50 + .../google/cloud/dialogflow/v2/generator.rb | 659 +++ .../dialogflow/v2/generator_evaluation.rb | 539 ++ .../v2/human_agent_assistant_event.rb | 45 + .../google/cloud/dialogflow/v2/intent.rb | 1089 ++++ .../cloud/dialogflow/v2/knowledge_base.rb | 173 + .../google/cloud/dialogflow/v2/operations.rb | 39 + .../google/cloud/dialogflow/v2/participant.rb | 1689 ++++++ .../google/cloud/dialogflow/v2/session.rb | 762 +++ .../dialogflow/v2/session_entity_type.rb | 181 + .../google/cloud/dialogflow/v2/sip_trunk.rb | 211 + .../google/cloud/dialogflow/v2/tool.rb | 552 ++ .../google/cloud/dialogflow/v2/tool_call.rb | 161 + .../google/cloud/dialogflow/v2/toolset.rb | 44 + .../cloud/dialogflow/v2/validation_result.rb | 81 + .../google/cloud/dialogflow/v2/version.rb | 188 + .../google/cloud/dialogflow/v2/webhook.rb | 155 + .../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/latlng.rb | 38 + .../snippets/Gemfile | 32 + .../snippets/agents/delete_agent.rb | 47 + .../snippets/agents/export_agent.rb | 54 + .../snippets/agents/get_agent.rb | 47 + .../snippets/agents/get_validation_result.rb | 47 + .../snippets/agents/import_agent.rb | 54 + .../snippets/agents/restore_agent.rb | 54 + .../snippets/agents/search_agents.rb | 51 + .../snippets/agents/set_agent.rb | 47 + .../snippets/agents/train_agent.rb | 54 + .../answer_records/list_answer_records.rb | 51 + .../answer_records/update_answer_record.rb | 47 + .../snippets/contexts/create_context.rb | 47 + .../snippets/contexts/delete_all_contexts.rb | 47 + .../snippets/contexts/delete_context.rb | 47 + .../snippets/contexts/get_context.rb | 47 + .../snippets/contexts/list_contexts.rb | 51 + .../snippets/contexts/update_context.rb | 47 + .../create_conversation_dataset.rb | 54 + .../delete_conversation_dataset.rb | 54 + .../get_conversation_dataset.rb | 47 + .../import_conversation_data.rb | 54 + .../list_conversation_datasets.rb | 51 + .../create_conversation_model.rb | 54 + .../create_conversation_model_evaluation.rb | 54 + .../delete_conversation_model.rb | 54 + .../deploy_conversation_model.rb | 54 + .../get_conversation_model.rb | 47 + .../get_conversation_model_evaluation.rb | 47 + .../list_conversation_model_evaluations.rb | 51 + .../list_conversation_models.rb | 51 + .../undeploy_conversation_model.rb | 54 + .../clear_suggestion_feature_config.rb | 54 + .../create_conversation_profile.rb | 47 + .../delete_conversation_profile.rb | 47 + .../get_conversation_profile.rb | 47 + .../list_conversation_profiles.rb | 51 + .../set_suggestion_feature_config.rb | 54 + .../update_conversation_profile.rb | 47 + .../conversations/complete_conversation.rb | 47 + .../conversations/create_conversation.rb | 47 + .../generate_stateless_suggestion.rb | 47 + .../generate_stateless_summary.rb | 47 + .../conversations/generate_suggestions.rb | 47 + .../conversations/get_conversation.rb | 47 + .../ingest_context_references.rb | 47 + .../conversations/list_conversations.rb | 51 + .../snippets/conversations/list_messages.rb | 51 + .../conversations/search_knowledge.rb | 47 + .../suggest_conversation_summary.rb | 47 + .../snippets/documents/create_document.rb | 54 + .../snippets/documents/delete_document.rb | 54 + .../snippets/documents/export_document.rb | 54 + .../snippets/documents/get_document.rb | 47 + .../snippets/documents/import_documents.rb | 54 + .../snippets/documents/list_documents.rb | 51 + .../snippets/documents/reload_document.rb | 54 + .../snippets/documents/update_document.rb | 54 + .../get_encryption_spec.rb | 47 + .../initialize_encryption_spec.rb | 54 + .../entity_types/batch_create_entities.rb | 54 + .../entity_types/batch_delete_entities.rb | 54 + .../entity_types/batch_delete_entity_types.rb | 54 + .../entity_types/batch_update_entities.rb | 54 + .../entity_types/batch_update_entity_types.rb | 54 + .../entity_types/create_entity_type.rb | 47 + .../entity_types/delete_entity_type.rb | 47 + .../snippets/entity_types/get_entity_type.rb | 47 + .../entity_types/list_entity_types.rb | 51 + .../entity_types/update_entity_type.rb | 47 + .../environments/create_environment.rb | 47 + .../environments/delete_environment.rb | 47 + .../snippets/environments/get_environment.rb | 47 + .../environments/get_environment_history.rb | 51 + .../environments/list_environments.rb | 51 + .../environments/update_environment.rb | 47 + .../snippets/fulfillments/get_fulfillment.rb | 47 + .../fulfillments/update_fulfillment.rb | 47 + .../create_generator_evaluation.rb | 54 + .../delete_generator_evaluation.rb | 47 + .../get_generator_evaluation.rb | 47 + .../list_generator_evaluations.rb | 51 + .../snippets/generators/create_generator.rb | 47 + .../snippets/generators/delete_generator.rb | 47 + .../snippets/generators/get_generator.rb | 47 + .../snippets/generators/list_generators.rb | 51 + .../snippets/generators/update_generator.rb | 47 + .../snippets/intents/batch_delete_intents.rb | 54 + .../snippets/intents/batch_update_intents.rb | 54 + .../snippets/intents/create_intent.rb | 47 + .../snippets/intents/delete_intent.rb | 47 + .../snippets/intents/get_intent.rb | 47 + .../snippets/intents/list_intents.rb | 51 + .../snippets/intents/update_intent.rb | 47 + .../knowledge_bases/create_knowledge_base.rb | 47 + .../knowledge_bases/delete_knowledge_base.rb | 47 + .../knowledge_bases/get_knowledge_base.rb | 47 + .../knowledge_bases/list_knowledge_bases.rb | 51 + .../knowledge_bases/update_knowledge_base.rb | 47 + .../snippets/participants/analyze_content.rb | 47 + .../participants/create_participant.rb | 47 + .../snippets/participants/get_participant.rb | 47 + .../participants/list_participants.rb | 51 + .../participants/streaming_analyze_content.rb | 56 + .../snippets/participants/suggest_articles.rb | 47 + .../participants/suggest_faq_answers.rb | 47 + .../participants/suggest_knowledge_assist.rb | 47 + .../participants/suggest_smart_replies.rb | 47 + .../participants/update_participant.rb | 47 + .../create_session_entity_type.rb | 47 + .../delete_session_entity_type.rb | 47 + .../get_session_entity_type.rb | 47 + .../list_session_entity_types.rb | 51 + .../update_session_entity_type.rb | 47 + .../snippets/sessions/detect_intent.rb | 47 + .../sessions/streaming_detect_intent.rb | 56 + .../snippets/sip_trunks/create_sip_trunk.rb | 47 + .../snippets/sip_trunks/delete_sip_trunk.rb | 47 + .../snippets/sip_trunks/get_sip_trunk.rb | 47 + .../snippets/sip_trunks/list_sip_trunks.rb | 51 + .../snippets/sip_trunks/update_sip_trunk.rb | 47 + ...t_metadata_google.cloud.dialogflow.v2.json | 5215 +++++++++++++++++ .../snippets/tools/create_tool.rb | 47 + .../snippets/tools/delete_tool.rb | 47 + .../snippets/tools/get_tool.rb | 47 + .../snippets/tools/list_tools.rb | 51 + .../snippets/tools/update_tool.rb | 47 + .../snippets/versions/create_version.rb | 47 + .../snippets/versions/delete_version.rb | 47 + .../snippets/versions/get_version.rb | 47 + .../snippets/versions/list_versions.rb | 51 + .../snippets/versions/update_version.rb | 47 + .../dialogflow/v2/agents_operations_test.rb | 400 ++ .../cloud/dialogflow/v2/agents_paths_test.rb | 82 + .../cloud/dialogflow/v2/agents_rest_test.rb | 592 ++ .../google/cloud/dialogflow/v2/agents_test.rb | 681 +++ .../v2/answer_records_paths_test.rb | 157 + .../dialogflow/v2/answer_records_rest_test.rb | 211 + .../dialogflow/v2/answer_records_test.rb | 233 + .../dialogflow/v2/contexts_paths_test.rb | 85 + .../cloud/dialogflow/v2/contexts_rest_test.rb | 427 ++ .../cloud/dialogflow/v2/contexts_test.rb | 465 ++ .../conversation_datasets_operations_test.rb | 400 ++ .../v2/conversation_datasets_paths_test.rb | 67 + .../v2/conversation_datasets_rest_test.rb | 373 ++ .../v2/conversation_datasets_test.rb | 436 ++ .../v2/conversation_models_operations_test.rb | 400 ++ .../v2/conversation_models_paths_test.rb | 100 + .../v2/conversation_models_rest_test.rb | 591 ++ .../dialogflow/v2/conversation_models_test.rb | 687 +++ .../conversation_profiles_operations_test.rb | 400 ++ .../v2/conversation_profiles_paths_test.rb | 178 + .../v2/conversation_profiles_rest_test.rb | 485 ++ .../v2/conversation_profiles_test.rb | 555 ++ .../dialogflow/v2/conversations_paths_test.rb | 262 + .../dialogflow/v2/conversations_rest_test.rb | 724 +++ .../cloud/dialogflow/v2/conversations_test.rb | 815 +++ .../v2/documents_operations_test.rb | 400 ++ .../dialogflow/v2/documents_paths_test.rb | 73 + .../dialogflow/v2/documents_rest_test.rb | 545 ++ .../cloud/dialogflow/v2/documents_test.rb | 648 ++ ...encryption_spec_service_operations_test.rb | 400 ++ .../v2/encryption_spec_service_paths_test.rb | 55 + .../v2/encryption_spec_service_rest_test.rb | 207 + .../v2/encryption_spec_service_test.rb | 239 + .../v2/entity_types_operations_test.rb | 400 ++ .../dialogflow/v2/entity_types_paths_test.rb | 73 + .../dialogflow/v2/entity_types_rest_test.rb | 658 +++ .../cloud/dialogflow/v2/entity_types_test.rb | 767 +++ .../dialogflow/v2/environments_paths_test.rb | 103 + .../dialogflow/v2/environments_rest_test.rb | 431 ++ .../cloud/dialogflow/v2/environments_test.rb | 478 ++ .../dialogflow/v2/fulfillments_paths_test.rb | 58 + .../dialogflow/v2/fulfillments_rest_test.rb | 208 + .../cloud/dialogflow/v2/fulfillments_test.rb | 222 + .../generator_evaluations_operations_test.rb | 400 ++ .../v2/generator_evaluations_paths_test.rb | 106 + .../v2/generator_evaluations_rest_test.rb | 318 + .../v2/generator_evaluations_test.rb | 366 ++ .../dialogflow/v2/generators_paths_test.rb | 106 + .../dialogflow/v2/generators_rest_test.rb | 374 ++ .../cloud/dialogflow/v2/generators_test.rb | 409 ++ .../dialogflow/v2/intents_operations_test.rb | 400 ++ .../cloud/dialogflow/v2/intents_paths_test.rb | 94 + .../cloud/dialogflow/v2/intents_rest_test.rb | 494 ++ .../cloud/dialogflow/v2/intents_test.rb | 574 ++ .../v2/knowledge_bases_paths_test.rb | 82 + .../v2/knowledge_bases_rest_test.rb | 375 ++ .../dialogflow/v2/knowledge_bases_test.rb | 411 ++ .../dialogflow/v2/participants_paths_test.rb | 142 + .../dialogflow/v2/participants_rest_test.rb | 607 ++ .../cloud/dialogflow/v2/participants_test.rb | 786 +++ .../v2/session_entity_types_paths_test.rb | 85 + .../v2/session_entity_types_rest_test.rb | 373 ++ .../v2/session_entity_types_test.rb | 407 ++ .../dialogflow/v2/sessions_paths_test.rb | 118 + .../cloud/dialogflow/v2/sessions_rest_test.rb | 158 + .../cloud/dialogflow/v2/sessions_test.rb | 274 + .../dialogflow/v2/sip_trunks_paths_test.rb | 67 + .../dialogflow/v2/sip_trunks_rest_test.rb | 373 ++ .../cloud/dialogflow/v2/sip_trunks_test.rb | 407 ++ .../cloud/dialogflow/v2/tools_paths_test.rb | 91 + .../cloud/dialogflow/v2/tools_rest_test.rb | 374 ++ .../google/cloud/dialogflow/v2/tools_test.rb | 409 ++ .../dialogflow/v2/versions_paths_test.rb | 73 + .../cloud/dialogflow/v2/versions_rest_test.rb | 373 ++ .../cloud/dialogflow/v2/versions_test.rb | 407 ++ .../google-cloud-dialogflow-v2/test/helper.rb | 26 + 502 files changed, 135636 insertions(+) create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/README.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google-cloud-dialogflow-v2.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_coaching_instruction_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_tool_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/gcs_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/operations_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_call_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/toolset_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/validation_result_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/credentials.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/paths.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/webhook_pb.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent_coaching_instruction.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/answer_record.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/context.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_dataset.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_model.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/document.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/encryption_spec.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/gcs.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/sip_trunk.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool_call.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/toolset.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/validation_result.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/webhook.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/delete_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_suggestion.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_summary.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_suggestions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/ingest_context_references.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/search_knowledge.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/suggest_conversation_summary.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/create_document.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/export_document.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/get_document.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/update_document.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/get_encryption_spec.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/initialize_encryption_spec.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/create_generator_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/delete_generator_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/get_generator_evaluation.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/list_generator_evaluations.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/create_generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/delete_generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/get_generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/list_generators.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/update_generator.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_knowledge_assist.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/create_sip_trunk.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/delete_sip_trunk.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/get_sip_trunk.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/list_sip_trunks.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/update_sip_trunk.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/create_tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/delete_tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/get_tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/list_tools.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/update_tool.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/create_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/get_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/update_version.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb create mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/helper.rb diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/.gitignore b/owl-bot-staging/google-cloud-dialogflow-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/.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-dialogflow-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-dialogflow-v2/.repo-metadata.json new file mode 100644 index 000000000000..c28a1df1d12f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "dialogflow.googleapis.com", + "api_shortname": "dialogflow", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest", + "distribution_name": "google-cloud-dialogflow-v2", + "is_cloud": true, + "language": "ruby", + "name": "dialogflow", + "name_pretty": "Dialogflow V2 API", + "product_documentation": "https://cloud.google.com/dialogflow", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Dialogflow is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business. This client is for Dialogflow ES, providing the standard agent type suitable for small and simple agents. Note that google-cloud-dialogflow-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dialogflow instead. See the readme for more details.", + "ruby-cloud-env-prefix": "DIALOGFLOW", + "ruby-cloud-product-url": "https://cloud.google.com/dialogflow", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/.rubocop.yml b/owl-bot-staging/google-cloud-dialogflow-v2/.rubocop.yml new file mode 100644 index 000000000000..8743a6db18c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-dialogflow-v2.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-dialogflow-v2.rb" diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/.toys.rb b/owl-bot-staging/google-cloud-dialogflow-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/.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-dialogflow-v2/.yardopts b/owl-bot-staging/google-cloud-dialogflow-v2/.yardopts new file mode 100644 index 000000000000..f6fe8ca2a537 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Dialogflow V2 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-dialogflow-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-dialogflow-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..abc2d69faa26 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-dialogflow-v2 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-dialogflow-v2 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/dialogflow/v2" + +client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/dialogflow/v2" + +::Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Dialogflow::V2::Agents::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-dialogflow-v2 +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/dialogflow/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Dialogflow::V2::Agents::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-dialogflow-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-dialogflow-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/Gemfile b/owl-bot-staging/google-cloud-dialogflow-v2/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/LICENSE.md b/owl-bot-staging/google-cloud-dialogflow-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/README.md b/owl-bot-staging/google-cloud-dialogflow-v2/README.md new file mode 100644 index 000000000000..cd1b6d1222bd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Dialogflow V2 API + +Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices). + +Dialogflow is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business. This client is for Dialogflow ES, providing the standard agent type suitable for small and simple agents. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Dialogflow V2 API. Most users should consider using +the main client gem, +[google-cloud-dialogflow](https://rubygems.org/gems/google-cloud-dialogflow). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-dialogflow-v2 +``` + +## 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/dialogflow.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/dialogflow/v2" + +client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new +request = ::Google::Cloud::Dialogflow::V2::GetAgentRequest.new # (request fields as keyword arguments...) +response = client.get_agent request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/dialogflow) +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/dialogflow/v2" +require "logger" + +client = ::Google::Cloud::Dialogflow::V2::Agents::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.2+. + +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-dialogflow`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-dialogflow-v2`. +_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-dialogflow`. +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-dialogflow-v2`. + +### 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-dialogflow-v2/Rakefile b/owl-bot-staging/google-cloud-dialogflow-v2/Rakefile new file mode 100644 index 000000000000..262246472d59 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["DIALOGFLOW_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["DIALOGFLOW_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["DIALOGFLOW_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 DIALOGFLOW_TEST_PROJECT=test123 DIALOGFLOW_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/dialogflow/v2/agents/credentials" + ::Google::Cloud::Dialogflow::V2::Agents::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["DIALOGFLOW_PROJECT"] = project + ENV["DIALOGFLOW_TEST_PROJECT"] = project + ENV["DIALOGFLOW_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-dialogflow-v2 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-dialogflow-v2 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-dialogflow-v2 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-dialogflow-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-dialogflow-v2" + header "google-cloud-dialogflow-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-dialogflow-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-dialogflow-v2 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-dialogflow-v2 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-dialogflow-v2 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-dialogflow-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-dialogflow-v2/gapic_metadata.json new file mode 100644 index 000000000000..001c56be9499 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/gapic_metadata.json @@ -0,0 +1,857 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.dialogflow.v2", + "libraryPackage": "::Google::Cloud::Dialogflow::V2", + "services": { + "Agents": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Agents::Client", + "rpcs": { + "GetAgent": { + "methods": [ + "get_agent" + ] + }, + "SetAgent": { + "methods": [ + "set_agent" + ] + }, + "DeleteAgent": { + "methods": [ + "delete_agent" + ] + }, + "SearchAgents": { + "methods": [ + "search_agents" + ] + }, + "TrainAgent": { + "methods": [ + "train_agent" + ] + }, + "ExportAgent": { + "methods": [ + "export_agent" + ] + }, + "ImportAgent": { + "methods": [ + "import_agent" + ] + }, + "RestoreAgent": { + "methods": [ + "restore_agent" + ] + }, + "GetValidationResult": { + "methods": [ + "get_validation_result" + ] + } + } + } + } + }, + "Tools": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Tools::Client", + "rpcs": { + "CreateTool": { + "methods": [ + "create_tool" + ] + }, + "GetTool": { + "methods": [ + "get_tool" + ] + }, + "ListTools": { + "methods": [ + "list_tools" + ] + }, + "DeleteTool": { + "methods": [ + "delete_tool" + ] + }, + "UpdateTool": { + "methods": [ + "update_tool" + ] + } + } + } + } + }, + "Generators": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Generators::Client", + "rpcs": { + "CreateGenerator": { + "methods": [ + "create_generator" + ] + }, + "GetGenerator": { + "methods": [ + "get_generator" + ] + }, + "ListGenerators": { + "methods": [ + "list_generators" + ] + }, + "DeleteGenerator": { + "methods": [ + "delete_generator" + ] + }, + "UpdateGenerator": { + "methods": [ + "update_generator" + ] + } + } + } + } + }, + "Contexts": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Contexts::Client", + "rpcs": { + "ListContexts": { + "methods": [ + "list_contexts" + ] + }, + "GetContext": { + "methods": [ + "get_context" + ] + }, + "CreateContext": { + "methods": [ + "create_context" + ] + }, + "UpdateContext": { + "methods": [ + "update_context" + ] + }, + "DeleteContext": { + "methods": [ + "delete_context" + ] + }, + "DeleteAllContexts": { + "methods": [ + "delete_all_contexts" + ] + } + } + } + } + }, + "Intents": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Intents::Client", + "rpcs": { + "ListIntents": { + "methods": [ + "list_intents" + ] + }, + "GetIntent": { + "methods": [ + "get_intent" + ] + }, + "CreateIntent": { + "methods": [ + "create_intent" + ] + }, + "UpdateIntent": { + "methods": [ + "update_intent" + ] + }, + "DeleteIntent": { + "methods": [ + "delete_intent" + ] + }, + "BatchUpdateIntents": { + "methods": [ + "batch_update_intents" + ] + }, + "BatchDeleteIntents": { + "methods": [ + "batch_delete_intents" + ] + } + } + } + } + }, + "EntityTypes": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client", + "rpcs": { + "ListEntityTypes": { + "methods": [ + "list_entity_types" + ] + }, + "GetEntityType": { + "methods": [ + "get_entity_type" + ] + }, + "CreateEntityType": { + "methods": [ + "create_entity_type" + ] + }, + "UpdateEntityType": { + "methods": [ + "update_entity_type" + ] + }, + "DeleteEntityType": { + "methods": [ + "delete_entity_type" + ] + }, + "BatchUpdateEntityTypes": { + "methods": [ + "batch_update_entity_types" + ] + }, + "BatchDeleteEntityTypes": { + "methods": [ + "batch_delete_entity_types" + ] + }, + "BatchCreateEntities": { + "methods": [ + "batch_create_entities" + ] + }, + "BatchUpdateEntities": { + "methods": [ + "batch_update_entities" + ] + }, + "BatchDeleteEntities": { + "methods": [ + "batch_delete_entities" + ] + } + } + } + } + }, + "SessionEntityTypes": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client", + "rpcs": { + "ListSessionEntityTypes": { + "methods": [ + "list_session_entity_types" + ] + }, + "GetSessionEntityType": { + "methods": [ + "get_session_entity_type" + ] + }, + "CreateSessionEntityType": { + "methods": [ + "create_session_entity_type" + ] + }, + "UpdateSessionEntityType": { + "methods": [ + "update_session_entity_type" + ] + }, + "DeleteSessionEntityType": { + "methods": [ + "delete_session_entity_type" + ] + } + } + } + } + }, + "Sessions": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Sessions::Client", + "rpcs": { + "DetectIntent": { + "methods": [ + "detect_intent" + ] + }, + "StreamingDetectIntent": { + "methods": [ + "streaming_detect_intent" + ] + } + } + } + } + }, + "Participants": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Participants::Client", + "rpcs": { + "CreateParticipant": { + "methods": [ + "create_participant" + ] + }, + "GetParticipant": { + "methods": [ + "get_participant" + ] + }, + "ListParticipants": { + "methods": [ + "list_participants" + ] + }, + "UpdateParticipant": { + "methods": [ + "update_participant" + ] + }, + "AnalyzeContent": { + "methods": [ + "analyze_content" + ] + }, + "StreamingAnalyzeContent": { + "methods": [ + "streaming_analyze_content" + ] + }, + "SuggestArticles": { + "methods": [ + "suggest_articles" + ] + }, + "SuggestFaqAnswers": { + "methods": [ + "suggest_faq_answers" + ] + }, + "SuggestSmartReplies": { + "methods": [ + "suggest_smart_replies" + ] + }, + "SuggestKnowledgeAssist": { + "methods": [ + "suggest_knowledge_assist" + ] + } + } + } + } + }, + "AnswerRecords": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client", + "rpcs": { + "ListAnswerRecords": { + "methods": [ + "list_answer_records" + ] + }, + "UpdateAnswerRecord": { + "methods": [ + "update_answer_record" + ] + } + } + } + } + }, + "ConversationProfiles": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client", + "rpcs": { + "ListConversationProfiles": { + "methods": [ + "list_conversation_profiles" + ] + }, + "GetConversationProfile": { + "methods": [ + "get_conversation_profile" + ] + }, + "CreateConversationProfile": { + "methods": [ + "create_conversation_profile" + ] + }, + "UpdateConversationProfile": { + "methods": [ + "update_conversation_profile" + ] + }, + "DeleteConversationProfile": { + "methods": [ + "delete_conversation_profile" + ] + }, + "SetSuggestionFeatureConfig": { + "methods": [ + "set_suggestion_feature_config" + ] + }, + "ClearSuggestionFeatureConfig": { + "methods": [ + "clear_suggestion_feature_config" + ] + } + } + } + } + }, + "Conversations": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Conversations::Client", + "rpcs": { + "CreateConversation": { + "methods": [ + "create_conversation" + ] + }, + "ListConversations": { + "methods": [ + "list_conversations" + ] + }, + "GetConversation": { + "methods": [ + "get_conversation" + ] + }, + "CompleteConversation": { + "methods": [ + "complete_conversation" + ] + }, + "IngestContextReferences": { + "methods": [ + "ingest_context_references" + ] + }, + "ListMessages": { + "methods": [ + "list_messages" + ] + }, + "SuggestConversationSummary": { + "methods": [ + "suggest_conversation_summary" + ] + }, + "GenerateStatelessSummary": { + "methods": [ + "generate_stateless_summary" + ] + }, + "GenerateStatelessSuggestion": { + "methods": [ + "generate_stateless_suggestion" + ] + }, + "SearchKnowledge": { + "methods": [ + "search_knowledge" + ] + }, + "GenerateSuggestions": { + "methods": [ + "generate_suggestions" + ] + } + } + } + } + }, + "ConversationDatasets": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client", + "rpcs": { + "CreateConversationDataset": { + "methods": [ + "create_conversation_dataset" + ] + }, + "GetConversationDataset": { + "methods": [ + "get_conversation_dataset" + ] + }, + "ListConversationDatasets": { + "methods": [ + "list_conversation_datasets" + ] + }, + "DeleteConversationDataset": { + "methods": [ + "delete_conversation_dataset" + ] + }, + "ImportConversationData": { + "methods": [ + "import_conversation_data" + ] + } + } + } + } + }, + "ConversationModels": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client", + "rpcs": { + "CreateConversationModel": { + "methods": [ + "create_conversation_model" + ] + }, + "GetConversationModel": { + "methods": [ + "get_conversation_model" + ] + }, + "ListConversationModels": { + "methods": [ + "list_conversation_models" + ] + }, + "DeleteConversationModel": { + "methods": [ + "delete_conversation_model" + ] + }, + "DeployConversationModel": { + "methods": [ + "deploy_conversation_model" + ] + }, + "UndeployConversationModel": { + "methods": [ + "undeploy_conversation_model" + ] + }, + "GetConversationModelEvaluation": { + "methods": [ + "get_conversation_model_evaluation" + ] + }, + "ListConversationModelEvaluations": { + "methods": [ + "list_conversation_model_evaluations" + ] + }, + "CreateConversationModelEvaluation": { + "methods": [ + "create_conversation_model_evaluation" + ] + } + } + } + } + }, + "Documents": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Documents::Client", + "rpcs": { + "ListDocuments": { + "methods": [ + "list_documents" + ] + }, + "GetDocument": { + "methods": [ + "get_document" + ] + }, + "CreateDocument": { + "methods": [ + "create_document" + ] + }, + "ImportDocuments": { + "methods": [ + "import_documents" + ] + }, + "DeleteDocument": { + "methods": [ + "delete_document" + ] + }, + "UpdateDocument": { + "methods": [ + "update_document" + ] + }, + "ReloadDocument": { + "methods": [ + "reload_document" + ] + }, + "ExportDocument": { + "methods": [ + "export_document" + ] + } + } + } + } + }, + "EncryptionSpecService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client", + "rpcs": { + "GetEncryptionSpec": { + "methods": [ + "get_encryption_spec" + ] + }, + "InitializeEncryptionSpec": { + "methods": [ + "initialize_encryption_spec" + ] + } + } + } + } + }, + "Fulfillments": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client", + "rpcs": { + "GetFulfillment": { + "methods": [ + "get_fulfillment" + ] + }, + "UpdateFulfillment": { + "methods": [ + "update_fulfillment" + ] + } + } + } + } + }, + "Environments": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Environments::Client", + "rpcs": { + "ListEnvironments": { + "methods": [ + "list_environments" + ] + }, + "GetEnvironment": { + "methods": [ + "get_environment" + ] + }, + "CreateEnvironment": { + "methods": [ + "create_environment" + ] + }, + "UpdateEnvironment": { + "methods": [ + "update_environment" + ] + }, + "DeleteEnvironment": { + "methods": [ + "delete_environment" + ] + }, + "GetEnvironmentHistory": { + "methods": [ + "get_environment_history" + ] + } + } + } + } + }, + "GeneratorEvaluations": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client", + "rpcs": { + "CreateGeneratorEvaluation": { + "methods": [ + "create_generator_evaluation" + ] + }, + "GetGeneratorEvaluation": { + "methods": [ + "get_generator_evaluation" + ] + }, + "ListGeneratorEvaluations": { + "methods": [ + "list_generator_evaluations" + ] + }, + "DeleteGeneratorEvaluation": { + "methods": [ + "delete_generator_evaluation" + ] + } + } + } + } + }, + "KnowledgeBases": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client", + "rpcs": { + "ListKnowledgeBases": { + "methods": [ + "list_knowledge_bases" + ] + }, + "GetKnowledgeBase": { + "methods": [ + "get_knowledge_base" + ] + }, + "CreateKnowledgeBase": { + "methods": [ + "create_knowledge_base" + ] + }, + "DeleteKnowledgeBase": { + "methods": [ + "delete_knowledge_base" + ] + }, + "UpdateKnowledgeBase": { + "methods": [ + "update_knowledge_base" + ] + } + } + } + } + }, + "SipTrunks": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client", + "rpcs": { + "CreateSipTrunk": { + "methods": [ + "create_sip_trunk" + ] + }, + "DeleteSipTrunk": { + "methods": [ + "delete_sip_trunk" + ] + }, + "ListSipTrunks": { + "methods": [ + "list_sip_trunks" + ] + }, + "GetSipTrunk": { + "methods": [ + "get_sip_trunk" + ] + }, + "UpdateSipTrunk": { + "methods": [ + "update_sip_trunk" + ] + } + } + } + } + }, + "Versions": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Dialogflow::V2::Versions::Client", + "rpcs": { + "ListVersions": { + "methods": [ + "list_versions" + ] + }, + "GetVersion": { + "methods": [ + "get_version" + ] + }, + "CreateVersion": { + "methods": [ + "create_version" + ] + }, + "UpdateVersion": { + "methods": [ + "update_version" + ] + }, + "DeleteVersion": { + "methods": [ + "delete_version" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec b/owl-bot-staging/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec new file mode 100644 index 000000000000..3836a70f4dcf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/dialogflow/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-dialogflow-v2" + gem.version = Google::Cloud::Dialogflow::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Dialogflow is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business. This client is for Dialogflow ES, providing the standard agent type suitable for small and simple agents. Note that google-cloud-dialogflow-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dialogflow instead. See the readme for more details." + gem.summary = "Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices)." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.3" + 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-dialogflow-v2/lib/google-cloud-dialogflow-v2.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google-cloud-dialogflow-v2.rb new file mode 100644 index 000000000000..2c54e39fb632 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google-cloud-dialogflow-v2.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/dialogflow/v2" diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2.rb new file mode 100644 index 000000000000..77cc5fc4053a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/agents" +require "google/cloud/dialogflow/v2/tools" +require "google/cloud/dialogflow/v2/generators" +require "google/cloud/dialogflow/v2/contexts" +require "google/cloud/dialogflow/v2/intents" +require "google/cloud/dialogflow/v2/entity_types" +require "google/cloud/dialogflow/v2/session_entity_types" +require "google/cloud/dialogflow/v2/sessions" +require "google/cloud/dialogflow/v2/participants" +require "google/cloud/dialogflow/v2/answer_records" +require "google/cloud/dialogflow/v2/conversation_profiles" +require "google/cloud/dialogflow/v2/conversations" +require "google/cloud/dialogflow/v2/conversation_datasets" +require "google/cloud/dialogflow/v2/conversation_models" +require "google/cloud/dialogflow/v2/documents" +require "google/cloud/dialogflow/v2/encryption_spec_service" +require "google/cloud/dialogflow/v2/fulfillments" +require "google/cloud/dialogflow/v2/environments" +require "google/cloud/dialogflow/v2/generator_evaluations" +require "google/cloud/dialogflow/v2/knowledge_bases" +require "google/cloud/dialogflow/v2/sip_trunks" +require "google/cloud/dialogflow/v2/versions" +require "google/cloud/dialogflow/v2/version" + +module Google + module Cloud + module Dialogflow + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2" + # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/dialogflow/v2" + # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + module V2 + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/dialogflow/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_coaching_instruction_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_coaching_instruction_pb.rb new file mode 100644 index 000000000000..312afb8c689c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_coaching_instruction_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/agent_coaching_instruction.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n;google/cloud/dialogflow/v2/agent_coaching_instruction.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\"\x9c\x06\n\x18\x41gentCoachingInstruction\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x64isplay_details\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tcondition\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61gent_action\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rsystem_action\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12n\n\x16\x64uplicate_check_result\x18\x08 \x01(\x0b\x32I.google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResultB\x03\xe0\x41\x03\x12`\n\x10triggering_event\x18\n \x01(\x0e\x32\x41.google.cloud.dialogflow.v2.AgentCoachingInstruction.TriggerEventB\x03\xe0\x41\x01\x1a\x8b\x02\n\x14\x44uplicateCheckResult\x12\x81\x01\n\x15\x64uplicate_suggestions\x18\x01 \x03(\x0b\x32].google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult.DuplicateSuggestionB\x03\xe0\x41\x03\x1ao\n\x13\x44uplicateSuggestion\x12\x1a\n\ranswer_record\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10suggestion_index\x18\x03 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1d\n\x10similarity_score\x18\x04 \x01(\x02\x42\x03\xe0\x41\x03\"\x97\x01\n\x0cTriggerEvent\x12\x1d\n\x19TRIGGER_EVENT_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45ND_OF_UTTERANCE\x10\x01\x12\x0f\n\x0bMANUAL_CALL\x10\x02\x12\x14\n\x10\x43USTOMER_MESSAGE\x10\x03\x12\x11\n\rAGENT_MESSAGE\x10\x04\x12\x18\n\x14TOOL_CALL_COMPLETION\x10\x05\x42\xa3\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x1d\x41gentCoachingInstructionProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + AgentCoachingInstruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingInstruction").msgclass + AgentCoachingInstruction::DuplicateCheckResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult").msgclass + AgentCoachingInstruction::DuplicateCheckResult::DuplicateSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult.DuplicateSuggestion").msgclass + AgentCoachingInstruction::TriggerEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingInstruction.TriggerEvent").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_pb.rb new file mode 100644 index 000000000000..f90b66a96d9a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_pb.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/agent.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/dialogflow/v2/validation_result_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n&google/cloud/dialogflow/v2/agent.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/dialogflow/v2/validation_result.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xa5\x07\n\x05\x41gent\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x15\x64\x65\x66\x61ult_language_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12%\n\x18supported_language_codes\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\ttime_zone\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\navatar_uri\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65nable_logging\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12\x46\n\nmatch_mode\x18\t \x01(\x0e\x32+.google.cloud.dialogflow.v2.Agent.MatchModeB\x05\x18\x01\xe0\x41\x01\x12%\n\x18\x63lassification_threshold\x18\n \x01(\x02\x42\x03\xe0\x41\x01\x12\x46\n\x0b\x61pi_version\x18\x0e \x01(\x0e\x32,.google.cloud.dialogflow.v2.Agent.ApiVersionB\x03\xe0\x41\x01\x12\x39\n\x04tier\x18\x0f \x01(\x0e\x32&.google.cloud.dialogflow.v2.Agent.TierB\x03\xe0\x41\x01\"V\n\tMatchMode\x12\x1a\n\x16MATCH_MODE_UNSPECIFIED\x10\x00\x12\x15\n\x11MATCH_MODE_HYBRID\x10\x01\x12\x16\n\x12MATCH_MODE_ML_ONLY\x10\x02\"l\n\nApiVersion\x12\x1b\n\x17\x41PI_VERSION_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x41PI_VERSION_V1\x10\x01\x12\x12\n\x0e\x41PI_VERSION_V2\x10\x02\x12\x19\n\x15\x41PI_VERSION_V2_BETA_1\x10\x03\"b\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\x11\n\rTIER_STANDARD\x10\x01\x12\x13\n\x0fTIER_ENTERPRISE\x10\x02\x12\x1c\n\x14TIER_ENTERPRISE_PLUS\x10\x03\x1a\x02\x08\x01:m\xea\x41j\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x18projects/{project}/agent\x12-projects/{project}/locations/{location}/agent\"J\n\x0fGetAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\"~\n\x0fSetAgentRequest\x12\x35\n\x05\x61gent\x18\x01 \x01(\x0b\x32!.google.cloud.dialogflow.v2.AgentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"M\n\x12\x44\x65leteAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\"z\n\x13SearchAgentsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x03 \x01(\t\"b\n\x14SearchAgentsResponse\x12\x31\n\x06\x61gents\x18\x01 \x03(\x0b\x32!.google.cloud.dialogflow.v2.Agent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11TrainAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\"e\n\x12\x45xportAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x16\n\tagent_uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\"L\n\x13\x45xportAgentResponse\x12\x13\n\tagent_uri\x18\x01 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x02 \x01(\x0cH\x00\x42\x07\n\x05\x61gent\"\x84\x01\n\x12ImportAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x13\n\tagent_uri\x18\x02 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x03 \x01(\x0cH\x00\x42\x07\n\x05\x61gent\"\x85\x01\n\x13RestoreAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x13\n\tagent_uri\x18\x02 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x03 \x01(\x0cH\x00\x42\x07\n\x05\x61gent\"q\n\x1aGetValidationResultRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x32\xaa\x11\n\x06\x41gents\x12\xb7\x01\n\x08GetAgent\x12+.google.cloud.dialogflow.v2.GetAgentRequest\x1a!.google.cloud.dialogflow.v2.Agent\"[\xda\x41\x06parent\x82\xd3\xe4\x93\x02L\x12\x1d/v2/{parent=projects/*}/agentZ+\x12)/v2/{parent=projects/*/locations/*}/agent\x12\xd0\x01\n\x08SetAgent\x12+.google.cloud.dialogflow.v2.SetAgentRequest\x1a!.google.cloud.dialogflow.v2.Agent\"t\xda\x41\x05\x61gent\x82\xd3\xe4\x93\x02\x66\"#/v2/{agent.parent=projects/*}/agent:\x05\x61gentZ8\"//v2/{agent.parent=projects/*/locations/*}/agent:\x05\x61gent\x12\xb2\x01\n\x0b\x44\x65leteAgent\x12..google.cloud.dialogflow.v2.DeleteAgentRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x06parent\x82\xd3\xe4\x93\x02L*\x1d/v2/{parent=projects/*}/agentZ+*)/v2/{parent=projects/*/locations/*}/agent\x12\xdc\x01\n\x0cSearchAgents\x12/.google.cloud.dialogflow.v2.SearchAgentsRequest\x1a\x30.google.cloud.dialogflow.v2.SearchAgentsResponse\"i\xda\x41\x06parent\x82\xd3\xe4\x93\x02Z\x12$/v2/{parent=projects/*}/agent:searchZ2\x12\x30/v2/{parent=projects/*/locations/*}/agent:search\x12\xfc\x01\n\nTrainAgent\x12-.google.cloud.dialogflow.v2.TrainAgentRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x06parent\x82\xd3\xe4\x93\x02^\"#/v2/{parent=projects/*}/agent:train:\x01*Z4\"//v2/{parent=projects/*/locations/*}/agent:train:\x01*\x12\x99\x02\n\x0b\x45xportAgent\x12..google.cloud.dialogflow.v2.ExportAgentRequest\x1a\x1d.google.longrunning.Operation\"\xba\x01\xca\x41H\n.google.cloud.dialogflow.v2.ExportAgentResponse\x12\x16google.protobuf.Struct\xda\x41\x06parent\x82\xd3\xe4\x93\x02`\"$/v2/{parent=projects/*}/agent:export:\x01*Z5\"0/v2/{parent=projects/*/locations/*}/agent:export:\x01*\x12\xf7\x01\n\x0bImportAgent\x12..google.cloud.dialogflow.v2.ImportAgentRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02`\"$/v2/{parent=projects/*}/agent:import:\x01*Z5\"0/v2/{parent=projects/*/locations/*}/agent:import:\x01*\x12\xfb\x01\n\x0cRestoreAgent\x12/.google.cloud.dialogflow.v2.RestoreAgentRequest\x1a\x1d.google.longrunning.Operation\"\x9a\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x62\"%/v2/{parent=projects/*}/agent:restore:\x01*Z6\"1/v2/{parent=projects/*/locations/*}/agent:restore:\x01*\x12\xf1\x01\n\x13GetValidationResult\x12\x36.google.cloud.dialogflow.v2.GetValidationResultRequest\x1a,.google.cloud.dialogflow.v2.ValidationResult\"t\x82\xd3\xe4\x93\x02n\x12./v2/{parent=projects/*}/agent/validationResultZ<\x12:/v2/{parent=projects/*/locations/*}/agent/validationResult\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x90\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\nAgentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + Agent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Agent").msgclass + Agent::MatchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Agent.MatchMode").enummodule + Agent::ApiVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Agent.ApiVersion").enummodule + Agent::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Agent.Tier").enummodule + GetAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetAgentRequest").msgclass + SetAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SetAgentRequest").msgclass + DeleteAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteAgentRequest").msgclass + SearchAgentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchAgentsRequest").msgclass + SearchAgentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchAgentsResponse").msgclass + TrainAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TrainAgentRequest").msgclass + ExportAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ExportAgentRequest").msgclass + ExportAgentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ExportAgentResponse").msgclass + ImportAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportAgentRequest").msgclass + RestoreAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RestoreAgentRequest").msgclass + GetValidationResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetValidationResultRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_services_pb.rb new file mode 100644 index 000000000000..8f08bfbe6597 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_services_pb.rb @@ -0,0 +1,144 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/agent.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/agent_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Agents + # Service for managing [Agents][google.cloud.dialogflow.v2.Agent]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Agents' + + # Retrieves the specified agent. + rpc :GetAgent, ::Google::Cloud::Dialogflow::V2::GetAgentRequest, ::Google::Cloud::Dialogflow::V2::Agent + # Creates/updates the specified agent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :SetAgent, ::Google::Cloud::Dialogflow::V2::SetAgentRequest, ::Google::Cloud::Dialogflow::V2::Agent + # Deletes the specified agent. + rpc :DeleteAgent, ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, ::Google::Protobuf::Empty + # Returns the list of agents. + # + # Since there is at most one conversational agent per project, this method is + # useful primarily for listing all agents across projects the caller has + # access to. One can achieve that with a wildcard project collection id "-". + # Refer to [List + # Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + rpc :SearchAgents, ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse + # Trains the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :TrainAgent, ::Google::Cloud::Dialogflow::V2::TrainAgentRequest, ::Google::Longrunning::Operation + # Exports the specified agent to a ZIP file. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse] + rpc :ExportAgent, ::Google::Cloud::Dialogflow::V2::ExportAgentRequest, ::Google::Longrunning::Operation + # Imports the specified agent from a ZIP file. + # + # Uploads new intents and entity types without deleting the existing ones. + # Intents and entity types with the same name are replaced with the new + # versions from + # [ImportAgentRequest][google.cloud.dialogflow.v2.ImportAgentRequest]. After + # the import, the imported draft agent will be trained automatically (unless + # disabled in agent settings). However, once the import is done, training may + # not be completed yet. Please call + # [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the + # operation it returns in order to train explicitly. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # The operation only tracks when importing is complete, not when it is done + # training. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :ImportAgent, ::Google::Cloud::Dialogflow::V2::ImportAgentRequest, ::Google::Longrunning::Operation + # Restores the specified agent from a ZIP file. + # + # Replaces the current agent version with a new one. All the intents and + # entity types in the older version are deleted. After the restore, the + # restored draft agent will be trained automatically (unless disabled in + # agent settings). However, once the restore is done, training may not be + # completed yet. Please call + # [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the + # operation it returns in order to train explicitly. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # The operation only tracks when restoring is complete, not when it is done + # training. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :RestoreAgent, ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, ::Google::Longrunning::Operation + # Gets agent validation result. Agent validation is performed during + # training time and is updated automatically when training is completed. + rpc :GetValidationResult, ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest, ::Google::Cloud::Dialogflow::V2::ValidationResult + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents.rb new file mode 100644 index 000000000000..cdb5cbaa5ff6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/agents/credentials" +require "google/cloud/dialogflow/v2/agents/paths" +require "google/cloud/dialogflow/v2/agents/operations" +require "google/cloud/dialogflow/v2/agents/client" +require "google/cloud/dialogflow/v2/agents/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Agent Agents}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/agents" + # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/agents/rest" + # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + module Agents + end + end + end + end +end + +helper_path = ::File.join __dir__, "agents", "helpers.rb" +require "google/cloud/dialogflow/v2/agents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb new file mode 100644 index 000000000000..621834f6bcd8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb @@ -0,0 +1,1434 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/agent_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Agents + ## + # Client for the Agents service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Agent Agents}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :agents_stub + + ## + # Configure the Agents Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Agents::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Agents clients + # ::Google::Cloud::Dialogflow::V2::Agents::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Agents 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::Dialogflow::V2::Agents::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 + @agents_stub.universe_domain + end + + ## + # Create a new Agents client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Agents 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/dialogflow/v2/agent_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 + + @agents_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Agents::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 + ) + + @agents_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 = @agents_stub.endpoint + config.universe_domain = @agents_stub.universe_domain + config.logger = @agents_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::Agents::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 + @agents_stub.logger + end + + # Service calls + + ## + # Retrieves the specified agent. + # + # @overload get_agent(request, options = nil) + # Pass arguments to `get_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil) + # Pass arguments to `get_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to fetch is associated with. + # Format: `projects/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Agent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Agent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new + # + # # Call the get_agent method. + # result = client.get_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + # p result + # + def get_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetAgentRequest + + # Converts hash and nil to 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_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.get_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :get_agent, 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/updates the specified agent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload set_agent(request, options = nil) + # Pass arguments to `set_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SetAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SetAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_agent(agent: nil, update_mask: nil) + # Pass arguments to `set_agent` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param agent [::Google::Cloud::Dialogflow::V2::Agent, ::Hash] + # Required. The agent to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Agent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Agent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new + # + # # Call the set_agent method. + # result = client.set_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + # p result + # + def set_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SetAgentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.agent&.parent + header_params["agent.parent"] = request.agent.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.set_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :set_agent, 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 specified agent. + # + # @overload delete_agent(request, options = nil) + # Pass arguments to `delete_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil) + # Pass arguments to `delete_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to delete is associated with. + # Format: `projects/`. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new + # + # # Call the delete_agent method. + # result = client.delete_agent request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest + + # Converts hash and nil to 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_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.delete_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :delete_agent, 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 + + ## + # Returns the list of agents. + # + # Since there is at most one conversational agent per project, this method is + # useful primarily for listing all agents across projects the caller has + # access to. One can achieve that with a wildcard project collection id "-". + # Refer to [List + # Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + # + # @overload search_agents(request, options = nil) + # Pass arguments to `search_agents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SearchAgentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agents(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_agents` via keyword arguments. Note that at + # least one keyword argument is 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 project to list agents from. + # Format: `projects/`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new + # + # # Call the search_agents method. + # result = client.search_agents 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::Dialogflow::V2::Agent. + # p item + # end + # + def search_agents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest + + # Converts hash and nil to 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_agents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.search_agents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_agents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :search_agents, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @agents_stub, :search_agents, 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 + + ## + # Trains the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload train_agent(request, options = nil) + # Pass arguments to `train_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::TrainAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::TrainAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil) + # Pass arguments to `train_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to train is associated with. + # Format: `projects/`. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new + # + # # Call the train_agent method. + # result = client.train_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::TrainAgentRequest + + # Converts hash and nil to 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_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.train_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.train_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :train_agent, 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 + + ## + # Exports the specified agent to a ZIP file. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse} + # + # @overload export_agent(request, options = nil) + # Pass arguments to `export_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ExportAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ExportAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_agent(parent: nil, agent_uri: nil) + # Pass arguments to `export_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to export is associated with. + # Format: `projects/`. + # @param agent_uri [::String] + # Required. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the agent + # to. The format of this URI must be `gs:///`. If + # left unspecified, the serialized agent is returned inline. + # + # Dialogflow performs a write operation for the Cloud Storage object + # on the caller's behalf, so your request authentication must + # have write permissions for the object. For more information, see + # [Dialogflow access + # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new + # + # # Call the export_agent method. + # result = client.export_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 export_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ExportAgentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.export_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.export_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :export_agent, 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 the specified agent from a ZIP file. + # + # Uploads new intents and entity types without deleting the existing ones. + # Intents and entity types with the same name are replaced with the new + # versions from + # {::Google::Cloud::Dialogflow::V2::ImportAgentRequest ImportAgentRequest}. After + # the import, the imported draft agent will be trained automatically (unless + # disabled in agent settings). However, once the import is done, training may + # not be completed yet. Please call + # {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent TrainAgent} and wait for the + # operation it returns in order to train explicitly. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # The operation only tracks when importing is complete, not when it is done + # training. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload import_agent(request, options = nil) + # Pass arguments to `import_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ImportAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ImportAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil, agent_uri: nil, agent_content: nil) + # Pass arguments to `import_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to import is associated with. + # Format: `projects/`. + # @param agent_uri [::String] + # The URI to a Google Cloud Storage file containing the agent to import. + # Note: The URI must start with "gs://". + # + # Dialogflow performs a read operation for the Cloud Storage object + # on the caller's behalf, so your request authentication must + # have read permissions for the object. For more information, see + # [Dialogflow access + # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # Note: The following parameters are mutually exclusive: `agent_uri`, `agent_content`. 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 agent_content [::String] + # Zip compressed raw byte content for agent. + # + # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`. 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. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new + # + # # Call the import_agent method. + # result = client.import_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ImportAgentRequest + + # Converts hash and nil to 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_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :import_agent, 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 + + ## + # Restores the specified agent from a ZIP file. + # + # Replaces the current agent version with a new one. All the intents and + # entity types in the older version are deleted. After the restore, the + # restored draft agent will be trained automatically (unless disabled in + # agent settings). However, once the restore is done, training may not be + # completed yet. Please call + # {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent TrainAgent} and wait for the + # operation it returns in order to train explicitly. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # The operation only tracks when restoring is complete, not when it is done + # training. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload restore_agent(request, options = nil) + # Pass arguments to `restore_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::RestoreAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload restore_agent(parent: nil, agent_uri: nil, agent_content: nil) + # Pass arguments to `restore_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to restore is associated with. + # Format: `projects/`. + # @param agent_uri [::String] + # The URI to a Google Cloud Storage file containing the agent to restore. + # Note: The URI must start with "gs://". + # + # Dialogflow performs a read operation for the Cloud Storage object + # on the caller's behalf, so your request authentication must + # have read permissions for the object. For more information, see + # [Dialogflow access + # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # Note: The following parameters are mutually exclusive: `agent_uri`, `agent_content`. 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 agent_content [::String] + # Zip compressed raw byte content for agent. + # + # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`. 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. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new + # + # # Call the restore_agent method. + # result = client.restore_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 restore_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.restore_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.restore_agent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.restore_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :restore_agent, 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 agent validation result. Agent validation is performed during + # training time and is updated automatically when training is completed. + # + # @overload get_validation_result(request, options = nil) + # Pass arguments to `get_validation_result` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetValidationResultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetValidationResultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_validation_result(parent: nil, language_code: nil) + # Pass arguments to `get_validation_result` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent is associated with. + # Format: `projects/`. + # @param language_code [::String] + # Optional. The language for which you want a validation result. If not + # specified, the agent's default language is used. [Many + # languages](https://cloud.google.com/dialogflow/docs/reference/language) + # are supported. Note: languages must be enabled in the agent before they can + # be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::ValidationResult] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::ValidationResult] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new + # + # # Call the get_validation_result method. + # result = client.get_validation_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult. + # p result + # + def get_validation_result request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest + + # Converts hash and nil to 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_validation_result.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.get_validation_result.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_validation_result.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.call_rpc :get_validation_result, 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 Agents API. + # + # This class represents the configuration for Agents, + # 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::Dialogflow::V2::Agents::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_agent to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_agent.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_agent.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::Dialogflow::V2::Agents::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Agents 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :get_agent + ## + # RPC-specific configuration for `set_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :set_agent + ## + # RPC-specific configuration for `delete_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_agent + ## + # RPC-specific configuration for `search_agents` + # @return [::Gapic::Config::Method] + # + attr_reader :search_agents + ## + # RPC-specific configuration for `train_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :train_agent + ## + # RPC-specific configuration for `export_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :export_agent + ## + # RPC-specific configuration for `import_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :import_agent + ## + # RPC-specific configuration for `restore_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_agent + ## + # RPC-specific configuration for `get_validation_result` + # @return [::Gapic::Config::Method] + # + attr_reader :get_validation_result + + # @private + def initialize parent_rpcs = nil + get_agent_config = parent_rpcs.get_agent if parent_rpcs.respond_to? :get_agent + @get_agent = ::Gapic::Config::Method.new get_agent_config + set_agent_config = parent_rpcs.set_agent if parent_rpcs.respond_to? :set_agent + @set_agent = ::Gapic::Config::Method.new set_agent_config + delete_agent_config = parent_rpcs.delete_agent if parent_rpcs.respond_to? :delete_agent + @delete_agent = ::Gapic::Config::Method.new delete_agent_config + search_agents_config = parent_rpcs.search_agents if parent_rpcs.respond_to? :search_agents + @search_agents = ::Gapic::Config::Method.new search_agents_config + train_agent_config = parent_rpcs.train_agent if parent_rpcs.respond_to? :train_agent + @train_agent = ::Gapic::Config::Method.new train_agent_config + export_agent_config = parent_rpcs.export_agent if parent_rpcs.respond_to? :export_agent + @export_agent = ::Gapic::Config::Method.new export_agent_config + import_agent_config = parent_rpcs.import_agent if parent_rpcs.respond_to? :import_agent + @import_agent = ::Gapic::Config::Method.new import_agent_config + restore_agent_config = parent_rpcs.restore_agent if parent_rpcs.respond_to? :restore_agent + @restore_agent = ::Gapic::Config::Method.new restore_agent_config + get_validation_result_config = parent_rpcs.get_validation_result if parent_rpcs.respond_to? :get_validation_result + @get_validation_result = ::Gapic::Config::Method.new get_validation_result_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/credentials.rb new file mode 100644 index 000000000000..d21c5742ff94 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Agents + # Credentials for the Agents API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb new file mode 100644 index 000000000000..e49c4455fec2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module Agents + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Agents 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 Agents 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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/paths.rb new file mode 100644 index 000000000000..41fa36bb8c2c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/paths.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module Agents + # Path helper methods for the Agents API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # @overload agent_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/agent` + # + # @param project [String] + # + # @overload agent_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def agent_path **args + resources = { + "project" => (proc do |project:| + "projects/#{project}/agent" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent" + 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 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 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest.rb new file mode 100644 index 000000000000..480feaf5ea97 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/agents/credentials" +require "google/cloud/dialogflow/v2/agents/paths" +require "google/cloud/dialogflow/v2/agents/rest/operations" +require "google/cloud/dialogflow/v2/agents/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Agent Agents}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/agents/rest" + # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + module Agents + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/agents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb new file mode 100644 index 000000000000..87e16aca5e23 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb @@ -0,0 +1,1336 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/agent_pb" +require "google/cloud/dialogflow/v2/agents/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Agents + module Rest + ## + # REST client for the Agents service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Agent Agents}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :agents_stub + + ## + # Configure the Agents Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Agents::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Agents clients + # ::Google::Cloud::Dialogflow::V2::Agents::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Agents 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::Dialogflow::V2::Agents::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 + @agents_stub.universe_domain + end + + ## + # Create a new Agents REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Agents 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::Dialogflow::V2::Agents::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 + + @agents_stub = ::Google::Cloud::Dialogflow::V2::Agents::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @agents_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 = @agents_stub.endpoint + config.universe_domain = @agents_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @agents_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::Agents::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 + @agents_stub.logger + end + + # Service calls + + ## + # Retrieves the specified agent. + # + # @overload get_agent(request, options = nil) + # Pass arguments to `get_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil) + # Pass arguments to `get_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to fetch is associated with. + # Format: `projects/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Agent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new + # + # # Call the get_agent method. + # result = client.get_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + # p result + # + def get_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetAgentRequest + + # Converts hash and nil to an 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_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.get_agent 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/updates the specified agent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload set_agent(request, options = nil) + # Pass arguments to `set_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SetAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SetAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_agent(agent: nil, update_mask: nil) + # Pass arguments to `set_agent` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param agent [::Google::Cloud::Dialogflow::V2::Agent, ::Hash] + # Required. The agent to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Agent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new + # + # # Call the set_agent method. + # result = client.set_agent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + # p result + # + def set_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SetAgentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.set_agent 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 specified agent. + # + # @overload delete_agent(request, options = nil) + # Pass arguments to `delete_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil) + # Pass arguments to `delete_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to delete is associated with. + # Format: `projects/`. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new + # + # # Call the delete_agent method. + # result = client.delete_agent request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest + + # Converts hash and nil to an 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_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.delete_agent 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 + + ## + # Returns the list of agents. + # + # Since there is at most one conversational agent per project, this method is + # useful primarily for listing all agents across projects the caller has + # access to. One can achieve that with a wildcard project collection id "-". + # Refer to [List + # Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + # + # @overload search_agents(request, options = nil) + # Pass arguments to `search_agents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SearchAgentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agents(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_agents` via keyword arguments. Note that at + # least one keyword argument is 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 project to list agents from. + # Format: `projects/`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new + # + # # Call the search_agents method. + # result = client.search_agents 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::Dialogflow::V2::Agent. + # p item + # end + # + def search_agents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest + + # Converts hash and nil to an 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_agents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_agents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.search_agents request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @agents_stub, :search_agents, "agents", 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 + + ## + # Trains the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload train_agent(request, options = nil) + # Pass arguments to `train_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::TrainAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::TrainAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil) + # Pass arguments to `train_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to train is associated with. + # Format: `projects/`. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new + # + # # Call the train_agent method. + # result = client.train_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::TrainAgentRequest + + # Converts hash and nil to an 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_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.train_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.train_agent 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 + + ## + # Exports the specified agent to a ZIP file. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse} + # + # @overload export_agent(request, options = nil) + # Pass arguments to `export_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ExportAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ExportAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_agent(parent: nil, agent_uri: nil) + # Pass arguments to `export_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to export is associated with. + # Format: `projects/`. + # @param agent_uri [::String] + # Required. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the agent + # to. The format of this URI must be `gs:///`. If + # left unspecified, the serialized agent is returned inline. + # + # Dialogflow performs a write operation for the Cloud Storage object + # on the caller's behalf, so your request authentication must + # have write permissions for the object. For more information, see + # [Dialogflow access + # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new + # + # # Call the export_agent method. + # result = client.export_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 export_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ExportAgentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.export_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.export_agent 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 the specified agent from a ZIP file. + # + # Uploads new intents and entity types without deleting the existing ones. + # Intents and entity types with the same name are replaced with the new + # versions from + # {::Google::Cloud::Dialogflow::V2::ImportAgentRequest ImportAgentRequest}. After + # the import, the imported draft agent will be trained automatically (unless + # disabled in agent settings). However, once the import is done, training may + # not be completed yet. Please call + # {::Google::Cloud::Dialogflow::V2::Agents::Rest::Client#train_agent TrainAgent} and wait for the + # operation it returns in order to train explicitly. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # The operation only tracks when importing is complete, not when it is done + # training. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload import_agent(request, options = nil) + # Pass arguments to `import_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ImportAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ImportAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_agent(parent: nil, agent_uri: nil, agent_content: nil) + # Pass arguments to `import_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to import is associated with. + # Format: `projects/`. + # @param agent_uri [::String] + # The URI to a Google Cloud Storage file containing the agent to import. + # Note: The URI must start with "gs://". + # + # Dialogflow performs a read operation for the Cloud Storage object + # on the caller's behalf, so your request authentication must + # have read permissions for the object. For more information, see + # [Dialogflow access + # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # Note: The following parameters are mutually exclusive: `agent_uri`, `agent_content`. 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 agent_content [::String] + # Zip compressed raw byte content for agent. + # + # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`. 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. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new + # + # # Call the import_agent method. + # result = client.import_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ImportAgentRequest + + # Converts hash and nil to an 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_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.import_agent 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 + + ## + # Restores the specified agent from a ZIP file. + # + # Replaces the current agent version with a new one. All the intents and + # entity types in the older version are deleted. After the restore, the + # restored draft agent will be trained automatically (unless disabled in + # agent settings). However, once the restore is done, training may not be + # completed yet. Please call + # {::Google::Cloud::Dialogflow::V2::Agents::Rest::Client#train_agent TrainAgent} and wait for the + # operation it returns in order to train explicitly. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # The operation only tracks when restoring is complete, not when it is done + # training. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload restore_agent(request, options = nil) + # Pass arguments to `restore_agent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::RestoreAgentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload restore_agent(parent: nil, agent_uri: nil, agent_content: nil) + # Pass arguments to `restore_agent` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent to restore is associated with. + # Format: `projects/`. + # @param agent_uri [::String] + # The URI to a Google Cloud Storage file containing the agent to restore. + # Note: The URI must start with "gs://". + # + # Dialogflow performs a read operation for the Cloud Storage object + # on the caller's behalf, so your request authentication must + # have read permissions for the object. For more information, see + # [Dialogflow access + # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # Note: The following parameters are mutually exclusive: `agent_uri`, `agent_content`. 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 agent_content [::String] + # Zip compressed raw byte content for agent. + # + # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`. 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. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new + # + # # Call the restore_agent method. + # result = client.restore_agent request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 restore_agent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.restore_agent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.restore_agent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.restore_agent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.restore_agent 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 agent validation result. Agent validation is performed during + # training time and is updated automatically when training is completed. + # + # @overload get_validation_result(request, options = nil) + # Pass arguments to `get_validation_result` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetValidationResultRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetValidationResultRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_validation_result(parent: nil, language_code: nil) + # Pass arguments to `get_validation_result` via keyword arguments. Note that at + # least one keyword argument is 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 project that the agent is associated with. + # Format: `projects/`. + # @param language_code [::String] + # Optional. The language for which you want a validation result. If not + # specified, the agent's default language is used. [Many + # languages](https://cloud.google.com/dialogflow/docs/reference/language) + # are supported. Note: languages must be enabled in the agent before they can + # be used. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::ValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ValidationResult] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new + # + # # Call the get_validation_result method. + # result = client.get_validation_result request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult. + # p result + # + def get_validation_result request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest + + # Converts hash and nil to an 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_validation_result.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_validation_result.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_validation_result.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @agents_stub.get_validation_result 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 Agents REST API. + # + # This class represents the configuration for Agents 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::Dialogflow::V2::Agents::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_agent to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_agent.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_agent.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Agents 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :get_agent + ## + # RPC-specific configuration for `set_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :set_agent + ## + # RPC-specific configuration for `delete_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_agent + ## + # RPC-specific configuration for `search_agents` + # @return [::Gapic::Config::Method] + # + attr_reader :search_agents + ## + # RPC-specific configuration for `train_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :train_agent + ## + # RPC-specific configuration for `export_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :export_agent + ## + # RPC-specific configuration for `import_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :import_agent + ## + # RPC-specific configuration for `restore_agent` + # @return [::Gapic::Config::Method] + # + attr_reader :restore_agent + ## + # RPC-specific configuration for `get_validation_result` + # @return [::Gapic::Config::Method] + # + attr_reader :get_validation_result + + # @private + def initialize parent_rpcs = nil + get_agent_config = parent_rpcs.get_agent if parent_rpcs.respond_to? :get_agent + @get_agent = ::Gapic::Config::Method.new get_agent_config + set_agent_config = parent_rpcs.set_agent if parent_rpcs.respond_to? :set_agent + @set_agent = ::Gapic::Config::Method.new set_agent_config + delete_agent_config = parent_rpcs.delete_agent if parent_rpcs.respond_to? :delete_agent + @delete_agent = ::Gapic::Config::Method.new delete_agent_config + search_agents_config = parent_rpcs.search_agents if parent_rpcs.respond_to? :search_agents + @search_agents = ::Gapic::Config::Method.new search_agents_config + train_agent_config = parent_rpcs.train_agent if parent_rpcs.respond_to? :train_agent + @train_agent = ::Gapic::Config::Method.new train_agent_config + export_agent_config = parent_rpcs.export_agent if parent_rpcs.respond_to? :export_agent + @export_agent = ::Gapic::Config::Method.new export_agent_config + import_agent_config = parent_rpcs.import_agent if parent_rpcs.respond_to? :import_agent + @import_agent = ::Gapic::Config::Method.new import_agent_config + restore_agent_config = parent_rpcs.restore_agent if parent_rpcs.respond_to? :restore_agent + @restore_agent = ::Gapic::Config::Method.new restore_agent_config + get_validation_result_config = parent_rpcs.get_validation_result if parent_rpcs.respond_to? :get_validation_result + @get_validation_result = ::Gapic::Config::Method.new get_validation_result_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb new file mode 100644 index 000000000000..c6122f5ebd0b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb @@ -0,0 +1,947 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module Agents + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Agents 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 Agents 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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb new file mode 100644 index 000000000000..01cf87318d60 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb @@ -0,0 +1,703 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/agent_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Agents + module Rest + ## + # REST service stub for the Agents 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_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Agent] + # A result object deserialized from the server's reply + def get_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_agent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_agent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Agent.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SetAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Agent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Agent] + # A result object deserialized from the server's reply + def set_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_agent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_agent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Agent.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_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_agent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_agent", + 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 search_agents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchAgentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SearchAgentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SearchAgentsResponse] + # A result object deserialized from the server's reply + def search_agents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_agents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_agents", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the train_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::TrainAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_train_agent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_agent", + 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 export_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ExportAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 export_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_agent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "export_agent", + 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_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ImportAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_agent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_agent", + 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 restore_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::RestoreAgentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 restore_agent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_restore_agent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "restore_agent", + 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_validation_result REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetValidationResultRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ValidationResult] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ValidationResult] + # A result object deserialized from the server's reply + def get_validation_result request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_validation_result_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_validation_result", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ValidationResult.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_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetAgentRequest] + # 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_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/agent", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/agent", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SetAgentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{agent.parent}/agent", + body: "agent", + matches: [ + ["agent.parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{agent.parent}/agent", + body: "agent", + matches: [ + ["agent.parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteAgentRequest] + # 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_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{parent}/agent", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{parent}/agent", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_agents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchAgentsRequest] + # 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_agents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/agent:search", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/agent:search", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the train_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::TrainAgentRequest] + # 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_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/agent:train", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/agent:train", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ExportAgentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/agent:export", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/agent:export", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ImportAgentRequest] + # 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_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/agent:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/agent:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the restore_agent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::RestoreAgentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_restore_agent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/agent:restore", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/agent:restore", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_validation_result REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetValidationResultRequest] + # 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_validation_result_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/agent/validationResult", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/agent/validationResult", + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_pb.rb new file mode 100644 index 000000000000..a12040efe143 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_pb.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/answer_record.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/dialogflow/v2/generator_pb' +require 'google/cloud/dialogflow/v2/participant_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/dialogflow/v2/answer_record.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf1\x02\n\x0c\x41nswerRecord\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x0f\x61nswer_feedback\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.v2.AnswerFeedbackB\x03\xe0\x41\x02\x12W\n\x16\x61gent_assistant_record\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.AgentAssistantRecordB\x03\xe0\x41\x03H\x00:\xa5\x01\xea\x41\xa1\x01\n&dialogflow.googleapis.com/AnswerRecord\x12\x30projects/{project}/answerRecords/{answer_record}\x12\x45projects/{project}/locations/{location}/answerRecords/{answer_record}B\x08\n\x06record\"\xa0\x01\n\x18ListAnswerRecordsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/AnswerRecord\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"v\n\x19ListAnswerRecordsResponse\x12@\n\x0e\x61nswer_records\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.AnswerRecord\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x97\x01\n\x19UpdateAnswerRecordRequest\x12\x44\n\ranswer_record\x18\x01 \x01(\x0b\x32(.google.cloud.dialogflow.v2.AnswerRecordB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xd2\x03\n\x0e\x41nswerFeedback\x12V\n\x11\x63orrectness_level\x18\x01 \x01(\x0e\x32;.google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel\x12]\n\x1f\x61gent_assistant_detail_feedback\x18\x02 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.AgentAssistantFeedbackH\x00\x12\x0f\n\x07\x63licked\x18\x03 \x01(\x08\x12.\n\nclick_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x11\n\tdisplayed\x18\x04 \x01(\x08\x12\x30\n\x0c\x64isplay_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"p\n\x10\x43orrectnessLevel\x12!\n\x1d\x43ORRECTNESS_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNOT_CORRECT\x10\x01\x12\x15\n\x11PARTIALLY_CORRECT\x10\x02\x12\x11\n\rFULLY_CORRECT\x10\x03\x42\x11\n\x0f\x64\x65tail_feedback\"\xfb\n\n\x16\x41gentAssistantFeedback\x12\x61\n\x10\x61nswer_relevance\x18\x01 \x01(\x0e\x32\x42.google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevanceB\x03\xe0\x41\x01\x12i\n\x14\x64ocument_correctness\x18\x02 \x01(\x0e\x32\x46.google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectnessB\x03\xe0\x41\x01\x12g\n\x13\x64ocument_efficiency\x18\x03 \x01(\x0e\x32\x45.google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiencyB\x03\xe0\x41\x01\x12m\n\x16summarization_feedback\x18\x04 \x01(\x0b\x32H.google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedbackB\x03\xe0\x41\x01\x12r\n\x19knowledge_search_feedback\x18\x05 \x01(\x0b\x32J.google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedbackB\x03\xe0\x41\x01\x12r\n\x19knowledge_assist_feedback\x18\x06 \x01(\x0b\x32J.google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedbackB\x03\xe0\x41\x01\x1a\xbb\x02\n\x15SummarizationFeedback\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0csummary_text\x18\x03 \x01(\t\x12v\n\rtext_sections\x18\x04 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback.TextSectionsEntryB\x03\xe0\x41\x01\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x46\n\x17KnowledgeSearchFeedback\x12\x15\n\ranswer_copied\x18\x01 \x01(\x08\x12\x14\n\x0c\x63licked_uris\x18\x02 \x03(\t\x1a\x46\n\x17KnowledgeAssistFeedback\x12\x15\n\ranswer_copied\x18\x01 \x01(\x08\x12\x14\n\x0c\x63licked_uris\x18\x02 \x03(\t\"Q\n\x0f\x41nswerRelevance\x12 \n\x1c\x41NSWER_RELEVANCE_UNSPECIFIED\x10\x00\x12\x0e\n\nIRRELEVANT\x10\x01\x12\x0c\n\x08RELEVANT\x10\x02\"W\n\x13\x44ocumentCorrectness\x12$\n DOCUMENT_CORRECTNESS_UNSPECIFIED\x10\x00\x12\r\n\tINCORRECT\x10\x01\x12\x0b\n\x07\x43ORRECT\x10\x02\"Y\n\x12\x44ocumentEfficiency\x12#\n\x1f\x44OCUMENT_EFFICIENCY_UNSPECIFIED\x10\x00\x12\x0f\n\x0bINEFFICIENT\x10\x01\x12\r\n\tEFFICIENT\x10\x02\"\xea\x02\n\x14\x41gentAssistantRecord\x12S\n\x19\x61rticle_suggestion_answer\x18\x05 \x01(\x0b\x32).google.cloud.dialogflow.v2.ArticleAnswerB\x03\xe0\x41\x03H\x00\x12@\n\nfaq_answer\x18\x06 \x01(\x0b\x32%.google.cloud.dialogflow.v2.FaqAnswerB\x03\xe0\x41\x03H\x00\x12[\n\x18\x64ialogflow_assist_answer\x18\x07 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.DialogflowAssistAnswerB\x03\xe0\x41\x03H\x00\x12T\n\x14generator_suggestion\x18\x08 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xe0\x41\x03H\x00\x42\x08\n\x06\x61nswer2\xad\x05\n\rAnswerRecords\x12\xed\x01\n\x11ListAnswerRecords\x12\x34.google.cloud.dialogflow.v2.ListAnswerRecordsRequest\x1a\x35.google.cloud.dialogflow.v2.ListAnswerRecordsResponse\"k\xda\x41\x06parent\x82\xd3\xe4\x93\x02\\\x12%/v2/{parent=projects/*}/answerRecordsZ3\x12\x31/v2/{parent=projects/*/locations/*}/answerRecords\x12\xb1\x02\n\x12UpdateAnswerRecord\x12\x35.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest\x1a(.google.cloud.dialogflow.v2.AnswerRecord\"\xb9\x01\xda\x41\x19\x61nswer_record,update_mask\x82\xd3\xe4\x93\x02\x96\x01\x32\x33/v2/{answer_record.name=projects/*/answerRecords/*}:\ranswer_recordZP2?/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}:\ranswer_record\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x98\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x12\x41nswerRecordsProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + AnswerRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnswerRecord").msgclass + ListAnswerRecordsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListAnswerRecordsRequest").msgclass + ListAnswerRecordsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListAnswerRecordsResponse").msgclass + UpdateAnswerRecordRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateAnswerRecordRequest").msgclass + AnswerFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnswerFeedback").msgclass + AnswerFeedback::CorrectnessLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel").enummodule + AgentAssistantFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback").msgclass + AgentAssistantFeedback::SummarizationFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback").msgclass + AgentAssistantFeedback::KnowledgeSearchFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback").msgclass + AgentAssistantFeedback::KnowledgeAssistFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback").msgclass + AgentAssistantFeedback::AnswerRelevance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance").enummodule + AgentAssistantFeedback::DocumentCorrectness = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness").enummodule + AgentAssistantFeedback::DocumentEfficiency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency").enummodule + AgentAssistantRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantRecord").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb new file mode 100644 index 000000000000..1aaf2c61052d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/answer_record.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/answer_record_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module AnswerRecords + # Service for managing + # [AnswerRecords][google.cloud.dialogflow.v2.AnswerRecord]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.AnswerRecords' + + # Returns the list of all answer records in the specified project in reverse + # chronological order. + rpc :ListAnswerRecords, ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest, ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse + # Updates the specified answer record. + rpc :UpdateAnswerRecord, ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest, ::Google::Cloud::Dialogflow::V2::AnswerRecord + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records.rb new file mode 100644 index 000000000000..26fd3ddefaa5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/answer_records/credentials" +require "google/cloud/dialogflow/v2/answer_records/paths" +require "google/cloud/dialogflow/v2/answer_records/client" +require "google/cloud/dialogflow/v2/answer_records/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/answer_records" + # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/answer_records/rest" + # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new + # + module AnswerRecords + end + end + end + end +end + +helper_path = ::File.join __dir__, "answer_records", "helpers.rb" +require "google/cloud/dialogflow/v2/answer_records/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb new file mode 100644 index 000000000000..b0d532d92742 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb @@ -0,0 +1,627 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/answer_record_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module AnswerRecords + ## + # Client for the AnswerRecords service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :answer_records_stub + + ## + # Configure the AnswerRecords Client class. + # + # See {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AnswerRecords clients + # ::Google::Cloud::Dialogflow::V2::AnswerRecords::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AnswerRecords 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::Dialogflow::V2::AnswerRecords::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 + @answer_records_stub.universe_domain + end + + ## + # Create a new AnswerRecords client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AnswerRecords 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/dialogflow/v2/answer_record_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 + + @answer_records_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::AnswerRecords::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 + ) + + @answer_records_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 = @answer_records_stub.endpoint + config.universe_domain = @answer_records_stub.universe_domain + config.logger = @answer_records_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 + @answer_records_stub.logger + end + + # Service calls + + ## + # Returns the list of all answer records in the specified project in reverse + # chronological order. + # + # @overload list_answer_records(request, options = nil) + # Pass arguments to `list_answer_records` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_answer_records(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_answer_records` via keyword arguments. Note that at + # least one keyword argument is 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 project to list all answer records for in reverse + # chronological order. Format: `projects//locations/`. + # @param filter [::String] + # Optional. Filters to restrict results to specific answer records. The + # expression has the following syntax: + # + # [AND ] ... + # + # The following fields and operators are supported: + # * conversation_id with equals(=) operator + # + # Examples: + # + # * `conversation_id=bar` matches answer records in the + # `projects/foo/locations/global/conversations/bar` conversation + # (assuming the parent is `projects/foo/locations/global`). + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param page_size [::Integer] + # Optional. The maximum number of records to return in a single page. + # The server may return fewer records than this. If unspecified, we use 10. + # The maximum is 100. + # @param page_token [::String] + # Optional. The + # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse#next_page_token ListAnswerRecordsResponse.next_page_token} + # value returned from a previous list request used to continue listing on + # the next page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new + # + # # Call the list_answer_records method. + # result = client.list_answer_records 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::Dialogflow::V2::AnswerRecord. + # p item + # end + # + def list_answer_records request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest + + # Converts hash and nil to 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_answer_records.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_answer_records.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_answer_records.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @answer_records_stub.call_rpc :list_answer_records, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @answer_records_stub, :list_answer_records, 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 specified answer record. + # + # @overload update_answer_record(request, options = nil) + # Pass arguments to `update_answer_record` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_answer_record(answer_record: nil, update_mask: nil) + # Pass arguments to `update_answer_record` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param answer_record [::Google::Cloud::Dialogflow::V2::AnswerRecord, ::Hash] + # Required. Answer record to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::AnswerRecord] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new + # + # # Call the update_answer_record method. + # result = client.update_answer_record request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::AnswerRecord. + # p result + # + def update_answer_record request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest + + # Converts hash and nil to 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_answer_record.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.answer_record&.name + header_params["answer_record.name"] = request.answer_record.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_answer_record.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_answer_record.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @answer_records_stub.call_rpc :update_answer_record, 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 AnswerRecords API. + # + # This class represents the configuration for AnswerRecords, + # 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::Dialogflow::V2::AnswerRecords::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_answer_records to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_answer_records.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_answer_records.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::Dialogflow::V2::AnswerRecords::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 AnswerRecords 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_answer_records` + # @return [::Gapic::Config::Method] + # + attr_reader :list_answer_records + ## + # RPC-specific configuration for `update_answer_record` + # @return [::Gapic::Config::Method] + # + attr_reader :update_answer_record + + # @private + def initialize parent_rpcs = nil + list_answer_records_config = parent_rpcs.list_answer_records if parent_rpcs.respond_to? :list_answer_records + @list_answer_records = ::Gapic::Config::Method.new list_answer_records_config + update_answer_record_config = parent_rpcs.update_answer_record if parent_rpcs.respond_to? :update_answer_record + @update_answer_record = ::Gapic::Config::Method.new update_answer_record_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb new file mode 100644 index 000000000000..139ae2fe607b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module AnswerRecords + # Credentials for the AnswerRecords API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/paths.rb new file mode 100644 index 000000000000..2de5551d2c3e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/paths.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! + + +module Google + module Cloud + module Dialogflow + module V2 + module AnswerRecords + # Path helper methods for the AnswerRecords API. + module Paths + ## + # Create a fully-qualified AnswerRecord resource string. + # + # @overload answer_record_path(project:, answer_record:) + # The resource will be in the following format: + # + # `projects/{project}/answerRecords/{answer_record}` + # + # @param project [String] + # @param answer_record [String] + # + # @overload answer_record_path(project:, location:, answer_record:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/answerRecords/{answer_record}` + # + # @param project [String] + # @param location [String] + # @param answer_record [String] + # + # @return [::String] + def answer_record_path **args + resources = { + "answer_record:project" => (proc do |project:, answer_record:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/answerRecords/#{answer_record}" + end), + "answer_record:location:project" => (proc do |project:, location:, answer_record:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/answerRecords/#{answer_record}" + 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 App resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # + # @return [::String] + def app_path project:, location:, app: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}" + end + + ## + # Create a fully-qualified Context resource string. + # + # @overload context_path(project:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @return [::String] + def context_path **args + resources = { + "context:project:session" => (proc do |project:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + end), + "context:location:project:session" => (proc do |project:, location:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + 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 Intent resource string. + # + # @overload intent_path(project:, intent:) + # The resource will be in the following format: + # + # `projects/{project}/agent/intents/{intent}` + # + # @param project [String] + # @param intent [String] + # + # @overload intent_path(project:, location:, intent:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/intents/{intent}` + # + # @param project [String] + # @param location [String] + # @param intent [String] + # + # @return [::String] + def intent_path **args + resources = { + "intent:project" => (proc do |project:, intent:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/agent/intents/#{intent}" + end), + "intent:location:project" => (proc do |project:, location:, intent:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/intents/#{intent}" + 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 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 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 + + ## + # Create a fully-qualified Tool resource string. + # + # @overload tool_path(project:, location:, tool:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param tool [String] + # + # @overload tool_path(project:, location:, app:, tool:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # @param tool [String] + # + # @return [::String] + def tool_path **args + resources = { + "location:project:tool" => (proc do |project:, location:, tool:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tools/#{tool}" + end), + "app:location:project:tool" => (proc do |project:, location:, app:, tool:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}" + 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 Toolset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # @param toolset [String] + # + # @return [::String] + def toolset_path project:, location:, app:, toolset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest.rb new file mode 100644 index 000000000000..27a1f9a77417 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/answer_records/credentials" +require "google/cloud/dialogflow/v2/answer_records/paths" +require "google/cloud/dialogflow/v2/answer_records/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/answer_records/rest" + # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new + # + module AnswerRecords + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/answer_records/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb new file mode 100644 index 000000000000..d35526a8663f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb @@ -0,0 +1,578 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/answer_record_pb" +require "google/cloud/dialogflow/v2/answer_records/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module AnswerRecords + module Rest + ## + # REST client for the AnswerRecords service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :answer_records_stub + + ## + # Configure the AnswerRecords Client class. + # + # See {::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AnswerRecords clients + # ::Google::Cloud::Dialogflow::V2::AnswerRecords::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AnswerRecords 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::Dialogflow::V2::AnswerRecords::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 + @answer_records_stub.universe_domain + end + + ## + # Create a new AnswerRecords REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AnswerRecords 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 + + @answer_records_stub = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @answer_records_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 = @answer_records_stub.endpoint + config.universe_domain = @answer_records_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @answer_records_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 + @answer_records_stub.logger + end + + # Service calls + + ## + # Returns the list of all answer records in the specified project in reverse + # chronological order. + # + # @overload list_answer_records(request, options = nil) + # Pass arguments to `list_answer_records` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_answer_records(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_answer_records` via keyword arguments. Note that at + # least one keyword argument is 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 project to list all answer records for in reverse + # chronological order. Format: `projects//locations/`. + # @param filter [::String] + # Optional. Filters to restrict results to specific answer records. The + # expression has the following syntax: + # + # [AND ] ... + # + # The following fields and operators are supported: + # * conversation_id with equals(=) operator + # + # Examples: + # + # * `conversation_id=bar` matches answer records in the + # `projects/foo/locations/global/conversations/bar` conversation + # (assuming the parent is `projects/foo/locations/global`). + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param page_size [::Integer] + # Optional. The maximum number of records to return in a single page. + # The server may return fewer records than this. If unspecified, we use 10. + # The maximum is 100. + # @param page_token [::String] + # Optional. The + # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse#next_page_token ListAnswerRecordsResponse.next_page_token} + # value returned from a previous list request used to continue listing on + # the next page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new + # + # # Call the list_answer_records method. + # result = client.list_answer_records 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::Dialogflow::V2::AnswerRecord. + # p item + # end + # + def list_answer_records request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest + + # Converts hash and nil to an 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_answer_records.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_answer_records.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_answer_records.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @answer_records_stub.list_answer_records request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @answer_records_stub, :list_answer_records, "answer_records", 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 specified answer record. + # + # @overload update_answer_record(request, options = nil) + # Pass arguments to `update_answer_record` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_answer_record(answer_record: nil, update_mask: nil) + # Pass arguments to `update_answer_record` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param answer_record [::Google::Cloud::Dialogflow::V2::AnswerRecord, ::Hash] + # Required. Answer record to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::AnswerRecord] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new + # + # # Call the update_answer_record method. + # result = client.update_answer_record request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::AnswerRecord. + # p result + # + def update_answer_record request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest + + # Converts hash and nil to an 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_answer_record.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_answer_record.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_answer_record.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @answer_records_stub.update_answer_record 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 AnswerRecords REST API. + # + # This class represents the configuration for AnswerRecords 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::Dialogflow::V2::AnswerRecords::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_answer_records to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_answer_records.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_answer_records.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 AnswerRecords 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_answer_records` + # @return [::Gapic::Config::Method] + # + attr_reader :list_answer_records + ## + # RPC-specific configuration for `update_answer_record` + # @return [::Gapic::Config::Method] + # + attr_reader :update_answer_record + + # @private + def initialize parent_rpcs = nil + list_answer_records_config = parent_rpcs.list_answer_records if parent_rpcs.respond_to? :list_answer_records + @list_answer_records = ::Gapic::Config::Method.new list_answer_records_config + update_answer_record_config = parent_rpcs.update_answer_record if parent_rpcs.respond_to? :update_answer_record + @update_answer_record = ::Gapic::Config::Method.new update_answer_record_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb new file mode 100644 index 000000000000..08f8037ff523 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb @@ -0,0 +1,219 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/answer_record_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module AnswerRecords + module Rest + ## + # REST service stub for the AnswerRecords 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_answer_records REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListAnswerRecordsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse] + # A result object deserialized from the server's reply + def list_answer_records request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_answer_records_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_answer_records", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse.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_answer_record REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::AnswerRecord] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord] + # A result object deserialized from the server's reply + def update_answer_record request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_answer_record_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_answer_record", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::AnswerRecord.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_answer_records REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest] + # 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_answer_records_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/answerRecords", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/answerRecords", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_answer_record REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest] + # 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_answer_record_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{answer_record.name}", + body: "answer_record", + matches: [ + ["answer_record.name", %r{^projects/[^/]+/answerRecords/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{answer_record.name}", + body: "answer_record", + matches: [ + ["answer_record.name", %r{^projects/[^/]+/locations/[^/]+/answerRecords/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb new file mode 100644 index 000000000000..dfbd9ef236e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/audio_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' + + +descriptor_data = "\n-google/cloud/dialogflow/v2/audio_config.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\"9\n\rSpeechContext\x12\x14\n\x07phrases\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x62oost\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\"\x92\x01\n\x0eSpeechWordInfo\x12\x0c\n\x04word\x18\x03 \x01(\t\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xb6\x04\n\x10InputAudioConfig\x12\x46\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32).google.cloud.dialogflow.v2.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x10\x65nable_word_info\x18\r \x01(\x08\x12\x18\n\x0cphrase_hints\x18\x04 \x03(\tB\x02\x18\x01\x12\x42\n\x0fspeech_contexts\x18\x0b \x03(\x0b\x32).google.cloud.dialogflow.v2.SpeechContext\x12\r\n\x05model\x18\x07 \x01(\t\x12\x45\n\rmodel_variant\x18\n \x01(\x0e\x32..google.cloud.dialogflow.v2.SpeechModelVariant\x12\x18\n\x10single_utterance\x18\x08 \x01(\x08\x12*\n\"disable_no_speech_recognized_event\x18\x0e \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x11 \x01(\x08\x12\x39\n\x0bphrase_sets\x18\x14 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12)\n!opt_out_conformer_model_migration\x18\x1a \x01(\x08\"p\n\x14VoiceSelectionParams\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x0bssml_gender\x18\x02 \x01(\x0e\x32+.google.cloud.dialogflow.v2.SsmlVoiceGenderB\x03\xe0\x41\x01\"\xa0\x02\n\x16SynthesizeSpeechConfig\x12\x1a\n\rspeaking_rate\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01\x12\x12\n\x05pitch\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1b\n\x0evolume_gain_db\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x44\n\x05voice\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.VoiceSelectionParamsB\x03\xe0\x41\x01\x12R\n\x0epronunciations\x18\x06 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.CustomPronunciationParamsB\x03\xe0\x41\x01\"\x96\x02\n\x19\x43ustomPronunciationParams\x12\x0e\n\x06phrase\x18\x01 \x01(\t\x12\x61\n\x11phonetic_encoding\x18\x02 \x01(\x0e\x32\x46.google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding\x12\x15\n\rpronunciation\x18\x03 \x01(\t\"o\n\x10PhoneticEncoding\x12!\n\x1dPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\n\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1d\n\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\"\xd2\x01\n\x11OutputAudioConfig\x12L\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32/.google.cloud.dialogflow.v2.OutputAudioEncodingB\x03\xe0\x41\x02\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12T\n\x18synthesize_speech_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig\"U\n\x13TelephonyDtmfEvents\x12>\n\x0b\x64tmf_events\x18\x01 \x03(\x0e\x32).google.cloud.dialogflow.v2.TelephonyDtmf\"\xe2\x02\n\x12SpeechToTextConfig\x12L\n\x14speech_model_variant\x18\x01 \x01(\x0e\x32..google.cloud.dialogflow.v2.SpeechModelVariant\x12\r\n\x05model\x18\x02 \x01(\t\x12\x39\n\x0bphrase_sets\x18\x04 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x41\n\x0e\x61udio_encoding\x18\x06 \x01(\x0e\x32).google.cloud.dialogflow.v2.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x07 \x01(\x05\x12\x15\n\rlanguage_code\x18\x08 \x01(\t\x12\x18\n\x10\x65nable_word_info\x18\t \x01(\x08\x12%\n\x1duse_timeout_based_endpointing\x18\x0b \x01(\x08*\x94\x02\n\rTelephonyDtmf\x12\x1e\n\x1aTELEPHONY_DTMF_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44TMF_ONE\x10\x01\x12\x0c\n\x08\x44TMF_TWO\x10\x02\x12\x0e\n\nDTMF_THREE\x10\x03\x12\r\n\tDTMF_FOUR\x10\x04\x12\r\n\tDTMF_FIVE\x10\x05\x12\x0c\n\x08\x44TMF_SIX\x10\x06\x12\x0e\n\nDTMF_SEVEN\x10\x07\x12\x0e\n\nDTMF_EIGHT\x10\x08\x12\r\n\tDTMF_NINE\x10\t\x12\r\n\tDTMF_ZERO\x10\n\x12\n\n\x06\x44TMF_A\x10\x0b\x12\n\n\x06\x44TMF_B\x10\x0c\x12\n\n\x06\x44TMF_C\x10\r\x12\n\n\x06\x44TMF_D\x10\x0e\x12\r\n\tDTMF_STAR\x10\x0f\x12\x0e\n\nDTMF_POUND\x10\x10*\x94\x02\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41UDIO_ENCODING_LINEAR_16\x10\x01\x12\x17\n\x13\x41UDIO_ENCODING_FLAC\x10\x02\x12\x18\n\x14\x41UDIO_ENCODING_MULAW\x10\x03\x12\x16\n\x12\x41UDIO_ENCODING_AMR\x10\x04\x12\x19\n\x15\x41UDIO_ENCODING_AMR_WB\x10\x05\x12\x1b\n\x17\x41UDIO_ENCODING_OGG_OPUS\x10\x06\x12)\n%AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x17\n\x13\x41UDIO_ENCODING_ALAW\x10\x08*v\n\x12SpeechModelVariant\x12$\n SPEECH_MODEL_VARIANT_UNSPECIFIED\x10\x00\x12\x16\n\x12USE_BEST_AVAILABLE\x10\x01\x12\x10\n\x0cUSE_STANDARD\x10\x02\x12\x10\n\x0cUSE_ENHANCED\x10\x03*\x8d\x01\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x1a\n\x16SSML_VOICE_GENDER_MALE\x10\x01\x12\x1c\n\x18SSML_VOICE_GENDER_FEMALE\x10\x02\x12\x1d\n\x19SSML_VOICE_GENDER_NEUTRAL\x10\x03*\x90\x02\n\x13OutputAudioEncoding\x12%\n!OUTPUT_AUDIO_ENCODING_UNSPECIFIED\x10\x00\x12#\n\x1fOUTPUT_AUDIO_ENCODING_LINEAR_16\x10\x01\x12!\n\x19OUTPUT_AUDIO_ENCODING_MP3\x10\x02\x1a\x02\x08\x01\x12%\n!OUTPUT_AUDIO_ENCODING_MP3_64_KBPS\x10\x04\x12\"\n\x1eOUTPUT_AUDIO_ENCODING_OGG_OPUS\x10\x03\x12\x1f\n\x1bOUTPUT_AUDIO_ENCODING_MULAW\x10\x05\x12\x1e\n\x1aOUTPUT_AUDIO_ENCODING_ALAW\x10\x06\x42\xd3\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x10\x41udioConfigProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}\xea\x41\x62\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + SpeechContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechContext").msgclass + SpeechWordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechWordInfo").msgclass + InputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputAudioConfig").msgclass + VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.VoiceSelectionParams").msgclass + SynthesizeSpeechConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SynthesizeSpeechConfig").msgclass + CustomPronunciationParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CustomPronunciationParams").msgclass + CustomPronunciationParams::PhoneticEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding").enummodule + OutputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioConfig").msgclass + TelephonyDtmfEvents = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TelephonyDtmfEvents").msgclass + SpeechToTextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechToTextConfig").msgclass + TelephonyDtmf = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TelephonyDtmf").enummodule + AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AudioEncoding").enummodule + SpeechModelVariant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechModelVariant").enummodule + SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SsmlVoiceGender").enummodule + OutputAudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioEncoding").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/bindings_override.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/bindings_override.rb new file mode 100644 index 000000000000..037042b4f250 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/bindings_override.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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" + +module Google + module Cloud + module Dialogflow + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/dialogflow/v2/rest" + # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + module V2 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Dialogflow"] + 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v2/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb new file mode 100644 index 000000000000..263ce7a87969 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/ces_app.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dialogflow/v2/tool_pb' + + +descriptor_data = "\n(google/cloud/dialogflow/v2/ces_app.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dialogflow/v2/tool.proto\"\x92\x02\n\nCesAppSpec\x12/\n\x07\x63\x65s_app\x18\x01 \x01(\tB\x1e\xe0\x41\x01\xfa\x41\x18\n\x16\x63\x65s.googleapis.com/App\x12_\n\x18\x63onfirmation_requirement\x18\x02 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xe0\x41\x01\x12#\n\x11proactive_enabled\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\"\n\x10reactive_enabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x14\n\x12_proactive_enabledB\x13\n\x11_reactive_enabledB\xe0\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0b\x43\x65sAppProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41L\n\x16\x63\x65s.googleapis.com/App\x12\x32projects/{project}/locations/{location}/apps/{app}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + CesAppSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CesAppSpec").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_tool_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_tool_pb.rb new file mode 100644 index 000000000000..4d90a84fcc1e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_tool_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/ces_tool.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dialogflow/v2/tool_pb' + + +descriptor_data = "\n)google/cloud/dialogflow/v2/ces_tool.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dialogflow/v2/tool.proto\"\xa1\x01\n\x0b\x43\x65sToolSpec\x12\x31\n\x08\x63\x65s_tool\x18\x01 \x01(\tB\x1f\xe0\x41\x01\xfa\x41\x19\n\x17\x63\x65s.googleapis.com/Tool\x12_\n\x18\x63onfirmation_requirement\x18\x02 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xe0\x41\x01\x42\x92\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0c\x43\x65sToolProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + CesToolSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CesToolSpec").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_pb.rb new file mode 100644 index 000000000000..231ea99427ce --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/context.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/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n(google/cloud/dialogflow/v2/context.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x8f\x04\n\x07\x43ontext\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0elifespan_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x30\n\nparameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01:\xa1\x03\xea\x41\x9d\x03\n!dialogflow.googleapis.com/Context\x12>projects/{project}/agent/sessions/{session}/contexts/{context}\x12\x66projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}\x12Sprojects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}\x12{projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}\"\x81\x01\n\x13ListContextsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Context\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\"f\n\x14ListContextsResponse\x12\x35\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11GetContextRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Context\"\x8c\x01\n\x14\x43reateContextRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Context\x12\x39\n\x07\x63ontext\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.v2.ContextB\x03\xe0\x41\x02\"\x87\x01\n\x14UpdateContextRequest\x12\x39\n\x07\x63ontext\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.v2.ContextB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"O\n\x14\x44\x65leteContextRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Context\"U\n\x18\x44\x65leteAllContextsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Context2\xe8\x14\n\x08\x43ontexts\x12\x9c\x03\n\x0cListContexts\x12/.google.cloud.dialogflow.v2.ListContextsRequest\x1a\x30.google.cloud.dialogflow.v2.ListContextsResponse\"\xa8\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x98\x02\x12\x31/v2/{parent=projects/*/agent/sessions/*}/contextsZJ\x12H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?\x12=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZV\x12T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts\x12\x89\x03\n\nGetContext\x12-.google.cloud.dialogflow.v2.GetContextRequest\x1a#.google.cloud.dialogflow.v2.Context\"\xa6\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x98\x02\x12\x31/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJ\x12H/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?\x12=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZV\x12T/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}\x12\xbd\x03\n\rCreateContext\x12\x30.google.cloud.dialogflow.v2.CreateContextRequest\x1a#.google.cloud.dialogflow.v2.Context\"\xd4\x02\xda\x41\x0eparent,context\x82\xd3\xe4\x93\x02\xbc\x02\"1/v2/{parent=projects/*/agent/sessions/*}/contexts:\x07\x63ontextZS\"H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts:\x07\x63ontextZH\"=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts:\x07\x63ontextZ_\"T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts:\x07\x63ontext\x12\xe2\x03\n\rUpdateContext\x12\x30.google.cloud.dialogflow.v2.UpdateContextRequest\x1a#.google.cloud.dialogflow.v2.Context\"\xf9\x02\xda\x41\x13\x63ontext,update_mask\x82\xd3\xe4\x93\x02\xdc\x02\x32\x39/v2/{context.name=projects/*/agent/sessions/*/contexts/*}:\x07\x63ontextZ[2P/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}:\x07\x63ontextZP2E/v2/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}:\x07\x63ontextZg2\\/v2/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}:\x07\x63ontext\x12\x82\x03\n\rDeleteContext\x12\x30.google.cloud.dialogflow.v2.DeleteContextRequest\x1a\x16.google.protobuf.Empty\"\xa6\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x98\x02*1/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJ*H/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?*=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZV*T/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}\x12\x8c\x03\n\x11\x44\x65leteAllContexts\x12\x34.google.cloud.dialogflow.v2.DeleteAllContextsRequest\x1a\x16.google.protobuf.Empty\"\xa8\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x98\x02*1/v2/{parent=projects/*/agent/sessions/*}/contextsZJ*H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?*=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZV*T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x92\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0c\x43ontextProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + Context = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Context").msgclass + ListContextsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListContextsRequest").msgclass + ListContextsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListContextsResponse").msgclass + GetContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetContextRequest").msgclass + CreateContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateContextRequest").msgclass + UpdateContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateContextRequest").msgclass + DeleteContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteContextRequest").msgclass + DeleteAllContextsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteAllContextsRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_services_pb.rb new file mode 100644 index 000000000000..cb6eb6f793a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_services_pb.rb @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/context.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/context_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Contexts + # Service for managing [Contexts][google.cloud.dialogflow.v2.Context]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Contexts' + + # Returns the list of all contexts in the specified session. + rpc :ListContexts, ::Google::Cloud::Dialogflow::V2::ListContextsRequest, ::Google::Cloud::Dialogflow::V2::ListContextsResponse + # Retrieves the specified context. + rpc :GetContext, ::Google::Cloud::Dialogflow::V2::GetContextRequest, ::Google::Cloud::Dialogflow::V2::Context + # Creates a context. + # + # If the specified context already exists, overrides the context. + rpc :CreateContext, ::Google::Cloud::Dialogflow::V2::CreateContextRequest, ::Google::Cloud::Dialogflow::V2::Context + # Updates the specified context. + rpc :UpdateContext, ::Google::Cloud::Dialogflow::V2::UpdateContextRequest, ::Google::Cloud::Dialogflow::V2::Context + # Deletes the specified context. + rpc :DeleteContext, ::Google::Cloud::Dialogflow::V2::DeleteContextRequest, ::Google::Protobuf::Empty + # Deletes all active contexts in the specified session. + rpc :DeleteAllContexts, ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts.rb new file mode 100644 index 000000000000..848d100df06d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/contexts/credentials" +require "google/cloud/dialogflow/v2/contexts/paths" +require "google/cloud/dialogflow/v2/contexts/client" +require "google/cloud/dialogflow/v2/contexts/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/contexts" + # client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/contexts/rest" + # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + module Contexts + end + end + end + end +end + +helper_path = ::File.join __dir__, "contexts", "helpers.rb" +require "google/cloud/dialogflow/v2/contexts/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb new file mode 100644 index 000000000000..f797ab9d7f73 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb @@ -0,0 +1,999 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/context_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Contexts + ## + # Client for the Contexts service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :contexts_stub + + ## + # Configure the Contexts Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Contexts::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Contexts clients + # ::Google::Cloud::Dialogflow::V2::Contexts::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Contexts 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::Dialogflow::V2::Contexts::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 + @contexts_stub.universe_domain + end + + ## + # Create a new Contexts client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Contexts 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/dialogflow/v2/context_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 + + @contexts_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Contexts::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 + ) + + @contexts_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 = @contexts_stub.endpoint + config.universe_domain = @contexts_stub.universe_domain + config.logger = @contexts_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 + @contexts_stub.logger + end + + # Service calls + + ## + # Returns the list of all contexts in the specified session. + # + # @overload list_contexts(request, options = nil) + # Pass arguments to `list_contexts` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListContextsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_contexts(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_contexts` via keyword arguments. Note that at + # least one keyword argument is 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 session to list all contexts from. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new + # + # # Call the list_contexts method. + # result = client.list_contexts 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::Dialogflow::V2::Context. + # p item + # end + # + def list_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListContextsRequest + + # Converts hash and nil to 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_contexts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_contexts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.call_rpc :list_contexts, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @contexts_stub, :list_contexts, 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 + + ## + # Retrieves the specified context. + # + # @overload get_context(request, options = nil) + # Pass arguments to `get_context` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetContextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_context(name: nil) + # Pass arguments to `get_context` via keyword arguments. Note that at + # least one keyword argument is required. To 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 context. Format: + # `projects//agent/sessions//contexts/` + # or `projects//agent/environments//users//sessions//contexts/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Context] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Context] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetContextRequest.new + # + # # Call the get_context method. + # result = client.get_context request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + # p result + # + def get_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetContextRequest + + # Converts hash and nil to 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_context.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_context.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.call_rpc :get_context, 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 context. + # + # If the specified context already exists, overrides the context. + # + # @overload create_context(request, options = nil) + # Pass arguments to `create_context` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateContextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_context(parent: nil, context: nil) + # Pass arguments to `create_context` via keyword arguments. Note that at + # least one keyword argument is 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 session to create a context for. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @param context [::Google::Cloud::Dialogflow::V2::Context, ::Hash] + # Required. The context to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Context] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Context] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new + # + # # Call the create_context method. + # result = client.create_context request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + # p result + # + def create_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateContextRequest + + # Converts hash and nil to 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_context.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_context.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.call_rpc :create_context, 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 the specified context. + # + # @overload update_context(request, options = nil) + # Pass arguments to `update_context` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateContextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_context(context: nil, update_mask: nil) + # Pass arguments to `update_context` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param context [::Google::Cloud::Dialogflow::V2::Context, ::Hash] + # Required. The context to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Context] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Context] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new + # + # # Call the update_context method. + # result = client.update_context request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + # p result + # + def update_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateContextRequest + + # Converts hash and nil to 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_context.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.context&.name + header_params["context.name"] = request.context.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_context.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.call_rpc :update_context, 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 specified context. + # + # @overload delete_context(request, options = nil) + # Pass arguments to `delete_context` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteContextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_context(name: nil) + # Pass arguments to `delete_context` via keyword arguments. Note that at + # least one keyword argument is required. To 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 context to delete. Format: + # `projects//agent/sessions//contexts/` + # or `projects//agent/environments//users//sessions//contexts/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new + # + # # Call the delete_context method. + # result = client.delete_context request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteContextRequest + + # Converts hash and nil to 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_context.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_context.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.call_rpc :delete_context, 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 all active contexts in the specified session. + # + # @overload delete_all_contexts(request, options = nil) + # Pass arguments to `delete_all_contexts` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_all_contexts(parent: nil) + # Pass arguments to `delete_all_contexts` via keyword arguments. Note that at + # least one keyword argument is 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 name of the session to delete all contexts from. Format: + # `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + # If `Environment ID` is not specified we assume default 'draft' environment. + # If `User ID` is not specified, we assume default '-' user. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new + # + # # Call the delete_all_contexts method. + # result = client.delete_all_contexts request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_all_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest + + # Converts hash and nil to 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_all_contexts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.delete_all_contexts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_all_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.call_rpc :delete_all_contexts, 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 Contexts API. + # + # This class represents the configuration for Contexts, + # 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::Dialogflow::V2::Contexts::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_contexts to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Contexts::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_contexts.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_contexts.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::Dialogflow::V2::Contexts::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Contexts 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_contexts + ## + # RPC-specific configuration for `get_context` + # @return [::Gapic::Config::Method] + # + attr_reader :get_context + ## + # RPC-specific configuration for `create_context` + # @return [::Gapic::Config::Method] + # + attr_reader :create_context + ## + # RPC-specific configuration for `update_context` + # @return [::Gapic::Config::Method] + # + attr_reader :update_context + ## + # RPC-specific configuration for `delete_context` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_context + ## + # RPC-specific configuration for `delete_all_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_all_contexts + + # @private + def initialize parent_rpcs = nil + list_contexts_config = parent_rpcs.list_contexts if parent_rpcs.respond_to? :list_contexts + @list_contexts = ::Gapic::Config::Method.new list_contexts_config + get_context_config = parent_rpcs.get_context if parent_rpcs.respond_to? :get_context + @get_context = ::Gapic::Config::Method.new get_context_config + create_context_config = parent_rpcs.create_context if parent_rpcs.respond_to? :create_context + @create_context = ::Gapic::Config::Method.new create_context_config + update_context_config = parent_rpcs.update_context if parent_rpcs.respond_to? :update_context + @update_context = ::Gapic::Config::Method.new update_context_config + delete_context_config = parent_rpcs.delete_context if parent_rpcs.respond_to? :delete_context + @delete_context = ::Gapic::Config::Method.new delete_context_config + delete_all_contexts_config = parent_rpcs.delete_all_contexts if parent_rpcs.respond_to? :delete_all_contexts + @delete_all_contexts = ::Gapic::Config::Method.new delete_all_contexts_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/credentials.rb new file mode 100644 index 000000000000..bc6df1b4f9d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Contexts + # Credentials for the Contexts API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/paths.rb new file mode 100644 index 000000000000..905180a566d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/paths.rb @@ -0,0 +1,195 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module Contexts + # Path helper methods for the Contexts API. + module Paths + ## + # Create a fully-qualified Context resource string. + # + # @overload context_path(project:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @return [::String] + def context_path **args + resources = { + "context:project:session" => (proc do |project:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + end), + "context:location:project:session" => (proc do |project:, location:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + 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:, session:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}` + # + # @param project [String] + # @param session [String] + # + # @overload session_path(project:, environment:, user:, session:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # + # @overload session_path(project:, location:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # + # @overload session_path(project:, location:, environment:, user:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # + # @return [::String] + def session_path **args + resources = { + "project:session" => (proc do |project:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}" + end), + "environment:project:session:user" => (proc do |project:, environment:, user:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}" + end), + "location:project:session" => (proc do |project:, location:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}" + end), + "environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/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-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest.rb new file mode 100644 index 000000000000..9ae1589a3b42 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/contexts/credentials" +require "google/cloud/dialogflow/v2/contexts/paths" +require "google/cloud/dialogflow/v2/contexts/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/contexts/rest" + # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + module Contexts + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/contexts/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb new file mode 100644 index 000000000000..017a756e70fe --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/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/dialogflow/v2/context_pb" +require "google/cloud/dialogflow/v2/contexts/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Contexts + module Rest + ## + # REST client for the Contexts service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :contexts_stub + + ## + # Configure the Contexts Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Contexts clients + # ::Google::Cloud::Dialogflow::V2::Contexts::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Contexts 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::Dialogflow::V2::Contexts::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 + @contexts_stub.universe_domain + end + + ## + # Create a new Contexts REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Contexts 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 + + @contexts_stub = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @contexts_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 = @contexts_stub.endpoint + config.universe_domain = @contexts_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @contexts_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 + @contexts_stub.logger + end + + # Service calls + + ## + # Returns the list of all contexts in the specified session. + # + # @overload list_contexts(request, options = nil) + # Pass arguments to `list_contexts` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListContextsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_contexts(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_contexts` via keyword arguments. Note that at + # least one keyword argument is 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 session to list all contexts from. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new + # + # # Call the list_contexts method. + # result = client.list_contexts 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::Dialogflow::V2::Context. + # p item + # end + # + def list_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListContextsRequest + + # Converts hash and nil to an 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_contexts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_contexts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.list_contexts request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @contexts_stub, :list_contexts, "contexts", 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 + + ## + # Retrieves the specified context. + # + # @overload get_context(request, options = nil) + # Pass arguments to `get_context` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetContextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_context(name: nil) + # Pass arguments to `get_context` via keyword arguments. Note that at + # least one keyword argument is required. To 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 context. Format: + # `projects//agent/sessions//contexts/` + # or `projects//agent/environments//users//sessions//contexts/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Context] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetContextRequest.new + # + # # Call the get_context method. + # result = client.get_context request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + # p result + # + def get_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetContextRequest + + # Converts hash and nil to an 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_context.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_context.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.get_context 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 context. + # + # If the specified context already exists, overrides the context. + # + # @overload create_context(request, options = nil) + # Pass arguments to `create_context` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateContextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_context(parent: nil, context: nil) + # Pass arguments to `create_context` via keyword arguments. Note that at + # least one keyword argument is 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 session to create a context for. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @param context [::Google::Cloud::Dialogflow::V2::Context, ::Hash] + # Required. The context to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Context] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new + # + # # Call the create_context method. + # result = client.create_context request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + # p result + # + def create_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateContextRequest + + # Converts hash and nil to an 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_context.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_context.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.create_context 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 the specified context. + # + # @overload update_context(request, options = nil) + # Pass arguments to `update_context` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateContextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_context(context: nil, update_mask: nil) + # Pass arguments to `update_context` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param context [::Google::Cloud::Dialogflow::V2::Context, ::Hash] + # Required. The context to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Context] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new + # + # # Call the update_context method. + # result = client.update_context request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + # p result + # + def update_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateContextRequest + + # Converts hash and nil to an 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_context.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_context.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.update_context 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 specified context. + # + # @overload delete_context(request, options = nil) + # Pass arguments to `delete_context` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteContextRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteContextRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_context(name: nil) + # Pass arguments to `delete_context` via keyword arguments. Note that at + # least one keyword argument is required. To 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 context to delete. Format: + # `projects//agent/sessions//contexts/` + # or `projects//agent/environments//users//sessions//contexts/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new + # + # # Call the delete_context method. + # result = client.delete_context request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_context request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteContextRequest + + # Converts hash and nil to an 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_context.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_context.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_context.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.delete_context 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 all active contexts in the specified session. + # + # @overload delete_all_contexts(request, options = nil) + # Pass arguments to `delete_all_contexts` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_all_contexts(parent: nil) + # Pass arguments to `delete_all_contexts` via keyword arguments. Note that at + # least one keyword argument is 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 name of the session to delete all contexts from. Format: + # `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + # If `Environment ID` is not specified we assume default 'draft' environment. + # If `User ID` is not specified, we assume default '-' user. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new + # + # # Call the delete_all_contexts method. + # result = client.delete_all_contexts request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_all_contexts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest + + # Converts hash and nil to an 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_all_contexts.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_all_contexts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_all_contexts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @contexts_stub.delete_all_contexts 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 Contexts REST API. + # + # This class represents the configuration for Contexts 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::Dialogflow::V2::Contexts::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_contexts to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_contexts.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_contexts.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Contexts 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_contexts + ## + # RPC-specific configuration for `get_context` + # @return [::Gapic::Config::Method] + # + attr_reader :get_context + ## + # RPC-specific configuration for `create_context` + # @return [::Gapic::Config::Method] + # + attr_reader :create_context + ## + # RPC-specific configuration for `update_context` + # @return [::Gapic::Config::Method] + # + attr_reader :update_context + ## + # RPC-specific configuration for `delete_context` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_context + ## + # RPC-specific configuration for `delete_all_contexts` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_all_contexts + + # @private + def initialize parent_rpcs = nil + list_contexts_config = parent_rpcs.list_contexts if parent_rpcs.respond_to? :list_contexts + @list_contexts = ::Gapic::Config::Method.new list_contexts_config + get_context_config = parent_rpcs.get_context if parent_rpcs.respond_to? :get_context + @get_context = ::Gapic::Config::Method.new get_context_config + create_context_config = parent_rpcs.create_context if parent_rpcs.respond_to? :create_context + @create_context = ::Gapic::Config::Method.new create_context_config + update_context_config = parent_rpcs.update_context if parent_rpcs.respond_to? :update_context + @update_context = ::Gapic::Config::Method.new update_context_config + delete_context_config = parent_rpcs.delete_context if parent_rpcs.respond_to? :delete_context + @delete_context = ::Gapic::Config::Method.new delete_context_config + delete_all_contexts_config = parent_rpcs.delete_all_contexts if parent_rpcs.respond_to? :delete_all_contexts + @delete_all_contexts = ::Gapic::Config::Method.new delete_all_contexts_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb new file mode 100644 index 000000000000..4dde350ccd99 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb @@ -0,0 +1,581 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/context_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Contexts + module Rest + ## + # REST service stub for the Contexts 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_contexts REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListContextsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListContextsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListContextsResponse] + # A result object deserialized from the server's reply + def list_contexts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_contexts_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_contexts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListContextsResponse.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_context REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetContextRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Context] + # A result object deserialized from the server's reply + def get_context request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_context_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_context", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Context.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_context REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateContextRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Context] + # A result object deserialized from the server's reply + def create_context request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_context_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_context", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Context.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_context REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateContextRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Context] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Context] + # A result object deserialized from the server's reply + def update_context request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_context_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_context", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Context.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_context REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteContextRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_context request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_context_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_context", + 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 delete_all_contexts REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_all_contexts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_all_contexts_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_all_contexts", + 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_contexts REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListContextsRequest] + # 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_contexts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/contexts", + matches: [ + ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/contexts", + matches: [ + ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/contexts", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/contexts", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_context REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetContextRequest] + # 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_context_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_context REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateContextRequest] + # 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_context_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/contexts", + body: "context", + matches: [ + ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/contexts", + body: "context", + matches: [ + ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/contexts", + body: "context", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/contexts", + body: "context", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_context REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateContextRequest] + # 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_context_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{context.name}", + body: "context", + matches: [ + ["context.name", %r{^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{context.name}", + body: "context", + matches: [ + ["context.name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{context.name}", + body: "context", + matches: [ + ["context.name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{context.name}", + body: "context", + matches: [ + ["context.name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_context REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteContextRequest] + # 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_context_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_all_contexts REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest] + # 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_all_contexts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{parent}/contexts", + matches: [ + ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{parent}/contexts", + matches: [ + ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{parent}/contexts", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{parent}/contexts", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_pb.rb new file mode 100644 index 000000000000..98a0a8d805a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_pb.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/conversation_dataset.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/dialogflow/v2/gcs_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n5google/cloud/dialogflow/v2/conversation_dataset.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/dialogflow/v2/gcs.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\".\n\x10\x43onversationInfo\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\"U\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.v2.GcsSourcesH\x00\x42\x08\n\x06source\"\xb7\x04\n\x13\x43onversationDataset\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x0cinput_config\x18\x05 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.InputConfigB\x03\xe0\x41\x03\x12L\n\x11\x63onversation_info\x18\x06 \x01(\x0b\x32,.google.cloud.dialogflow.v2.ConversationInfoB\x03\xe0\x41\x03\x12\x1f\n\x12\x63onversation_count\x18\x07 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzi\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1f\n\rsatisfies_pzs\x18\t \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01:\x88\x01\xea\x41\x84\x01\n-dialogflow.googleapis.com/ConversationDataset\x12Sprojects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}B\x10\n\x0e_satisfies_pziB\x10\n\x0e_satisfies_pzs\"\x8b\x01\n CreateConversationDatasetRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\x14\x63onversation_dataset\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationDatasetB\x03\xe0\x41\x02\"d\n\x1dGetConversationDatasetRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\"\x99\x01\n\x1fListConversationDatasetsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationDataset\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\"\x8b\x01\n ListConversationDatasetsResponse\x12N\n\x15\x63onversation_datasets\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.v2.ConversationDataset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n DeleteConversationDatasetRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\"\xa8\x01\n\x1dImportConversationDataRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\x12\x42\n\x0cinput_config\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.InputConfigB\x03\xe0\x41\x02\"\xda\x01\n\'ImportConversationDataOperationMetadata\x12P\n\x14\x63onversation_dataset\x18\x01 \x01(\tB2\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x91\x01\n\'ImportConversationDataOperationResponse\x12P\n\x14\x63onversation_dataset\x18\x01 \x01(\tB2\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\x12\x14\n\x0cimport_count\x18\x03 \x01(\x05\"~\n*CreateConversationDatasetOperationMetadata\x12P\n\x14\x63onversation_dataset\x18\x01 \x01(\tB2\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\",\n*DeleteConversationDatasetOperationMetadata2\xd6\x0c\n\x14\x43onversationDatasets\x12\xb3\x02\n\x19\x43reateConversationDataset\x12<.google.cloud.dialogflow.v2.CreateConversationDatasetRequest\x1a\x1d.google.longrunning.Operation\"\xb8\x01\xca\x41\x41\n\x13\x43onversationDataset\x12*CreateConversationDatasetOperationMetadata\xda\x41\x1bparent,conversation_dataset\x82\xd3\xe4\x93\x02P\"8/v2/{parent=projects/*/locations/*}/conversationDatasets:\x14\x63onversation_dataset\x12\xfd\x01\n\x16GetConversationDataset\x12\x39.google.cloud.dialogflow.v2.GetConversationDatasetRequest\x1a/.google.cloud.dialogflow.v2.ConversationDataset\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j\x12,/v2/{name=projects/*/conversationDatasets/*}Z:\x12\x38/v2/{name=projects/*/locations/*/conversationDatasets/*}\x12\x90\x02\n\x18ListConversationDatasets\x12;.google.cloud.dialogflow.v2.ListConversationDatasetsRequest\x1a<.google.cloud.dialogflow.v2.ListConversationDatasetsResponse\"y\xda\x41\x06parent\x82\xd3\xe4\x93\x02j\x12,/v2/{parent=projects/*}/conversationDatasetsZ:\x12\x38/v2/{parent=projects/*/locations/*}/conversationDatasets\x12\x88\x02\n\x19\x44\x65leteConversationDataset\x12<.google.cloud.dialogflow.v2.DeleteConversationDatasetRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41\x43\n\x15google.protobuf.Empty\x12*DeleteConversationDatasetOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v2/{name=projects/*/locations/*/conversationDatasets/*}\x12\xef\x02\n\x16ImportConversationData\x12\x39.google.cloud.dialogflow.v2.ImportConversationDataRequest\x1a\x1d.google.longrunning.Operation\"\xfa\x01\xca\x41R\n\'ImportConversationDataOperationResponse\x12\'ImportConversationDataOperationMetadata\x82\xd3\xe4\x93\x02\x9e\x01\"C/v2/{name=projects/*/conversationDatasets/*}:importConversationData:\x01*ZT\"O/v2/{name=projects/*/locations/*/conversationDatasets/*}:importConversationData:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9e\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x18\x43onversationDatasetProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + ConversationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationInfo").msgclass + InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputConfig").msgclass + ConversationDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationDataset").msgclass + CreateConversationDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationDatasetRequest").msgclass + GetConversationDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationDatasetRequest").msgclass + ListConversationDatasetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationDatasetsRequest").msgclass + ListConversationDatasetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationDatasetsResponse").msgclass + DeleteConversationDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationDatasetRequest").msgclass + ImportConversationDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportConversationDataRequest").msgclass + ImportConversationDataOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata").msgclass + ImportConversationDataOperationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportConversationDataOperationResponse").msgclass + CreateConversationDatasetOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata").msgclass + DeleteConversationDatasetOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_services_pb.rb new file mode 100644 index 000000000000..9f7bb2a35751 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_services_pb.rb @@ -0,0 +1,86 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/conversation_dataset.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/conversation_dataset_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationDatasets + # Conversation datasets. + # + # Conversation datasets contain raw conversation files and their + # customizable metadata that can be used for model training. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.ConversationDatasets' + + # Creates a new conversation dataset. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] + # - `response`: + # [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset] + rpc :CreateConversationDataset, ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, ::Google::Longrunning::Operation + # Retrieves the specified conversation dataset. + rpc :GetConversationDataset, ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, ::Google::Cloud::Dialogflow::V2::ConversationDataset + # Returns the list of all conversation datasets in the specified + # project and location. + rpc :ListConversationDatasets, ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse + # Deletes the specified conversation dataset. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + rpc :DeleteConversationDataset, ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, ::Google::Longrunning::Operation + # Import data into the specified conversation dataset. Note that it + # is not allowed to import data to a conversation dataset that + # already has data in it. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] + # - `response`: + # [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] + rpc :ImportConversationData, ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets.rb new file mode 100644 index 000000000000..103bd3699f39 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/conversation_datasets/credentials" +require "google/cloud/dialogflow/v2/conversation_datasets/paths" +require "google/cloud/dialogflow/v2/conversation_datasets/operations" +require "google/cloud/dialogflow/v2/conversation_datasets/client" +require "google/cloud/dialogflow/v2/conversation_datasets/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Conversation datasets. + # + # Conversation datasets contain raw conversation files and their + # customizable metadata that can be used for model training. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/conversation_datasets" + # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/conversation_datasets/rest" + # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + module ConversationDatasets + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversation_datasets", "helpers.rb" +require "google/cloud/dialogflow/v2/conversation_datasets/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb new file mode 100644 index 000000000000..1e1ad2cdbde7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb @@ -0,0 +1,962 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_dataset_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationDatasets + ## + # Client for the ConversationDatasets service. + # + # Conversation datasets. + # + # Conversation datasets contain raw conversation files and their + # customizable metadata that can be used for model training. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversation_datasets_stub + + ## + # Configure the ConversationDatasets Client class. + # + # See {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationDatasets clients + # ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::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 + @conversation_datasets_stub.universe_domain + end + + ## + # Create a new ConversationDatasets client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationDatasets 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/dialogflow/v2/conversation_dataset_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 + + @conversation_datasets_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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 + ) + + @conversation_datasets_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 = @conversation_datasets_stub.endpoint + config.universe_domain = @conversation_datasets_stub.universe_domain + config.logger = @conversation_datasets_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationDatasets::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 + @conversation_datasets_stub.logger + end + + # Service calls + + ## + # Creates a new conversation dataset. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::CreateConversationDatasetOperationMetadata CreateConversationDatasetOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ConversationDataset ConversationDataset} + # + # @overload create_conversation_dataset(request, options = nil) + # Pass arguments to `create_conversation_dataset` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(parent: nil, conversation_dataset: nil) + # Pass arguments to `create_conversation_dataset` via keyword arguments. Note that at + # least one keyword argument is 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 project to create conversation dataset for. Format: + # `projects//locations/` + # @param conversation_dataset [::Google::Cloud::Dialogflow::V2::ConversationDataset, ::Hash] + # Required. The conversation dataset 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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new + # + # # Call the create_conversation_dataset method. + # result = client.create_conversation_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_conversation_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest + + # Converts hash and nil to 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_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_conversation_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.call_rpc :create_conversation_dataset, 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 + + ## + # Retrieves the specified conversation dataset. + # + # @overload get_conversation_dataset(request, options = nil) + # Pass arguments to `get_conversation_dataset` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(name: nil) + # Pass arguments to `get_conversation_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To 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 conversation dataset to retrieve. Format: + # `projects//locations//conversationDatasets/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationDataset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationDataset] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new + # + # # Call the get_conversation_dataset method. + # result = client.get_conversation_dataset request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. + # p result + # + def get_conversation_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest + + # Converts hash and nil to 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_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_conversation_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.call_rpc :get_conversation_dataset, 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 + + ## + # Returns the list of all conversation datasets in the specified + # project and location. + # + # @overload list_conversation_datasets(request, options = nil) + # Pass arguments to `list_conversation_datasets` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_datasets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_conversation_datasets` via keyword arguments. Note that at + # least one keyword argument is 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 project and location name to list all conversation datasets + # for. Format: `projects//locations/` + # @param page_size [::Integer] + # Optional. Maximum number of conversation datasets to return in a single + # page. By default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new + # + # # Call the list_conversation_datasets method. + # result = client.list_conversation_datasets 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::Dialogflow::V2::ConversationDataset. + # p item + # end + # + def list_conversation_datasets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest + + # Converts hash and nil to 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_conversation_datasets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_conversation_datasets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_conversation_datasets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.call_rpc :list_conversation_datasets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @conversation_datasets_stub, :list_conversation_datasets, 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 the specified conversation dataset. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetOperationMetadata DeleteConversationDatasetOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload delete_conversation_dataset(request, options = nil) + # Pass arguments to `delete_conversation_dataset` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(name: nil) + # Pass arguments to `delete_conversation_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To 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 conversation dataset to delete. Format: + # `projects//locations//conversationDatasets/` + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new + # + # # Call the delete_conversation_dataset method. + # result = client.delete_conversation_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_conversation_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest + + # Converts hash and nil to 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_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_dataset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_conversation_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.call_rpc :delete_conversation_dataset, 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 + + ## + # Import data into the specified conversation dataset. Note that it + # is not allowed to import data to a conversation dataset that + # already has data in it. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::ImportConversationDataOperationMetadata ImportConversationDataOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ImportConversationDataOperationResponse ImportConversationDataOperationResponse} + # + # @overload import_conversation_data(request, options = nil) + # Pass arguments to `import_conversation_data` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_data(name: nil, input_config: nil) + # Pass arguments to `import_conversation_data` via keyword arguments. Note that at + # least one keyword argument is required. To 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. Dataset resource name. Format: + # `projects//locations//conversationDatasets/` + # @param input_config [::Google::Cloud::Dialogflow::V2::InputConfig, ::Hash] + # Required. Configuration describing where to import data from. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new + # + # # Call the import_conversation_data method. + # result = client.import_conversation_data request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_conversation_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest + + # Converts hash and nil to 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_conversation_data.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.import_conversation_data.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_conversation_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.call_rpc :import_conversation_data, 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 ConversationDatasets API. + # + # This class represents the configuration for ConversationDatasets, + # 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::Dialogflow::V2::ConversationDatasets::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_conversation_dataset to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation_dataset.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation_dataset.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::Dialogflow::V2::ConversationDatasets::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 ConversationDatasets 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_conversation_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation_dataset + ## + # RPC-specific configuration for `get_conversation_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation_dataset + ## + # RPC-specific configuration for `list_conversation_datasets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversation_datasets + ## + # RPC-specific configuration for `delete_conversation_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_conversation_dataset + ## + # RPC-specific configuration for `import_conversation_data` + # @return [::Gapic::Config::Method] + # + attr_reader :import_conversation_data + + # @private + def initialize parent_rpcs = nil + create_conversation_dataset_config = parent_rpcs.create_conversation_dataset if parent_rpcs.respond_to? :create_conversation_dataset + @create_conversation_dataset = ::Gapic::Config::Method.new create_conversation_dataset_config + get_conversation_dataset_config = parent_rpcs.get_conversation_dataset if parent_rpcs.respond_to? :get_conversation_dataset + @get_conversation_dataset = ::Gapic::Config::Method.new get_conversation_dataset_config + list_conversation_datasets_config = parent_rpcs.list_conversation_datasets if parent_rpcs.respond_to? :list_conversation_datasets + @list_conversation_datasets = ::Gapic::Config::Method.new list_conversation_datasets_config + delete_conversation_dataset_config = parent_rpcs.delete_conversation_dataset if parent_rpcs.respond_to? :delete_conversation_dataset + @delete_conversation_dataset = ::Gapic::Config::Method.new delete_conversation_dataset_config + import_conversation_data_config = parent_rpcs.import_conversation_data if parent_rpcs.respond_to? :import_conversation_data + @import_conversation_data = ::Gapic::Config::Method.new import_conversation_data_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/credentials.rb new file mode 100644 index 000000000000..700f2a11e779 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationDatasets + # Credentials for the ConversationDatasets API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb new file mode 100644 index 000000000000..140f9cd3f8b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module ConversationDatasets + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ConversationDatasets 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 ConversationDatasets 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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/paths.rb new file mode 100644 index 000000000000..80386ca17ead --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module ConversationDatasets + # Path helper methods for the ConversationDatasets API. + module Paths + ## + # Create a fully-qualified ConversationDataset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}` + # + # @param project [String] + # @param location [String] + # @param conversation_dataset [String] + # + # @return [::String] + def conversation_dataset_path project:, location:, conversation_dataset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversationDatasets/#{conversation_dataset}" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest.rb new file mode 100644 index 000000000000..8cf159548273 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/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 "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/conversation_datasets/credentials" +require "google/cloud/dialogflow/v2/conversation_datasets/paths" +require "google/cloud/dialogflow/v2/conversation_datasets/rest/operations" +require "google/cloud/dialogflow/v2/conversation_datasets/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Conversation datasets. + # + # Conversation datasets contain raw conversation files and their + # customizable metadata that can be used for model training. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/conversation_datasets/rest" + # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + module ConversationDatasets + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/conversation_datasets/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb new file mode 100644 index 000000000000..4d76ed64255a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb @@ -0,0 +1,892 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_dataset_pb" +require "google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationDatasets + module Rest + ## + # REST client for the ConversationDatasets service. + # + # Conversation datasets. + # + # Conversation datasets contain raw conversation files and their + # customizable metadata that can be used for model training. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversation_datasets_stub + + ## + # Configure the ConversationDatasets Client class. + # + # See {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationDatasets clients + # ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::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 + @conversation_datasets_stub.universe_domain + end + + ## + # Create a new ConversationDatasets REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::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 + + @conversation_datasets_stub = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @conversation_datasets_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 = @conversation_datasets_stub.endpoint + config.universe_domain = @conversation_datasets_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @conversation_datasets_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationDatasets::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 + @conversation_datasets_stub.logger + end + + # Service calls + + ## + # Creates a new conversation dataset. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::CreateConversationDatasetOperationMetadata CreateConversationDatasetOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ConversationDataset ConversationDataset} + # + # @overload create_conversation_dataset(request, options = nil) + # Pass arguments to `create_conversation_dataset` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(parent: nil, conversation_dataset: nil) + # Pass arguments to `create_conversation_dataset` via keyword arguments. Note that at + # least one keyword argument is 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 project to create conversation dataset for. Format: + # `projects//locations/` + # @param conversation_dataset [::Google::Cloud::Dialogflow::V2::ConversationDataset, ::Hash] + # Required. The conversation dataset 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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new + # + # # Call the create_conversation_dataset method. + # result = client.create_conversation_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_conversation_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest + + # Converts hash and nil to an 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_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_conversation_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.create_conversation_dataset 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 + + ## + # Retrieves the specified conversation dataset. + # + # @overload get_conversation_dataset(request, options = nil) + # Pass arguments to `get_conversation_dataset` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(name: nil) + # Pass arguments to `get_conversation_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To 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 conversation dataset to retrieve. Format: + # `projects//locations//conversationDatasets/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationDataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationDataset] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new + # + # # Call the get_conversation_dataset method. + # result = client.get_conversation_dataset request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. + # p result + # + def get_conversation_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest + + # Converts hash and nil to an 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_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_conversation_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.get_conversation_dataset 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 + + ## + # Returns the list of all conversation datasets in the specified + # project and location. + # + # @overload list_conversation_datasets(request, options = nil) + # Pass arguments to `list_conversation_datasets` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_datasets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_conversation_datasets` via keyword arguments. Note that at + # least one keyword argument is 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 project and location name to list all conversation datasets + # for. Format: `projects//locations/` + # @param page_size [::Integer] + # Optional. Maximum number of conversation datasets to return in a single + # page. By default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new + # + # # Call the list_conversation_datasets method. + # result = client.list_conversation_datasets 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::Dialogflow::V2::ConversationDataset. + # p item + # end + # + def list_conversation_datasets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest + + # Converts hash and nil to an 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_conversation_datasets.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_conversation_datasets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_conversation_datasets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.list_conversation_datasets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @conversation_datasets_stub, :list_conversation_datasets, "conversation_datasets", 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 the specified conversation dataset. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetOperationMetadata DeleteConversationDatasetOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload delete_conversation_dataset(request, options = nil) + # Pass arguments to `delete_conversation_dataset` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dataset(name: nil) + # Pass arguments to `delete_conversation_dataset` via keyword arguments. Note that at + # least one keyword argument is required. To 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 conversation dataset to delete. Format: + # `projects//locations//conversationDatasets/` + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new + # + # # Call the delete_conversation_dataset method. + # result = client.delete_conversation_dataset request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_conversation_dataset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest + + # Converts hash and nil to an 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_dataset.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_dataset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_conversation_dataset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.delete_conversation_dataset 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 + + ## + # Import data into the specified conversation dataset. Note that it + # is not allowed to import data to a conversation dataset that + # already has data in it. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::ImportConversationDataOperationMetadata ImportConversationDataOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ImportConversationDataOperationResponse ImportConversationDataOperationResponse} + # + # @overload import_conversation_data(request, options = nil) + # Pass arguments to `import_conversation_data` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_data(name: nil, input_config: nil) + # Pass arguments to `import_conversation_data` via keyword arguments. Note that at + # least one keyword argument is required. To 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. Dataset resource name. Format: + # `projects//locations//conversationDatasets/` + # @param input_config [::Google::Cloud::Dialogflow::V2::InputConfig, ::Hash] + # Required. Configuration describing where to import data from. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new + # + # # Call the import_conversation_data method. + # result = client.import_conversation_data request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_conversation_data request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest + + # Converts hash and nil to an 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_conversation_data.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_conversation_data.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_conversation_data.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_datasets_stub.import_conversation_data 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 ConversationDatasets REST API. + # + # This class represents the configuration for ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::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_conversation_dataset to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation_dataset.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation_dataset.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 ConversationDatasets 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_conversation_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation_dataset + ## + # RPC-specific configuration for `get_conversation_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation_dataset + ## + # RPC-specific configuration for `list_conversation_datasets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversation_datasets + ## + # RPC-specific configuration for `delete_conversation_dataset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_conversation_dataset + ## + # RPC-specific configuration for `import_conversation_data` + # @return [::Gapic::Config::Method] + # + attr_reader :import_conversation_data + + # @private + def initialize parent_rpcs = nil + create_conversation_dataset_config = parent_rpcs.create_conversation_dataset if parent_rpcs.respond_to? :create_conversation_dataset + @create_conversation_dataset = ::Gapic::Config::Method.new create_conversation_dataset_config + get_conversation_dataset_config = parent_rpcs.get_conversation_dataset if parent_rpcs.respond_to? :get_conversation_dataset + @get_conversation_dataset = ::Gapic::Config::Method.new get_conversation_dataset_config + list_conversation_datasets_config = parent_rpcs.list_conversation_datasets if parent_rpcs.respond_to? :list_conversation_datasets + @list_conversation_datasets = ::Gapic::Config::Method.new list_conversation_datasets_config + delete_conversation_dataset_config = parent_rpcs.delete_conversation_dataset if parent_rpcs.respond_to? :delete_conversation_dataset + @delete_conversation_dataset = ::Gapic::Config::Method.new delete_conversation_dataset_config + import_conversation_data_config = parent_rpcs.import_conversation_data if parent_rpcs.respond_to? :import_conversation_data + @import_conversation_data = ::Gapic::Config::Method.new import_conversation_data_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb new file mode 100644 index 000000000000..d6e78f68bdf0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb @@ -0,0 +1,947 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module ConversationDatasets + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ConversationDatasets 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 ConversationDatasets 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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb new file mode 100644 index 000000000000..1d4282fe9c2b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb @@ -0,0 +1,410 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_dataset_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationDatasets + module Rest + ## + # REST service stub for the ConversationDatasets 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_conversation_dataset REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_conversation_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_dataset_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_dataset", + 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_conversation_dataset REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ConversationDataset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationDataset] + # A result object deserialized from the server's reply + def get_conversation_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_dataset_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_dataset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ConversationDataset.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_conversation_datasets REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListConversationDatasetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse] + # A result object deserialized from the server's reply + def list_conversation_datasets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_conversation_datasets_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_conversation_datasets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse.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_dataset REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_conversation_dataset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_conversation_dataset_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_dataset", + 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_conversation_data REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_conversation_data request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_conversation_data_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_conversation_data", + 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 create_conversation_dataset REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/conversationDatasets", + body: "conversation_dataset", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_conversation_dataset REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/conversationDatasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationDatasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_conversation_datasets REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest] + # 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_conversation_datasets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/conversationDatasets", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/conversationDatasets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_conversation_dataset REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest] + # 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_dataset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationDatasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_conversation_data REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest] + # 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_conversation_data_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:importConversationData", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/conversationDatasets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:importConversationData", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationDatasets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb new file mode 100644 index 000000000000..5d369255036d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/conversation_event.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dialogflow/v2/participant_pb' +require 'google/cloud/dialogflow/v2/session_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n3google/cloud/dialogflow/v2/conversation_event.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a\x17google/rpc/status.proto\"\xff\x03\n\x11\x43onversationEvent\x12\x14\n\x0c\x63onversation\x18\x01 \x01(\t\x12@\n\x04type\x18\x02 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.ConversationEvent.Type\x12(\n\x0c\x65rror_status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x42\n\x13new_message_payload\x18\x04 \x01(\x0b\x32#.google.cloud.dialogflow.v2.MessageH\x00\x12`\n\x1enew_recognition_result_payload\x18\x05 \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.StreamingRecognitionResultH\x00\"\xb6\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43ONVERSATION_STARTED\x10\x01\x12\x19\n\x15\x43ONVERSATION_FINISHED\x10\x02\x12\x1d\n\x19HUMAN_INTERVENTION_NEEDED\x10\x03\x12\x0f\n\x0bNEW_MESSAGE\x10\x05\x12\x1a\n\x16NEW_RECOGNITION_RESULT\x10\x07\x12\x17\n\x13UNRECOVERABLE_ERROR\x10\x04\x42\t\n\x07payloadB\x9c\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x16\x43onversationEventProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + ConversationEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationEvent").msgclass + ConversationEvent::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationEvent.Type").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_pb.rb new file mode 100644 index 000000000000..c171ffc226cc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/conversation_model.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 = "\n3google/cloud/dialogflow/v2/conversation_model.proto\x12\x1agoogle.cloud.dialogflow.v2\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\"\x8d\x08\n\x11\x43onversationModel\x12\x0c\n\x04name\x18\x01 \x01(\t\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?\n\x08\x64\x61tasets\x18\x04 \x03(\x0b\x32(.google.cloud.dialogflow.v2.InputDatasetB\x03\xe0\x41\x02\x12G\n\x05state\x18\x07 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.ConversationModel.StateB\x03\xe0\x41\x03\x12\x15\n\rlanguage_code\x18\x13 \x01(\t\x12g\n!article_suggestion_model_metadata\x18\x08 \x01(\x0b\x32:.google.cloud.dialogflow.v2.ArticleSuggestionModelMetadataH\x00\x12Y\n\x1asmart_reply_model_metadata\x18\t \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SmartReplyModelMetadataH\x00\x12\x1f\n\rsatisfies_pzs\x18\x19 \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x1a \x01(\x08\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\"\x91\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0e\n\nUNDEPLOYED\x10\x02\x12\r\n\tDEPLOYING\x10\x03\x12\x0c\n\x08\x44\x45PLOYED\x10\x04\x12\x0f\n\x0bUNDEPLOYING\x10\x05\x12\x0c\n\x08\x44\x45LETING\x10\x06\x12\n\n\x06\x46\x41ILED\x10\x07\x12\x0b\n\x07PENDING\x10\x08\"g\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\"\n\x1eSMART_REPLY_DUAL_ENCODER_MODEL\x10\x02\x12\x1a\n\x16SMART_REPLY_BERT_MODEL\x10\x06:\xbe\x01\xea\x41\xba\x01\n+dialogflow.googleapis.com/ConversationModel\x12Oprojects/{project}/locations/{location}/conversationModels/{conversation_model}\x12:projects/{project}/conversationModels/{conversation_model}B\x10\n\x0emodel_metadataB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"\xcf\x04\n\x1b\x43onversationModelEvaluation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12L\n\x11\x65valuation_config\x18\x06 \x01(\x0b\x32,.google.cloud.dialogflow.v2.EvaluationConfigB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Q\n\x13smart_reply_metrics\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SmartReplyMetricsB\x03\xe0\x41\x03H\x00\x12(\n\x1braw_human_eval_template_csv\x18\x08 \x01(\tB\x03\xe0\x41\x03:\xfa\x01\xea\x41\xf6\x01\n5dialogflow.googleapis.com/ConversationModelEvaluation\x12Sprojects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}\x12hprojects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}B\t\n\x07metrics\"\x9c\x04\n\x10\x45valuationConfig\x12?\n\x08\x64\x61tasets\x18\x03 \x03(\x0b\x32(.google.cloud.dialogflow.v2.InputDatasetB\x03\xe0\x41\x02\x12[\n\x12smart_reply_config\x18\x02 \x01(\x0b\x32=.google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfigH\x00\x12_\n\x14smart_compose_config\x18\x04 \x01(\x0b\x32?.google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfigH\x00\x1av\n\x10SmartReplyConfig\x12\x43\n\x12\x61llowlist_document\x18\x01 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/Document\x12\x1d\n\x10max_result_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1ax\n\x12SmartComposeConfig\x12\x43\n\x12\x61llowlist_document\x18\x01 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/Document\x12\x1d\n\x10max_result_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x42\x17\n\x15model_specific_config\"V\n\x0cInputDataset\x12\x46\n\x07\x64\x61taset\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\"{\n\x1e\x41rticleSuggestionModelMetadata\x12Y\n\x13training_model_type\x18\x03 \x01(\x0e\x32\x37.google.cloud.dialogflow.v2.ConversationModel.ModelTypeB\x03\xe0\x41\x01\"t\n\x17SmartReplyModelMetadata\x12Y\n\x13training_model_type\x18\x06 \x01(\x0e\x32\x37.google.cloud.dialogflow.v2.ConversationModel.ModelTypeB\x03\xe0\x41\x01\"\xc7\x01\n\x11SmartReplyMetrics\x12\x1a\n\x12\x61llowlist_coverage\x18\x01 \x01(\x02\x12P\n\rtop_n_metrics\x18\x02 \x03(\x0b\x32\x39.google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics\x12\x1a\n\x12\x63onversation_count\x18\x03 \x01(\x03\x1a(\n\x0bTopNMetrics\x12\t\n\x01n\x18\x01 \x01(\x05\x12\x0e\n\x06recall\x18\x02 \x01(\x02\"\x80\x01\n\x1e\x43reateConversationModelRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12N\n\x12\x63onversation_model\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.v2.ConversationModelB\x03\xe0\x41\x02\"0\n\x1bGetConversationModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"e\n\x1dListConversationModelsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\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\"\x85\x01\n\x1eListConversationModelsResponse\x12J\n\x13\x63onversation_models\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.v2.ConversationModel\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"3\n\x1e\x44\x65leteConversationModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"3\n\x1e\x44\x65ployConversationModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"5\n UndeployConversationModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\":\n%GetConversationModelEvaluationRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"o\n\'ListConversationModelEvaluationsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\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\"\xa4\x01\n(ListConversationModelEvaluationsResponse\x12_\n\x1e\x63onversation_model_evaluations\x18\x01 \x03(\x0b\x32\x37.google.cloud.dialogflow.v2.ConversationModelEvaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xde\x01\n(CreateConversationModelEvaluationRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x64ialogflow.googleapis.com/ConversationModelEvaluation\x12\x63\n\x1d\x63onversation_model_evaluation\x18\x02 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.ConversationModelEvaluationB\x03\xe0\x41\x02\"\xf6\x02\n(CreateConversationModelOperationMetadata\x12\x1a\n\x12\x63onversation_model\x18\x01 \x01(\t\x12Y\n\x05state\x18\x02 \x01(\x0e\x32J.google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"s\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\x0c\n\x08TRAINING\x10\x06\"\xa6\x01\n(DeployConversationModelOperationMetadata\x12\x1a\n\x12\x63onversation_model\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa8\x01\n*UndeployConversationModelOperationMetadata\x12\x1a\n\x12\x63onversation_model\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa6\x01\n(DeleteConversationModelOperationMetadata\x12\x1a\n\x12\x63onversation_model\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xf6\x02\n2CreateConversationModelEvaluationOperationMetadata\x12%\n\x1d\x63onversation_model_evaluation\x18\x01 \x01(\t\x12\x1a\n\x12\x63onversation_model\x18\x04 \x01(\t\x12\x63\n\x05state\x18\x02 \x01(\x0e\x32T.google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"g\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x32\xfe\x16\n\x12\x43onversationModels\x12\xe8\x02\n\x17\x43reateConversationModel\x12:.google.cloud.dialogflow.v2.CreateConversationModelRequest\x1a\x1d.google.longrunning.Operation\"\xf1\x01\xca\x41=\n\x11\x43onversationModel\x12(CreateConversationModelOperationMetadata\xda\x41\x19parent,conversation_model\x82\xd3\xe4\x93\x02\x8e\x01\"*/v2/{parent=projects/*}/conversationModels:\x12\x63onversation_modelZL\"6/v2/{parent=projects/*/locations/*}/conversationModels:\x12\x63onversation_model\x12\xf3\x01\n\x14GetConversationModel\x12\x37.google.cloud.dialogflow.v2.GetConversationModelRequest\x1a-.google.cloud.dialogflow.v2.ConversationModel\"s\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\x12*/v2/{name=projects/*/conversationModels/*}Z8\x12\x36/v2/{name=projects/*/locations/*/conversationModels/*}\x12\x86\x02\n\x16ListConversationModels\x12\x39.google.cloud.dialogflow.v2.ListConversationModelsRequest\x1a:.google.cloud.dialogflow.v2.ListConversationModelsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v2/{parent=projects/*}/conversationModelsZ8\x12\x36/v2/{parent=projects/*/locations/*}/conversationModels\x12\xae\x02\n\x17\x44\x65leteConversationModel\x12:.google.cloud.dialogflow.v2.DeleteConversationModelRequest\x1a\x1d.google.longrunning.Operation\"\xb7\x01\xca\x41\x41\n\x15google.protobuf.Empty\x12(DeleteConversationModelOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66**/v2/{name=projects/*/conversationModels/*}Z8*6/v2/{name=projects/*/locations/*/conversationModels/*}\x12\xbb\x02\n\x17\x44\x65ployConversationModel\x12:.google.cloud.dialogflow.v2.DeployConversationModelRequest\x1a\x1d.google.longrunning.Operation\"\xc4\x01\xca\x41\x41\n\x15google.protobuf.Empty\x12(DeployConversationModelOperationMetadata\x82\xd3\xe4\x93\x02z\"1/v2/{name=projects/*/conversationModels/*}:deploy:\x01*ZB\"=/v2/{name=projects/*/locations/*/conversationModels/*}:deploy:\x01*\x12\xc5\x02\n\x19UndeployConversationModel\x12<.google.cloud.dialogflow.v2.UndeployConversationModelRequest\x1a\x1d.google.longrunning.Operation\"\xca\x01\xca\x41\x43\n\x15google.protobuf.Empty\x12*UndeployConversationModelOperationMetadata\x82\xd3\xe4\x93\x02~\"3/v2/{name=projects/*/conversationModels/*}:undeploy:\x01*ZD\"?/v2/{name=projects/*/locations/*/conversationModels/*}:undeploy:\x01*\x12\xaf\x02\n\x1eGetConversationModelEvaluation\x12\x41.google.cloud.dialogflow.v2.GetConversationModelEvaluationRequest\x1a\x37.google.cloud.dialogflow.v2.ConversationModelEvaluation\"\x90\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x82\x01\x12\x38/v2/{name=projects/*/conversationModels/*/evaluations/*}ZF\x12\x44/v2/{name=projects/*/locations/*/conversationModels/*/evaluations/*}\x12\xc2\x02\n ListConversationModelEvaluations\x12\x43.google.cloud.dialogflow.v2.ListConversationModelEvaluationsRequest\x1a\x44.google.cloud.dialogflow.v2.ListConversationModelEvaluationsResponse\"\x92\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x82\x01\x12\x38/v2/{parent=projects/*/conversationModels/*}/evaluationsZF\x12\x44/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations\x12\xd5\x02\n!CreateConversationModelEvaluation\x12\x44.google.cloud.dialogflow.v2.CreateConversationModelEvaluationRequest\x1a\x1d.google.longrunning.Operation\"\xca\x01\xca\x41Q\n\x1b\x43onversationModelEvaluation\x12\x32\x43reateConversationModelEvaluationOperationMetadata\xda\x41$parent,conversation_model_evaluation\x82\xd3\xe4\x93\x02I\"D/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9c\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x16\x43onversationModelProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + ConversationModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationModel").msgclass + ConversationModel::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationModel.State").enummodule + ConversationModel::ModelType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationModel.ModelType").enummodule + ConversationModelEvaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationModelEvaluation").msgclass + EvaluationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EvaluationConfig").msgclass + EvaluationConfig::SmartReplyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfig").msgclass + EvaluationConfig::SmartComposeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfig").msgclass + InputDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputDataset").msgclass + ArticleSuggestionModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata").msgclass + SmartReplyModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyModelMetadata").msgclass + SmartReplyMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyMetrics").msgclass + SmartReplyMetrics::TopNMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics").msgclass + CreateConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelRequest").msgclass + GetConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationModelRequest").msgclass + ListConversationModelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationModelsRequest").msgclass + ListConversationModelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationModelsResponse").msgclass + DeleteConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationModelRequest").msgclass + DeployConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeployConversationModelRequest").msgclass + UndeployConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UndeployConversationModelRequest").msgclass + GetConversationModelEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationModelEvaluationRequest").msgclass + ListConversationModelEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationModelEvaluationsRequest").msgclass + ListConversationModelEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationModelEvaluationsResponse").msgclass + CreateConversationModelEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelEvaluationRequest").msgclass + CreateConversationModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata").msgclass + CreateConversationModelOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State").enummodule + DeployConversationModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata").msgclass + UndeployConversationModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata").msgclass + DeleteConversationModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata").msgclass + CreateConversationModelEvaluationOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata").msgclass + CreateConversationModelEvaluationOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_services_pb.rb new file mode 100644 index 000000000000..20b1fc988c19 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_services_pb.rb @@ -0,0 +1,103 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/conversation_model.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/conversation_model_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationModels + # Manages a collection of models for human agent assistant. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.ConversationModels' + + # Creates a model. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] + # - `response`: + # [ConversationModel][google.cloud.dialogflow.v2.ConversationModel] + rpc :CreateConversationModel, ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, ::Google::Longrunning::Operation + # Gets conversation model. + rpc :GetConversationModel, ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, ::Google::Cloud::Dialogflow::V2::ConversationModel + # Lists conversation models. + rpc :ListConversationModels, ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, ::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse + # Deletes a model. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + rpc :DeleteConversationModel, ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, ::Google::Longrunning::Operation + # Deploys a model. If a model is already deployed, deploying it + # has no effect. A model can only serve prediction requests after it gets + # deployed. For article suggestion, custom model will not be used unless + # it is deployed. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + rpc :DeployConversationModel, ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, ::Google::Longrunning::Operation + # Undeploys a model. If the model is not deployed this method has no effect. + # If the model is currently being used: + # - For article suggestion, article suggestion will fallback to the default + # model if model is undeployed. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + rpc :UndeployConversationModel, ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, ::Google::Longrunning::Operation + # Gets an evaluation of conversation model. + rpc :GetConversationModelEvaluation, ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation + # Lists evaluations of a conversation model. + rpc :ListConversationModelEvaluations, ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse + # Creates evaluation of a conversation model. + rpc :CreateConversationModelEvaluation, ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models.rb new file mode 100644 index 000000000000..838bdbd3e609 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/conversation_models/credentials" +require "google/cloud/dialogflow/v2/conversation_models/paths" +require "google/cloud/dialogflow/v2/conversation_models/operations" +require "google/cloud/dialogflow/v2/conversation_models/client" +require "google/cloud/dialogflow/v2/conversation_models/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Manages a collection of models for human agent assistant. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/conversation_models" + # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/conversation_models/rest" + # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + module ConversationModels + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversation_models", "helpers.rb" +require "google/cloud/dialogflow/v2/conversation_models/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb new file mode 100644 index 000000000000..28a4a2fd13e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb @@ -0,0 +1,1371 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_model_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationModels + ## + # Client for the ConversationModels service. + # + # Manages a collection of models for human agent assistant. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversation_models_stub + + ## + # Configure the ConversationModels Client class. + # + # See {::Google::Cloud::Dialogflow::V2::ConversationModels::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationModels clients + # ::Google::Cloud::Dialogflow::V2::ConversationModels::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationModels 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::Dialogflow::V2::ConversationModels::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 + @conversation_models_stub.universe_domain + end + + ## + # Create a new ConversationModels client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationModels 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/dialogflow/v2/conversation_model_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 + + @conversation_models_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::ConversationModels::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 + ) + + @conversation_models_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 = @conversation_models_stub.endpoint + config.universe_domain = @conversation_models_stub.universe_domain + config.logger = @conversation_models_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationModels::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 + @conversation_models_stub.logger + end + + # Service calls + + ## + # Creates a model. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::CreateConversationModelOperationMetadata CreateConversationModelOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ConversationModel ConversationModel} + # + # @overload create_conversation_model(request, options = nil) + # Pass arguments to `create_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(parent: nil, conversation_model: nil) + # Pass arguments to `create_conversation_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 parent [::String] + # The project to create conversation model for. Format: + # `projects/` + # @param conversation_model [::Google::Cloud::Dialogflow::V2::ConversationModel, ::Hash] + # Required. The conversation model 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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new + # + # # Call the create_conversation_model method. + # result = client.create_conversation_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 create_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest + + # Converts hash and nil to 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_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.call_rpc :create_conversation_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 conversation model. + # + # @overload get_conversation_model(request, options = nil) + # Pass arguments to `get_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `get_conversation_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 name [::String] + # Required. The conversation model to retrieve. Format: + # `projects//conversationModels/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationModel] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationModel] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new + # + # # Call the get_conversation_model method. + # result = client.get_conversation_model request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. + # p result + # + def get_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest + + # Converts hash and nil to 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_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.call_rpc :get_conversation_model, 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 conversation models. + # + # @overload list_conversation_models(request, options = nil) + # Pass arguments to `list_conversation_models` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_models(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_conversation_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 parent [::String] + # Required. The project to list all conversation models for. + # Format: `projects/` + # @param page_size [::Integer] + # Optional. Maximum number of conversation models to return in a single + # page. By default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new + # + # # Call the list_conversation_models method. + # result = client.list_conversation_models 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::Dialogflow::V2::ConversationModel. + # p item + # end + # + def list_conversation_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest + + # Converts hash and nil to 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_conversation_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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_conversation_models.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_conversation_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.call_rpc :list_conversation_models, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @conversation_models_stub, :list_conversation_models, 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 model. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::DeleteConversationModelOperationMetadata DeleteConversationModelOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload delete_conversation_model(request, options = nil) + # Pass arguments to `delete_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `delete_conversation_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 name [::String] + # Required. The conversation model to delete. Format: + # `projects//conversationModels/` + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new + # + # # Call the delete_conversation_model method. + # result = client.delete_conversation_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 delete_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest + + # Converts hash and nil to 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_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.call_rpc :delete_conversation_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 + + ## + # Deploys a model. If a model is already deployed, deploying it + # has no effect. A model can only serve prediction requests after it gets + # deployed. For article suggestion, custom model will not be used unless + # it is deployed. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::DeployConversationModelOperationMetadata DeployConversationModelOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload deploy_conversation_model(request, options = nil) + # Pass arguments to `deploy_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload deploy_conversation_model(name: nil) + # Pass arguments to `deploy_conversation_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 name [::String] + # Required. The conversation model to deploy. Format: + # `projects//conversationModels/` + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new + # + # # Call the deploy_conversation_model method. + # result = client.deploy_conversation_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 deploy_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.deploy_conversation_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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.deploy_conversation_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.deploy_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.call_rpc :deploy_conversation_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 + + ## + # Undeploys a model. If the model is not deployed this method has no effect. + # If the model is currently being used: + # - For article suggestion, article suggestion will fallback to the default + # model if model is undeployed. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::UndeployConversationModelOperationMetadata UndeployConversationModelOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload undeploy_conversation_model(request, options = nil) + # Pass arguments to `undeploy_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undeploy_conversation_model(name: nil) + # Pass arguments to `undeploy_conversation_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 name [::String] + # Required. The conversation model to undeploy. Format: + # `projects//conversationModels/` + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new + # + # # Call the undeploy_conversation_model method. + # result = client.undeploy_conversation_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 undeploy_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.undeploy_conversation_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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.undeploy_conversation_model.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undeploy_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.call_rpc :undeploy_conversation_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 an evaluation of conversation model. + # + # @overload get_conversation_model_evaluation(request, options = nil) + # Pass arguments to `get_conversation_model_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model_evaluation(name: nil) + # Pass arguments to `get_conversation_model_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To 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 conversation model evaluation resource name. Format: + # `projects//conversationModels//evaluations/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new + # + # # Call the get_conversation_model_evaluation method. + # result = client.get_conversation_model_evaluation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. + # p result + # + def get_conversation_model_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest + + # Converts hash and nil to 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_model_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_model_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_conversation_model_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.call_rpc :get_conversation_model_evaluation, 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 evaluations of a conversation model. + # + # @overload list_conversation_model_evaluations(request, options = nil) + # Pass arguments to `list_conversation_model_evaluations` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_model_evaluations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_conversation_model_evaluations` via keyword arguments. Note that at + # least one keyword argument is 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 conversation model resource name. Format: + # `projects//conversationModels/` + # @param page_size [::Integer] + # Optional. Maximum number of evaluations to return in a + # single page. By default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new + # + # # Call the list_conversation_model_evaluations method. + # result = client.list_conversation_model_evaluations 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::Dialogflow::V2::ConversationModelEvaluation. + # p item + # end + # + def list_conversation_model_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest + + # Converts hash and nil to 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_conversation_model_evaluations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_conversation_model_evaluations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_conversation_model_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.call_rpc :list_conversation_model_evaluations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @conversation_models_stub, :list_conversation_model_evaluations, 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 evaluation of a conversation model. + # + # @overload create_conversation_model_evaluation(request, options = nil) + # Pass arguments to `create_conversation_model_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model_evaluation(parent: nil, conversation_model_evaluation: nil) + # Pass arguments to `create_conversation_model_evaluation` via keyword arguments. Note that at + # least one keyword argument is 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 conversation model resource name. Format: + # `projects//locations//conversationModels/` + # @param conversation_model_evaluation [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation, ::Hash] + # Required. The conversation model evaluation to be created. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new + # + # # Call the create_conversation_model_evaluation method. + # result = client.create_conversation_model_evaluation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_conversation_model_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest + + # Converts hash and nil to 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_model_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_model_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_conversation_model_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.call_rpc :create_conversation_model_evaluation, 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 ConversationModels API. + # + # This class represents the configuration for ConversationModels, + # 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::Dialogflow::V2::ConversationModels::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_conversation_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation_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::Dialogflow::V2::ConversationModels::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 ConversationModels 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation_model + ## + # RPC-specific configuration for `get_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation_model + ## + # RPC-specific configuration for `list_conversation_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversation_models + ## + # RPC-specific configuration for `delete_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_conversation_model + ## + # RPC-specific configuration for `deploy_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_conversation_model + ## + # RPC-specific configuration for `undeploy_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_conversation_model + ## + # RPC-specific configuration for `get_conversation_model_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation_model_evaluation + ## + # RPC-specific configuration for `list_conversation_model_evaluations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversation_model_evaluations + ## + # RPC-specific configuration for `create_conversation_model_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation_model_evaluation + + # @private + def initialize parent_rpcs = nil + create_conversation_model_config = parent_rpcs.create_conversation_model if parent_rpcs.respond_to? :create_conversation_model + @create_conversation_model = ::Gapic::Config::Method.new create_conversation_model_config + get_conversation_model_config = parent_rpcs.get_conversation_model if parent_rpcs.respond_to? :get_conversation_model + @get_conversation_model = ::Gapic::Config::Method.new get_conversation_model_config + list_conversation_models_config = parent_rpcs.list_conversation_models if parent_rpcs.respond_to? :list_conversation_models + @list_conversation_models = ::Gapic::Config::Method.new list_conversation_models_config + delete_conversation_model_config = parent_rpcs.delete_conversation_model if parent_rpcs.respond_to? :delete_conversation_model + @delete_conversation_model = ::Gapic::Config::Method.new delete_conversation_model_config + deploy_conversation_model_config = parent_rpcs.deploy_conversation_model if parent_rpcs.respond_to? :deploy_conversation_model + @deploy_conversation_model = ::Gapic::Config::Method.new deploy_conversation_model_config + undeploy_conversation_model_config = parent_rpcs.undeploy_conversation_model if parent_rpcs.respond_to? :undeploy_conversation_model + @undeploy_conversation_model = ::Gapic::Config::Method.new undeploy_conversation_model_config + get_conversation_model_evaluation_config = parent_rpcs.get_conversation_model_evaluation if parent_rpcs.respond_to? :get_conversation_model_evaluation + @get_conversation_model_evaluation = ::Gapic::Config::Method.new get_conversation_model_evaluation_config + list_conversation_model_evaluations_config = parent_rpcs.list_conversation_model_evaluations if parent_rpcs.respond_to? :list_conversation_model_evaluations + @list_conversation_model_evaluations = ::Gapic::Config::Method.new list_conversation_model_evaluations_config + create_conversation_model_evaluation_config = parent_rpcs.create_conversation_model_evaluation if parent_rpcs.respond_to? :create_conversation_model_evaluation + @create_conversation_model_evaluation = ::Gapic::Config::Method.new create_conversation_model_evaluation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/credentials.rb new file mode 100644 index 000000000000..dbb05638c52e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationModels + # Credentials for the ConversationModels API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb new file mode 100644 index 000000000000..71432ed69344 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module ConversationModels + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ConversationModels 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 ConversationModels 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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/paths.rb new file mode 100644 index 000000000000..820b0249a7e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/paths.rb @@ -0,0 +1,183 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module ConversationModels + # Path helper methods for the ConversationModels API. + module Paths + ## + # Create a fully-qualified ConversationDataset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}` + # + # @param project [String] + # @param location [String] + # @param conversation_dataset [String] + # + # @return [::String] + def conversation_dataset_path project:, location:, conversation_dataset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversationDatasets/#{conversation_dataset}" + end + + ## + # Create a fully-qualified ConversationModel resource string. + # + # @overload conversation_model_path(project:, location:, conversation_model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversationModels/{conversation_model}` + # + # @param project [String] + # @param location [String] + # @param conversation_model [String] + # + # @overload conversation_model_path(project:, conversation_model:) + # The resource will be in the following format: + # + # `projects/{project}/conversationModels/{conversation_model}` + # + # @param project [String] + # @param conversation_model [String] + # + # @return [::String] + def conversation_model_path **args + resources = { + "conversation_model:location:project" => (proc do |project:, location:, conversation_model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}" + end), + "conversation_model:project" => (proc do |project:, conversation_model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/conversationModels/#{conversation_model}" + 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 ConversationModelEvaluation resource string. + # + # @overload conversation_model_evaluation_path(project:, conversation_model:, evaluation:) + # The resource will be in the following format: + # + # `projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}` + # + # @param project [String] + # @param conversation_model [String] + # @param evaluation [String] + # + # @overload conversation_model_evaluation_path(project:, location:, conversation_model:, evaluation:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}` + # + # @param project [String] + # @param location [String] + # @param conversation_model [String] + # @param evaluation [String] + # + # @return [::String] + def conversation_model_evaluation_path **args + resources = { + "conversation_model:evaluation:project" => (proc do |project:, conversation_model:, evaluation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "conversation_model cannot contain /" if conversation_model.to_s.include? "/" + + "projects/#{project}/conversationModels/#{conversation_model}/evaluations/#{evaluation}" + end), + "conversation_model:evaluation:location:project" => (proc do |project:, location:, conversation_model:, evaluation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "conversation_model cannot contain /" if conversation_model.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}/evaluations/#{evaluation}" + 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:, knowledge_base:, document:) + # The resource will be in the following format: + # + # `projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}` + # + # @param project [String] + # @param knowledge_base [String] + # @param document [String] + # + # @overload document_path(project:, location:, knowledge_base:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param knowledge_base [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" + + "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}" + end), + "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" + + "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/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 + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest.rb new file mode 100644 index 000000000000..d4682b5d4ea8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/conversation_models/credentials" +require "google/cloud/dialogflow/v2/conversation_models/paths" +require "google/cloud/dialogflow/v2/conversation_models/rest/operations" +require "google/cloud/dialogflow/v2/conversation_models/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Manages a collection of models for human agent assistant. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/conversation_models/rest" + # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + module ConversationModels + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/conversation_models/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb new file mode 100644 index 000000000000..e78945a16b3c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb @@ -0,0 +1,1273 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_model_pb" +require "google/cloud/dialogflow/v2/conversation_models/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationModels + module Rest + ## + # REST client for the ConversationModels service. + # + # Manages a collection of models for human agent assistant. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversation_models_stub + + ## + # Configure the ConversationModels Client class. + # + # See {::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationModels clients + # ::Google::Cloud::Dialogflow::V2::ConversationModels::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationModels 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::Dialogflow::V2::ConversationModels::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 + @conversation_models_stub.universe_domain + end + + ## + # Create a new ConversationModels REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationModels 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::Dialogflow::V2::ConversationModels::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 + + @conversation_models_stub = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @conversation_models_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 = @conversation_models_stub.endpoint + config.universe_domain = @conversation_models_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @conversation_models_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationModels::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 + @conversation_models_stub.logger + end + + # Service calls + + ## + # Creates a model. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::CreateConversationModelOperationMetadata CreateConversationModelOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ConversationModel ConversationModel} + # + # @overload create_conversation_model(request, options = nil) + # Pass arguments to `create_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(parent: nil, conversation_model: nil) + # Pass arguments to `create_conversation_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 parent [::String] + # The project to create conversation model for. Format: + # `projects/` + # @param conversation_model [::Google::Cloud::Dialogflow::V2::ConversationModel, ::Hash] + # Required. The conversation model 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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new + # + # # Call the create_conversation_model method. + # result = client.create_conversation_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 create_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest + + # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.create_conversation_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 conversation model. + # + # @overload get_conversation_model(request, options = nil) + # Pass arguments to `get_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `get_conversation_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 name [::String] + # Required. The conversation model to retrieve. Format: + # `projects//conversationModels/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationModel] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationModel] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new + # + # # Call the get_conversation_model method. + # result = client.get_conversation_model request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. + # p result + # + def get_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest + + # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.get_conversation_model 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 conversation models. + # + # @overload list_conversation_models(request, options = nil) + # Pass arguments to `list_conversation_models` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_models(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_conversation_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 parent [::String] + # Required. The project to list all conversation models for. + # Format: `projects/` + # @param page_size [::Integer] + # Optional. Maximum number of conversation models to return in a single + # page. By default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new + # + # # Call the list_conversation_models method. + # result = client.list_conversation_models 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::Dialogflow::V2::ConversationModel. + # p item + # end + # + def list_conversation_models request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest + + # Converts hash and nil to an 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_conversation_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_conversation_models.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_conversation_models.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.list_conversation_models request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @conversation_models_stub, :list_conversation_models, "conversation_models", 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 model. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::DeleteConversationModelOperationMetadata DeleteConversationModelOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload delete_conversation_model(request, options = nil) + # Pass arguments to `delete_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model(name: nil) + # Pass arguments to `delete_conversation_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 name [::String] + # Required. The conversation model to delete. Format: + # `projects//conversationModels/` + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new + # + # # Call the delete_conversation_model method. + # result = client.delete_conversation_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 delete_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest + + # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.delete_conversation_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 + + ## + # Deploys a model. If a model is already deployed, deploying it + # has no effect. A model can only serve prediction requests after it gets + # deployed. For article suggestion, custom model will not be used unless + # it is deployed. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::DeployConversationModelOperationMetadata DeployConversationModelOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload deploy_conversation_model(request, options = nil) + # Pass arguments to `deploy_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload deploy_conversation_model(name: nil) + # Pass arguments to `deploy_conversation_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 name [::String] + # Required. The conversation model to deploy. Format: + # `projects//conversationModels/` + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new + # + # # Call the deploy_conversation_model method. + # result = client.deploy_conversation_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 deploy_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.deploy_conversation_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.deploy_conversation_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.deploy_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.deploy_conversation_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 + + ## + # Undeploys a model. If the model is not deployed this method has no effect. + # If the model is currently being used: + # - For article suggestion, article suggestion will fallback to the default + # model if model is undeployed. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::UndeployConversationModelOperationMetadata UndeployConversationModelOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload undeploy_conversation_model(request, options = nil) + # Pass arguments to `undeploy_conversation_model` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undeploy_conversation_model(name: nil) + # Pass arguments to `undeploy_conversation_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 name [::String] + # Required. The conversation model to undeploy. Format: + # `projects//conversationModels/` + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new + # + # # Call the undeploy_conversation_model method. + # result = client.undeploy_conversation_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 undeploy_conversation_model request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.undeploy_conversation_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.undeploy_conversation_model.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undeploy_conversation_model.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.undeploy_conversation_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 an evaluation of conversation model. + # + # @overload get_conversation_model_evaluation(request, options = nil) + # Pass arguments to `get_conversation_model_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model_evaluation(name: nil) + # Pass arguments to `get_conversation_model_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To 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 conversation model evaluation resource name. Format: + # `projects//conversationModels//evaluations/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new + # + # # Call the get_conversation_model_evaluation method. + # result = client.get_conversation_model_evaluation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. + # p result + # + def get_conversation_model_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest + + # Converts hash and nil to an 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_model_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_model_evaluation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_conversation_model_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.get_conversation_model_evaluation 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 evaluations of a conversation model. + # + # @overload list_conversation_model_evaluations(request, options = nil) + # Pass arguments to `list_conversation_model_evaluations` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_model_evaluations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_conversation_model_evaluations` via keyword arguments. Note that at + # least one keyword argument is 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 conversation model resource name. Format: + # `projects//conversationModels/` + # @param page_size [::Integer] + # Optional. Maximum number of evaluations to return in a + # single page. By default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new + # + # # Call the list_conversation_model_evaluations method. + # result = client.list_conversation_model_evaluations 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::Dialogflow::V2::ConversationModelEvaluation. + # p item + # end + # + def list_conversation_model_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest + + # Converts hash and nil to an 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_conversation_model_evaluations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_conversation_model_evaluations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_conversation_model_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.list_conversation_model_evaluations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @conversation_models_stub, :list_conversation_model_evaluations, "conversation_model_evaluations", 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 evaluation of a conversation model. + # + # @overload create_conversation_model_evaluation(request, options = nil) + # Pass arguments to `create_conversation_model_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_model_evaluation(parent: nil, conversation_model_evaluation: nil) + # Pass arguments to `create_conversation_model_evaluation` via keyword arguments. Note that at + # least one keyword argument is 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 conversation model resource name. Format: + # `projects//locations//conversationModels/` + # @param conversation_model_evaluation [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation, ::Hash] + # Required. The conversation model evaluation to be created. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new + # + # # Call the create_conversation_model_evaluation method. + # result = client.create_conversation_model_evaluation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_conversation_model_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest + + # Converts hash and nil to an 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_model_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_model_evaluation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_conversation_model_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_models_stub.create_conversation_model_evaluation 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 ConversationModels REST API. + # + # This class represents the configuration for ConversationModels 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::Dialogflow::V2::ConversationModels::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_conversation_model to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation_model.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 ConversationModels 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation_model + ## + # RPC-specific configuration for `get_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation_model + ## + # RPC-specific configuration for `list_conversation_models` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversation_models + ## + # RPC-specific configuration for `delete_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_conversation_model + ## + # RPC-specific configuration for `deploy_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_conversation_model + ## + # RPC-specific configuration for `undeploy_conversation_model` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_conversation_model + ## + # RPC-specific configuration for `get_conversation_model_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation_model_evaluation + ## + # RPC-specific configuration for `list_conversation_model_evaluations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversation_model_evaluations + ## + # RPC-specific configuration for `create_conversation_model_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation_model_evaluation + + # @private + def initialize parent_rpcs = nil + create_conversation_model_config = parent_rpcs.create_conversation_model if parent_rpcs.respond_to? :create_conversation_model + @create_conversation_model = ::Gapic::Config::Method.new create_conversation_model_config + get_conversation_model_config = parent_rpcs.get_conversation_model if parent_rpcs.respond_to? :get_conversation_model + @get_conversation_model = ::Gapic::Config::Method.new get_conversation_model_config + list_conversation_models_config = parent_rpcs.list_conversation_models if parent_rpcs.respond_to? :list_conversation_models + @list_conversation_models = ::Gapic::Config::Method.new list_conversation_models_config + delete_conversation_model_config = parent_rpcs.delete_conversation_model if parent_rpcs.respond_to? :delete_conversation_model + @delete_conversation_model = ::Gapic::Config::Method.new delete_conversation_model_config + deploy_conversation_model_config = parent_rpcs.deploy_conversation_model if parent_rpcs.respond_to? :deploy_conversation_model + @deploy_conversation_model = ::Gapic::Config::Method.new deploy_conversation_model_config + undeploy_conversation_model_config = parent_rpcs.undeploy_conversation_model if parent_rpcs.respond_to? :undeploy_conversation_model + @undeploy_conversation_model = ::Gapic::Config::Method.new undeploy_conversation_model_config + get_conversation_model_evaluation_config = parent_rpcs.get_conversation_model_evaluation if parent_rpcs.respond_to? :get_conversation_model_evaluation + @get_conversation_model_evaluation = ::Gapic::Config::Method.new get_conversation_model_evaluation_config + list_conversation_model_evaluations_config = parent_rpcs.list_conversation_model_evaluations if parent_rpcs.respond_to? :list_conversation_model_evaluations + @list_conversation_model_evaluations = ::Gapic::Config::Method.new list_conversation_model_evaluations_config + create_conversation_model_evaluation_config = parent_rpcs.create_conversation_model_evaluation if parent_rpcs.respond_to? :create_conversation_model_evaluation + @create_conversation_model_evaluation = ::Gapic::Config::Method.new create_conversation_model_evaluation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb new file mode 100644 index 000000000000..3a713822e9d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb @@ -0,0 +1,947 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module ConversationModels + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ConversationModels 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 ConversationModels 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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb new file mode 100644 index 000000000000..8fea35bb3655 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb @@ -0,0 +1,693 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_model_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationModels + module Rest + ## + # REST service stub for the ConversationModels 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_conversation_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_conversation_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_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: "create_conversation_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 get_conversation_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ConversationModel] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationModel] + # A result object deserialized from the server's reply + def get_conversation_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_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: "get_conversation_model", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ConversationModel.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_conversation_models REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListConversationModelsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse] + # A result object deserialized from the server's reply + def list_conversation_models request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_conversation_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_conversation_models", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse.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_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_conversation_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_conversation_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: "delete_conversation_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 deploy_conversation_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 deploy_conversation_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_deploy_conversation_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: "deploy_conversation_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 undeploy_conversation_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 undeploy_conversation_model request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_conversation_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: "undeploy_conversation_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 get_conversation_model_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ConversationModelEvaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] + # A result object deserialized from the server's reply + def get_conversation_model_evaluation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_model_evaluation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_model_evaluation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation.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_conversation_model_evaluations REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListConversationModelEvaluationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse] + # A result object deserialized from the server's reply + def list_conversation_model_evaluations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_conversation_model_evaluations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_conversation_model_evaluations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse.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_model_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_conversation_model_evaluation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_model_evaluation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_model_evaluation", + 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 create_conversation_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/conversationModels", + body: "conversation_model", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/conversationModels", + body: "conversation_model", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_conversation_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_conversation_models REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest] + # 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_conversation_models_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/conversationModels", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/conversationModels", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_conversation_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest] + # 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_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the deploy_conversation_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_deploy_conversation_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:deploy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:deploy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undeploy_conversation_model REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undeploy_conversation_model_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:undeploy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:undeploy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_conversation_model_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest] + # 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_model_evaluation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/conversationModels/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_conversation_model_evaluations REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest] + # 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_conversation_model_evaluations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/evaluations", + matches: [ + ["parent", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/evaluations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_conversation_model_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest] + # 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_model_evaluation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/evaluations", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb new file mode 100644 index 000000000000..83f9f95b1577 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/conversation.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/dialogflow/v2/conversation_profile_pb' +require 'google/cloud/dialogflow/v2/generator_pb' +require 'google/cloud/dialogflow/v2/participant_pb' +require 'google/cloud/dialogflow/v2/session_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/dialogflow/v2/conversation.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/dialogflow/v2/conversation_profile.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf4\x16\n\x0c\x43onversation\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12U\n\x0flifecycle_state\x18\x02 \x01(\x0e\x32\x37.google.cloud.dialogflow.v2.Conversation.LifecycleStateB\x03\xe0\x41\x03\x12S\n\x14\x63onversation_profile\x18\x03 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\x12N\n\x0cphone_number\x18\x04 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.ConversationPhoneNumberB\x03\xe0\x41\x03\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\x12[\n\x12\x63onversation_stage\x18\x07 \x01(\x0e\x32:.google.cloud.dialogflow.v2.Conversation.ConversationStageB\x03\xe0\x41\x01\x12h\n\x19telephony_connection_info\x18\n \x01(\x0b\x32@.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfoB\x03\xe0\x41\x03\x12]\n\x1cinitial_conversation_profile\x18\x0f \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x06\xe0\x41\x01\xe0\x41\x03\x12q\n\x1bingested_context_references\x18\x11 \x03(\x0b\x32G.google.cloud.dialogflow.v2.Conversation.IngestedContextReferencesEntryB\x03\xe0\x41\x03\x12o\n\x1ainitial_generator_contexts\x18\x12 \x03(\x0b\x32\x46.google.cloud.dialogflow.v2.Conversation.InitialGeneratorContextsEntryB\x03\xe0\x41\x03\x1a\x8e\x03\n\x17TelephonyConnectionInfo\x12\x1a\n\rdialed_number\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03sdp\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x64\n\x0bsip_headers\x18\x0c \x03(\x0b\x32J.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeaderB\x03\xe0\x41\x03\x12n\n\x13\x65xtra_mime_contents\x18\r \x03(\x0b\x32L.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContentB\x03\xe0\x41\x03\x1a\x32\n\tSipHeader\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a;\n\x0bMimeContent\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ontent\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01\x1a\xac\x05\n\x10\x43ontextReference\x12g\n\x10\x63ontext_contents\x18\x01 \x03(\x0b\x32H.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContentB\x03\xe0\x41\x02\x12^\n\x0bupdate_mode\x18\x02 \x01(\x0e\x32\x44.google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateModeB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\xb6\x02\n\x0e\x43ontextContent\x12\x14\n\x07\x63ontent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12s\n\x0e\x63ontent_format\x18\x02 \x01(\x0e\x32V.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormatB\x03\xe0\x41\x02\x12\x37\n\x0eingestion_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\ranswer_record\x18\x04 \x01(\t\"I\n\rContentFormat\x12\x1e\n\x1a\x43ONTENT_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04JSON\x10\x01\x12\x0e\n\nPLAIN_TEXT\x10\x02\"D\n\nUpdateMode\x12\x1b\n\x17UPDATE_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41PPEND\x10\x01\x12\r\n\tOVERWRITE\x10\x02\x1a\xa6\x02\n\x10GeneratorContext\x12\x64\n\x0egenerator_type\x18\x01 \x01(\x0e\x32G.google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorTypeB\x03\xe0\x41\x03\"\xab\x01\n\rGeneratorType\x12\x1e\n\x1aGENERATOR_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFREE_FORM\x10\x01\x12\x12\n\x0e\x41GENT_COACHING\x10\x02\x12\x11\n\rSUMMARIZATION\x10\x03\x12\x0f\n\x0bTRANSLATION\x10\x04\x12\x12\n\x0e\x41GENT_FEEDBACK\x10\x05\x12\x1f\n\x1b\x43USTOMER_MESSAGE_GENERATION\x10\x06\x1a{\n\x1eIngestedContextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\x1az\n\x1dInitialGeneratorContextsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.GeneratorContext:\x02\x38\x01\"Q\n\x0eLifecycleState\x12\x1f\n\x1bLIFECYCLE_STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tCOMPLETED\x10\x02\"h\n\x11\x43onversationStage\x12\"\n\x1e\x43ONVERSATION_STAGE_UNSPECIFIED\x10\x00\x12\x17\n\x13VIRTUAL_AGENT_STAGE\x10\x01\x12\x16\n\x12HUMAN_ASSIST_STAGE\x10\x02:\xc0\x01\xea\x41\xbc\x01\n&dialogflow.googleapis.com/Conversation\x12/projects/{project}/conversations/{conversation}\x12\x44projects/{project}/locations/{location}/conversations/{conversation}*\rconversations2\x0c\x63onversation\"\xbe\x01\n\x19\x43reateConversationRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/Conversation\x12\x43\n\x0c\x63onversation\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.v2.ConversationB\x03\xe0\x41\x02\x12\x1c\n\x0f\x63onversation_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x18ListConversationsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/Conversation\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\"u\n\x19ListConversationsResponse\x12?\n\rconversations\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.Conversation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x16GetConversationRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\"[\n\x1b\x43ompleteConversationRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\"\x96\x01\n\x13ListMessagesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Message\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\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\"f\n\x14ListMessagesResponse\x12\x35\n\x08messages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x17\x43onversationPhoneNumber\x12\x19\n\x0c\x63ountry_code\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x0cphone_number\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xcf\x02\n\x1eIngestContextReferencesRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12r\n\x12\x63ontext_references\x18\x02 \x03(\x0b\x32Q.google.cloud.dialogflow.v2.IngestContextReferencesRequest.ContextReferencesEntryB\x03\xe0\x41\x02\x1as\n\x16\x43ontextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\"\x9f\x02\n\x1fIngestContextReferencesResponse\x12\x7f\n\x1bingested_context_references\x18\x01 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.IngestContextReferencesResponse.IngestedContextReferencesEntry\x1a{\n\x1eIngestedContextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\"\x9c\x02\n!SuggestConversationSummaryRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12S\n\x13\x61ssist_query_params\x18\x05 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParametersB\x03\xe0\x41\x01\"\xaa\x05\n\"SuggestConversationSummaryResponse\x12W\n\x07summary\x18\x01 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x1a\xd4\x03\n\x07Summary\x12\x0c\n\x04text\x18\x01 \x01(\t\x12o\n\rtext_sections\x18\x04 \x03(\x0b\x32X.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.TextSectionsEntry\x12s\n\x14sorted_text_sections\x18\x06 \x03(\x0b\x32U.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x12\x1e\n\x16\x62\x61seline_model_version\x18\x05 \x01(\t\x1a<\n\x0eSummarySection\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07summary\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xdc\x03\n\x1fGenerateStatelessSummaryRequest\x12t\n\x16stateless_conversation\x18\x01 \x01(\x0b\x32O.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversationB\x03\xe0\x41\x02\x12R\n\x14\x63onversation_profile\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\x12\x41\n\x0elatest_message\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x1d\n\x10max_context_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x1a\x8c\x01\n\x13MinimalConversation\x12:\n\x08messages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.MessageB\x03\xe0\x41\x02\x12\x39\n\x06parent\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\"\xad\x03\n GenerateStatelessSummaryResponse\x12U\n\x07summary\x18\x01 \x01(\x0b\x32\x44.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x1a\xdb\x01\n\x07Summary\x12\x0c\n\x04text\x18\x01 \x01(\t\x12m\n\rtext_sections\x18\x02 \x03(\x0b\x32V.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary.TextSectionsEntry\x12\x1e\n\x16\x62\x61seline_model_version\x18\x04 \x01(\t\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf3\x04\n\"GenerateStatelessSuggestionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12:\n\tgenerator\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorH\x00\x12\x18\n\x0egenerator_name\x18\x03 \x01(\tH\x00\x12v\n\x12\x63ontext_references\x18\x04 \x03(\x0b\x32U.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.ContextReferencesEntryB\x03\xe0\x41\x01\x12R\n\x14\x63onversation_context\x18\x05 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationContextB\x03\xe0\x41\x01\x12\x45\n\x0etrigger_events\x18\x06 \x03(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x12\x1e\n\x11security_settings\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1as\n\x16\x43ontextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\x42\x14\n\x12generator_resource\"y\n#GenerateStatelessSuggestionResponse\x12R\n\x14generator_suggestion\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xe0\x41\x02\"\x9c\x12\n\x16SearchKnowledgeRequest\x12\x13\n\x06parent\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x05query\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputB\x03\xe0\x41\x02\x12S\n\x14\x63onversation_profile\x18\x02 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\x12\x17\n\nsession_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x0c\x63onversation\x18\x04 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x05 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12Y\n\x0cquery_source\x18\x07 \x01(\x0e\x32>.google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySourceB\x03\xe0\x41\x01\x12\x37\n\x11\x65nd_user_metadata\x18\t \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12[\n\rsearch_config\x18\x0b \x01(\x0b\x32?.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfigB\x03\xe0\x41\x01\x12\x19\n\x0c\x65xact_search\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x1a\xdb\x0c\n\x0cSearchConfig\x12\x64\n\x0b\x62oost_specs\x18\x01 \x03(\x0b\x32J.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecsB\x03\xe0\x41\x01\x12\x66\n\x0c\x66ilter_specs\x18\x02 \x03(\x0b\x32K.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecsB\x03\xe0\x41\x01\x1a\xbe\n\n\nBoostSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12g\n\x04spec\x18\x02 \x03(\x0b\x32T.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpecB\x03\xe0\x41\x01\x1a\xff\x08\n\tBoostSpec\x12\x8b\x01\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32g.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpecB\x03\xe0\x41\x01\x1a\xe3\x07\n\x12\x43onditionBoostSpec\x12\x16\n\tcondition\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x62oost\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x12\x99\x01\n\x12\x62oost_control_spec\x18\x04 \x01(\x0b\x32x.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpecB\x03\xe0\x41\x01\x1a\x84\x06\n\x10\x42oostControlSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\xa4\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32\x86\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeTypeB\x03\xe0\x41\x01\x12\xac\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32\x8a\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationTypeB\x03\xe0\x41\x01\x12\xa3\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32\x85\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.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\x1a<\n\x0b\x46ilterSpecs\x12\x18\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\"Q\n\x0bQuerySource\x12\x1c\n\x18QUERY_SOURCE_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x41GENT_QUERY\x10\x01\x12\x13\n\x0fSUGGESTED_QUERY\x10\x02\"\xa4\x04\n\x18SearchKnowledgeDebugInfo\x12V\n\x19\x64\x61tastore_response_reason\x18\x01 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\n\x19search_knowledge_behavior\x18\x02 \x01(\x0b\x32L.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior\x12l\n%ingested_context_reference_debug_info\x18\x03 \x01(\x0b\x32=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12\x43\n\x0fservice_latency\x18\x04 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ServiceLatency\x1a\x8b\x01\n\x17SearchKnowledgeBehavior\x12%\n\x1d\x61nswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\n\x1a\x65nd_user_metadata_included\x18\x02 \x01(\x08\x12%\n\x1dthird_party_connector_allowed\x18\x04 \x01(\x08\"\xd1\x01\n\x17SearchKnowledgeResponse\x12\x42\n\x07\x61nswers\x18\x02 \x03(\x0b\x32\x31.google.cloud.dialogflow.v2.SearchKnowledgeAnswer\x12\x17\n\x0frewritten_query\x18\x03 \x01(\t\x12Y\n\x1bsearch_knowledge_debug_info\x18\x04 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo\"\xe7\x03\n\x15SearchKnowledgeAnswer\x12\x0e\n\x06\x61nswer\x18\x01 \x01(\t\x12Q\n\x0b\x61nswer_type\x18\x02 \x01(\x0e\x32<.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType\x12V\n\x0e\x61nswer_sources\x18\x03 \x03(\x0b\x32>.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource\x12\x42\n\ranswer_record\x18\x05 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x1a\x66\n\x0c\x41nswerSource\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x0f\n\x07snippet\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\"g\n\nAnswerType\x12\x1b\n\x17\x41NSWER_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x46\x41Q\x10\x01\x12\x0e\n\nGENERATIVE\x10\x02\x12\n\n\x06INTENT\x10\x03\x12\x0c\n\x08PLAYBOOK\x10\x04\x12\t\n\x05\x45VENT\x10\x05\"\xec\x01\n\x1aGenerateSuggestionsRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x45\n\x0etrigger_events\x18\x03 \x03(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x32\xa6\x1a\n\rConversations\x12\x8c\x02\n\x12\x43reateConversation\x12\x35.google.cloud.dialogflow.v2.CreateConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"\x94\x01\xda\x41\x13parent,conversation\x82\xd3\xe4\x93\x02x\"%/v2/{parent=projects/*}/conversations:\x0c\x63onversationZA\"1/v2/{parent=projects/*/locations/*}/conversations:\x0c\x63onversation\x12\xed\x01\n\x11ListConversations\x12\x34.google.cloud.dialogflow.v2.ListConversationsRequest\x1a\x35.google.cloud.dialogflow.v2.ListConversationsResponse\"k\xda\x41\x06parent\x82\xd3\xe4\x93\x02\\\x12%/v2/{parent=projects/*}/conversationsZ3\x12\x31/v2/{parent=projects/*/locations/*}/conversations\x12\xda\x01\n\x0fGetConversation\x12\x32.google.cloud.dialogflow.v2.GetConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\\x12%/v2/{name=projects/*/conversations/*}Z3\x12\x31/v2/{name=projects/*/locations/*/conversations/*}\x12\xfd\x01\n\x14\x43ompleteConversation\x12\x37.google.cloud.dialogflow.v2.CompleteConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\"./v2/{name=projects/*/conversations/*}:complete:\x01*Z?\":/v2/{name=projects/*/locations/*/conversations/*}:complete:\x01*\x12\x92\x02\n\x17IngestContextReferences\x12:.google.cloud.dialogflow.v2.IngestContextReferencesRequest\x1a;.google.cloud.dialogflow.v2.IngestContextReferencesResponse\"~\xda\x41\x1f\x63onversation,context_references\x82\xd3\xe4\x93\x02V\"Q/v2/{conversation=projects/*/locations/*/conversations/*}:ingestContextReferences:\x01*\x12\xf5\x01\n\x0cListMessages\x12/.google.cloud.dialogflow.v2.ListMessagesRequest\x1a\x30.google.cloud.dialogflow.v2.ListMessagesResponse\"\x81\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02r\x12\x30/v2/{parent=projects/*/conversations/*}/messagesZ>\x12.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse\"\xd6\x01\xda\x41\x0c\x63onversation\x82\xd3\xe4\x93\x02\xc0\x01\"T/v2/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary:\x01*Ze\"`/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary:\x01*\x12\xdd\x02\n\x18GenerateStatelessSummary\x12;.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest\x1a<.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse\"\xc5\x01\x82\xd3\xe4\x93\x02\xbe\x01\"S/v2/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary:\x01*Zd\"_/v2/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary:\x01*\x12\xeb\x01\n\x1bGenerateStatelessSuggestion\x12>.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest\x1a?.google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse\"K\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate:\x01*\x12\xae\x03\n\x0fSearchKnowledge\x12\x32.google.cloud.dialogflow.v2.SearchKnowledgeRequest\x1a\x33.google.cloud.dialogflow.v2.SearchKnowledgeResponse\"\xb1\x02\x82\xd3\xe4\x93\x02\xaa\x02\"3/v2/{parent=projects/*}/suggestions:searchKnowledge:\x01*ZD\"?/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge:\x01*ZN\"I/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge:\x01*ZZ\"U/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge:\x01*\x12\xbb\x02\n\x13GenerateSuggestions\x12\x36.google.cloud.dialogflow.v2.GenerateSuggestionsRequest\x1a\x37.google.cloud.dialogflow.v2.GenerateSuggestionsResponse\"\xb2\x01\xda\x41\x0c\x63onversation\x82\xd3\xe4\x93\x02\x9c\x01\"B/v2/{conversation=projects/*/conversations/*}/suggestions:generate:\x01*ZS\"N/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:generate:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xbd\x03\n\x1e\x63om.google.cloud.dialogflow.v2B\x11\x43onversationProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\x12?projects/{project}/locations/{location}/dataStores/{data_store}\xea\x41Z\n\x17\x63\x65s.googleapis.com/Tool\x12?projects/{project}/locations/{location}/apps/{app}/tools/{tool}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + Conversation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation").msgclass + Conversation::TelephonyConnectionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo").msgclass + Conversation::TelephonyConnectionInfo::SipHeader = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader").msgclass + Conversation::TelephonyConnectionInfo::MimeContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent").msgclass + Conversation::ContextReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ContextReference").msgclass + Conversation::ContextReference::ContextContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent").msgclass + Conversation::ContextReference::ContextContent::ContentFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat").enummodule + Conversation::ContextReference::UpdateMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode").enummodule + Conversation::GeneratorContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.GeneratorContext").msgclass + Conversation::GeneratorContext::GeneratorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorType").enummodule + Conversation::LifecycleState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.LifecycleState").enummodule + Conversation::ConversationStage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ConversationStage").enummodule + CreateConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationRequest").msgclass + ListConversationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationsRequest").msgclass + ListConversationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationsResponse").msgclass + GetConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationRequest").msgclass + CompleteConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CompleteConversationRequest").msgclass + ListMessagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListMessagesRequest").msgclass + ListMessagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListMessagesResponse").msgclass + ConversationPhoneNumber = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationPhoneNumber").msgclass + IngestContextReferencesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestContextReferencesRequest").msgclass + IngestContextReferencesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestContextReferencesResponse").msgclass + SuggestConversationSummaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestConversationSummaryRequest").msgclass + SuggestConversationSummaryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestConversationSummaryResponse").msgclass + SuggestConversationSummaryResponse::Summary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary").msgclass + SuggestConversationSummaryResponse::Summary::SummarySection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection").msgclass + GenerateStatelessSummaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest").msgclass + GenerateStatelessSummaryRequest::MinimalConversation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation").msgclass + GenerateStatelessSummaryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse").msgclass + GenerateStatelessSummaryResponse::Summary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary").msgclass + GenerateStatelessSuggestionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest").msgclass + GenerateStatelessSuggestionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse").msgclass + SearchKnowledgeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest").msgclass + SearchKnowledgeRequest::SearchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig").msgclass + SearchKnowledgeRequest::SearchConfig::BoostSpecs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs").msgclass + SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec").msgclass + SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec").msgclass + SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec").msgclass + SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint").msgclass + SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType").enummodule + SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType").enummodule + SearchKnowledgeRequest::SearchConfig::FilterSpecs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs").msgclass + SearchKnowledgeRequest::QuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource").enummodule + SearchKnowledgeDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo").msgclass + SearchKnowledgeDebugInfo::SearchKnowledgeBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior").msgclass + SearchKnowledgeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeResponse").msgclass + SearchKnowledgeAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeAnswer").msgclass + SearchKnowledgeAnswer::AnswerSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource").msgclass + SearchKnowledgeAnswer::AnswerType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType").enummodule + GenerateSuggestionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateSuggestionsRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb new file mode 100644 index 000000000000..b77e7d6ecac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/conversation_profile.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/dialogflow/v2/audio_config_pb' +require 'google/cloud/dialogflow/v2/generator_pb' +require 'google/cloud/dialogflow/v2/participant_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n5google/cloud/dialogflow/v2/conversation_profile.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\n\n\x13\x43onversationProfile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x16\x61utomated_agent_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.AutomatedAgentConfig\x12[\n\x1chuman_agent_assistant_config\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.HumanAgentAssistantConfig\x12W\n\x1ahuman_agent_handoff_config\x18\x05 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.HumanAgentHandoffConfig\x12K\n\x13notification_config\x18\x06 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12\x41\n\x0elogging_config\x18\x07 \x01(\x0b\x32).google.cloud.dialogflow.v2.LoggingConfig\x12]\n%new_message_event_notification_config\x18\x08 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12g\n*new_recognition_result_notification_config\x18\x15 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfigB\x03\xe0\x41\x01\x12\x42\n\nstt_config\x18\t \x01(\x0b\x32..google.cloud.dialogflow.v2.SpeechToTextConfig\x12\x15\n\rlanguage_code\x18\n \x01(\t\x12>\n\nsip_config\x18\x10 \x01(\x0b\x32%.google.cloud.dialogflow.v2.SipConfigB\x03\xe0\x41\x01\x12\x11\n\ttime_zone\x18\x0e \x01(\t\x12L\n\x11security_settings\x18\r \x01(\tB1\xfa\x41.\n,dialogflow.googleapis.com/CXSecuritySettings\x12\x46\n\ntts_config\x18\x12 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig:\xc8\x01\xea\x41\xc4\x01\n-dialogflow.googleapis.com/ConversationProfile\x12>projects/{project}/conversationProfiles/{conversation_profile}\x12Sprojects/{project}/locations/{location}/conversationProfiles/{conversation_profile}\"\x8f\x01\n\x1fListConversationProfilesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationProfile\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8b\x01\n ListConversationProfilesResponse\x12N\n\x15\x63onversation_profiles\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfile\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"d\n\x1dGetConversationProfileRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\"\xbd\x01\n CreateConversationProfileRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationProfile\x12R\n\x14\x63onversation_profile\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\"\xac\x01\n UpdateConversationProfileRequest\x12R\n\x14\x63onversation_profile\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"g\n DeleteConversationProfileRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\"\x83\x01\n\x14\x41utomatedAgentConfig\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x33\n\x0bsession_ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xee\x1e\n\x19HumanAgentAssistantConfig\x12K\n\x13notification_config\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12m\n\x1dhuman_agent_suggestion_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12j\n\x1a\x65nd_user_suggestion_config\x18\x04 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12l\n\x17message_analysis_config\x18\x05 \x01(\x0b\x32K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig\x1aH\n\x19SuggestionTriggerSettings\x12\x14\n\x0cno_smalltalk\x18\x01 \x01(\x08\x12\x15\n\ronly_end_user\x18\x02 \x01(\x08\x1a\xf1\x07\n\x17SuggestionFeatureConfig\x12I\n\x12suggestion_feature\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SuggestionFeature\x12%\n\x1d\x65nable_event_based_suggestion\x18\x03 \x01(\x08\x12(\n\x1b\x64isable_agent_query_logging\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x12\x33\n&enable_query_suggestion_when_no_answer\x18\x0f \x01(\x08\x42\x03\xe0\x41\x01\x12\x30\n#enable_conversation_augmented_query\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_query_suggestion_only\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_response_debug_info\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x0crai_settings\x18\x13 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.RaiSettingsB\x03\xe0\x41\x01\x12O\n\x18suggestion_trigger_event\x18\x14 \x01(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x12)\n\x1c\x64isable_query_search_context\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12t\n\x1bsuggestion_trigger_settings\x18\n \x01(\x0b\x32O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings\x12\x61\n\x0cquery_config\x18\x06 \x01(\x0b\x32K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig\x12p\n\x19\x63onversation_model_config\x18\x07 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig\x12t\n\x1b\x63onversation_process_config\x18\x08 \x01(\x0b\x32O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig\x1a\x9d\x03\n\x10SuggestionConfig\x12\x66\n\x0f\x66\x65\x61ture_configs\x18\x02 \x03(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig\x12\"\n\x1agroup_suggestion_responses\x18\x03 \x01(\x08\x12?\n\ngenerators\x18\x04 \x03(\tB+\xe0\x41\x01\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\x38\n+disable_high_latency_features_sync_delivery\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12.\n!skip_empty_event_based_suggestion\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12-\n use_unredacted_conversation_data\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12#\n\x16\x65nable_async_tool_call\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x1a\x99\r\n\x15SuggestionQueryConfig\x12\x8b\x01\n\x1bknowledge_base_query_source\x18\x01 \x01(\x0b\x32\x64.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySourceH\x00\x12\x80\x01\n\x15\x64ocument_query_source\x18\x02 \x01(\x0b\x32_.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySourceH\x00\x12\x84\x01\n\x17\x64ialogflow_query_source\x18\x03 \x01(\x0b\x32\x61.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySourceH\x00\x12\x13\n\x0bmax_results\x18\x04 \x01(\x05\x12\x1c\n\x14\x63onfidence_threshold\x18\x05 \x01(\x02\x12\x82\x01\n\x17\x63ontext_filter_settings\x18\x07 \x01(\x0b\x32\x61.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings\x12k\n\x08sections\x18\x08 \x01(\x0b\x32T.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.SectionsB\x03\xe0\x41\x01\x12\x19\n\x0c\x63ontext_size\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x1a\x64\n\x18KnowledgeBaseQuerySource\x12H\n\x0fknowledge_bases\x18\x01 \x03(\tB/\xe0\x41\x02\xfa\x41)\n\'dialogflow.googleapis.com/KnowledgeBase\x1aT\n\x13\x44ocumentQuerySource\x12=\n\tdocuments\x18\x01 \x03(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\x1a\xbe\x02\n\x15\x44ialogflowQuerySource\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x9c\x01\n\x17human_agent_side_config\x18\x03 \x01(\x0b\x32v.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfigB\x03\xe0\x41\x01\x1aN\n\x14HumanAgentSideConfig\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x01\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x1av\n\x15\x43ontextFilterSettings\x12\x1d\n\x15\x64rop_handoff_messages\x18\x01 \x01(\x08\x12#\n\x1b\x64rop_virtual_agent_messages\x18\x02 \x01(\x08\x12\x19\n\x11\x64rop_ivr_messages\x18\x03 \x01(\x08\x1a\xa2\x02\n\x08Sections\x12w\n\rsection_types\x18\x01 \x03(\x0e\x32`.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType\"\x9c\x01\n\x0bSectionType\x12\x1c\n\x18SECTION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSITUATION\x10\x01\x12\n\n\x06\x41\x43TION\x10\x02\x12\x0e\n\nRESOLUTION\x10\x03\x12\x1b\n\x17REASON_FOR_CANCELLATION\x10\x04\x12\x19\n\x15\x43USTOMER_SATISFACTION\x10\x05\x12\x0c\n\x08\x45NTITIES\x10\x06\x42\x0e\n\x0cquery_source\x1az\n\x17\x43onversationModelConfig\x12?\n\x05model\x18\x01 \x01(\tB0\xfa\x41-\n+dialogflow.googleapis.com/ConversationModel\x12\x1e\n\x16\x62\x61seline_model_version\x18\x08 \x01(\t\x1a;\n\x19\x43onversationProcessConfig\x12\x1e\n\x16recent_sentences_count\x18\x02 \x01(\x05\x1a\x87\x01\n\x15MessageAnalysisConfig\x12 \n\x18\x65nable_entity_extraction\x18\x02 \x01(\x08\x12!\n\x19\x65nable_sentiment_analysis\x18\x03 \x01(\x08\x12)\n\x1c\x65nable_sentiment_analysis_v3\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xc4\x03\n\x17HumanAgentHandoffConfig\x12\x62\n\x12live_person_config\x18\x01 \x01(\x0b\x32\x44.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfigH\x00\x12u\n\x1csalesforce_live_agent_config\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfigH\x00\x1a/\n\x10LivePersonConfig\x12\x1b\n\x0e\x61\x63\x63ount_number\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\x8b\x01\n\x19SalesforceLiveAgentConfig\x12\x1c\n\x0forganization_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rdeployment_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tbutton_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x65ndpoint_domain\x18\x04 \x01(\tB\x03\xe0\x41\x02\x42\x0f\n\ragent_service\"\xbf\x01\n\x12NotificationConfig\x12\r\n\x05topic\x18\x01 \x01(\t\x12T\n\x0emessage_format\x18\x02 \x01(\x0e\x32<.google.cloud.dialogflow.v2.NotificationConfig.MessageFormat\"D\n\rMessageFormat\x12\x1e\n\x1aMESSAGE_FORMAT_UNSPECIFIED\x10\x00\x12\t\n\x05PROTO\x10\x01\x12\x08\n\x04JSON\x10\x02\"3\n\rLoggingConfig\x12\"\n\x1a\x65nable_stackdriver_logging\x18\x03 \x01(\x08\"\xa8\x02\n\tSipConfig\x12&\n\x1e\x63reate_conversation_on_the_fly\x18\x01 \x01(\x08\x12\x16\n\x0einactive_start\x18\x03 \x01(\x08\x12?\n\x1cmax_audio_recording_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\'\n\x1f\x61llow_virtual_agent_interaction\x18\x05 \x01(\x08\x12!\n\x19keep_conversation_running\x18\x06 \x01(\x08\x12%\n\x1d\x63opy_inbound_call_leg_headers\x18\x08 \x03(\t\x12\'\n\x1fignore_reinvite_media_direction\x18\t \x01(\x08\"\xf2\x01\n\x11SuggestionFeature\x12@\n\x04type\x18\x01 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.Type\"\x9a\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41RTICLE_SUGGESTION\x10\x01\x12\x07\n\x03\x46\x41Q\x10\x02\x12\x0f\n\x0bSMART_REPLY\x10\x03\x12\x1e\n\x1a\x43ONVERSATION_SUMMARIZATION\x10\x08\x12\x14\n\x10KNOWLEDGE_SEARCH\x10\x0e\x12\x14\n\x10KNOWLEDGE_ASSIST\x10\x0f\"\x8a\x02\n!SetSuggestionFeatureConfigRequest\x12!\n\x14\x63onversation_profile\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12u\n\x19suggestion_feature_config\x18\x03 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfigB\x03\xe0\x41\x02\"\xef\x01\n#ClearSuggestionFeatureConfigRequest\x12!\n\x14\x63onversation_profile\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\"\xa3\x02\n+SetSuggestionFeatureConfigOperationMetadata\x12\x1c\n\x14\x63onversation_profile\x18\x01 \x01(\t\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa5\x02\n-ClearSuggestionFeatureConfigOperationMetadata\x12\x1c\n\x14\x63onversation_profile\x18\x01 \x01(\t\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xb3\x14\n\x14\x43onversationProfiles\x12\x90\x02\n\x18ListConversationProfiles\x12;.google.cloud.dialogflow.v2.ListConversationProfilesRequest\x1a<.google.cloud.dialogflow.v2.ListConversationProfilesResponse\"y\xda\x41\x06parent\x82\xd3\xe4\x93\x02j\x12,/v2/{parent=projects/*}/conversationProfilesZ:\x12\x38/v2/{parent=projects/*/locations/*}/conversationProfiles\x12\xfd\x01\n\x16GetConversationProfile\x12\x39.google.cloud.dialogflow.v2.GetConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j\x12,/v2/{name=projects/*/conversationProfiles/*}Z:\x12\x38/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xc8\x02\n\x19\x43reateConversationProfile\x12<.google.cloud.dialogflow.v2.CreateConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"\xbb\x01\xda\x41\x1bparent,conversation_profile\x82\xd3\xe4\x93\x02\x96\x01\",/v2/{parent=projects/*}/conversationProfiles:\x14\x63onversation_profileZP\"8/v2/{parent=projects/*/locations/*}/conversationProfiles:\x14\x63onversation_profile\x12\xf7\x02\n\x19UpdateConversationProfile\x12<.google.cloud.dialogflow.v2.UpdateConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"\xea\x01\xda\x41 conversation_profile,update_mask\x82\xd3\xe4\x93\x02\xc0\x01\x32\x41/v2/{conversation_profile.name=projects/*/conversationProfiles/*}:\x14\x63onversation_profileZe2M/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}:\x14\x63onversation_profile\x12\xea\x01\n\x19\x44\x65leteConversationProfile\x12<.google.cloud.dialogflow.v2.DeleteConversationProfileRequest\x1a\x16.google.protobuf.Empty\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j*,/v2/{name=projects/*/conversationProfiles/*}Z:*8/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xe8\x03\n\x1aSetSuggestionFeatureConfig\x12=.google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x02\xca\x41\x42\n\x13\x43onversationProfile\x12+SetSuggestionFeatureConfigOperationMetadata\xda\x41\x14\x63onversation_profile\xda\x41?conversation_profile,participant_role,suggestion_feature_config\x82\xd3\xe4\x93\x02\xc6\x01\"W/v2/{conversation_profile=projects/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*Zh\"c/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*\x12\xf0\x03\n\x1c\x43learSuggestionFeatureConfig\x12?.google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest\x1a\x1d.google.longrunning.Operation\"\xef\x02\xca\x41\x44\n\x13\x43onversationProfile\x12-ClearSuggestionFeatureConfigOperationMetadata\xda\x41\x14\x63onversation_profile\xda\x41=conversation_profile,participant_role,suggestion_feature_type\x82\xd3\xe4\x93\x02\xca\x01\"Y/v2/{conversation_profile=projects/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*Zj\"e/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9d\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x18\x43onversationProfileProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41|\n,dialogflow.googleapis.com/CXSecuritySettings\x12Lprojects/{project}/locations/{location}/securitySettings/{security_settings}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + ConversationProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationProfile").msgclass + ListConversationProfilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationProfilesRequest").msgclass + ListConversationProfilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationProfilesResponse").msgclass + GetConversationProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationProfileRequest").msgclass + CreateConversationProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationProfileRequest").msgclass + UpdateConversationProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateConversationProfileRequest").msgclass + DeleteConversationProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationProfileRequest").msgclass + AutomatedAgentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AutomatedAgentConfig").msgclass + HumanAgentAssistantConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig").msgclass + HumanAgentAssistantConfig::SuggestionTriggerSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings").msgclass + HumanAgentAssistantConfig::SuggestionFeatureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig").msgclass + HumanAgentAssistantConfig::SuggestionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig").msgclass + HumanAgentAssistantConfig::SuggestionQueryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig").msgclass + HumanAgentAssistantConfig::SuggestionQueryConfig::KnowledgeBaseQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource").msgclass + HumanAgentAssistantConfig::SuggestionQueryConfig::DocumentQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource").msgclass + HumanAgentAssistantConfig::SuggestionQueryConfig::DialogflowQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource").msgclass + HumanAgentAssistantConfig::SuggestionQueryConfig::DialogflowQuerySource::HumanAgentSideConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig").msgclass + HumanAgentAssistantConfig::SuggestionQueryConfig::ContextFilterSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings").msgclass + HumanAgentAssistantConfig::SuggestionQueryConfig::Sections = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections").msgclass + HumanAgentAssistantConfig::SuggestionQueryConfig::Sections::SectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType").enummodule + HumanAgentAssistantConfig::ConversationModelConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig").msgclass + HumanAgentAssistantConfig::ConversationProcessConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig").msgclass + HumanAgentAssistantConfig::MessageAnalysisConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig").msgclass + HumanAgentHandoffConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentHandoffConfig").msgclass + HumanAgentHandoffConfig::LivePersonConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig").msgclass + HumanAgentHandoffConfig::SalesforceLiveAgentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig").msgclass + NotificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.NotificationConfig").msgclass + NotificationConfig::MessageFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.NotificationConfig.MessageFormat").enummodule + LoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.LoggingConfig").msgclass + SipConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SipConfig").msgclass + SuggestionFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionFeature").msgclass + SuggestionFeature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionFeature.Type").enummodule + SetSuggestionFeatureConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest").msgclass + ClearSuggestionFeatureConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest").msgclass + SetSuggestionFeatureConfigOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata").msgclass + ClearSuggestionFeatureConfigOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb new file mode 100644 index 000000000000..96eeda3402a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb @@ -0,0 +1,99 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/conversation_profile.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/conversation_profile_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationProfiles + # Service for managing + # [ConversationProfiles][google.cloud.dialogflow.v2.ConversationProfile]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.ConversationProfiles' + + # Returns the list of all conversation profiles in the specified project. + rpc :ListConversationProfiles, ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest, ::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse + # Retrieves the specified conversation profile. + rpc :GetConversationProfile, ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest, ::Google::Cloud::Dialogflow::V2::ConversationProfile + # Creates a conversation profile in the specified project. + # + # [ConversationProfile.create_time][google.cloud.dialogflow.v2.ConversationProfile.create_time] + # and + # [ConversationProfile.update_time][google.cloud.dialogflow.v2.ConversationProfile.update_time] + # aren't populated in the response. You can retrieve them via + # [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + # API. + rpc :CreateConversationProfile, ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest, ::Google::Cloud::Dialogflow::V2::ConversationProfile + # Updates the specified conversation profile. + # + # [ConversationProfile.create_time][google.cloud.dialogflow.v2.ConversationProfile.create_time] + # and + # [ConversationProfile.update_time][google.cloud.dialogflow.v2.ConversationProfile.update_time] + # aren't populated in the response. You can retrieve them via + # [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] + # API. + rpc :UpdateConversationProfile, ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest, ::Google::Cloud::Dialogflow::V2::ConversationProfile + # Deletes the specified conversation profile. + rpc :DeleteConversationProfile, ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest, ::Google::Protobuf::Empty + # Adds or updates a suggestion feature in a conversation profile. + # If the conversation profile contains the type of suggestion feature for + # the participant role, it will update it. Otherwise it will insert the + # suggestion feature. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] + # - `response`: + # [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + # + # If a long running operation to add or update suggestion feature + # config for the same conversation profile, participant role and suggestion + # feature type exists, please cancel the existing long running operation + # before sending such request, otherwise the request will be rejected. + rpc :SetSuggestionFeatureConfig, ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest, ::Google::Longrunning::Operation + # Clears a suggestion feature from a conversation profile for the given + # participant role. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] + # - `response`: + # [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + rpc :ClearSuggestionFeatureConfig, ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles.rb new file mode 100644 index 000000000000..d5fa39f75883 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/conversation_profiles/credentials" +require "google/cloud/dialogflow/v2/conversation_profiles/paths" +require "google/cloud/dialogflow/v2/conversation_profiles/operations" +require "google/cloud/dialogflow/v2/conversation_profiles/client" +require "google/cloud/dialogflow/v2/conversation_profiles/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfiles}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/conversation_profiles" + # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/conversation_profiles/rest" + # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + module ConversationProfiles + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversation_profiles", "helpers.rb" +require "google/cloud/dialogflow/v2/conversation_profiles/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb new file mode 100644 index 000000000000..a4ac55877982 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb @@ -0,0 +1,1158 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_profile_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationProfiles + ## + # Client for the ConversationProfiles service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfiles}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversation_profiles_stub + + ## + # Configure the ConversationProfiles Client class. + # + # See {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationProfiles clients + # ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::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 + @conversation_profiles_stub.universe_domain + end + + ## + # Create a new ConversationProfiles client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationProfiles 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/dialogflow/v2/conversation_profile_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 + + @conversation_profiles_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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 + ) + + @conversation_profiles_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 = @conversation_profiles_stub.endpoint + config.universe_domain = @conversation_profiles_stub.universe_domain + config.logger = @conversation_profiles_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfiles::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 + @conversation_profiles_stub.logger + end + + # Service calls + + ## + # Returns the list of all conversation profiles in the specified project. + # + # @overload list_conversation_profiles(request, options = nil) + # Pass arguments to `list_conversation_profiles` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_profiles(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_conversation_profiles` via keyword arguments. Note that at + # least one keyword argument is 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 project to list all conversation profiles from. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new + # + # # Call the list_conversation_profiles method. + # result = client.list_conversation_profiles 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::Dialogflow::V2::ConversationProfile. + # p item + # end + # + def list_conversation_profiles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest + + # Converts hash and nil to 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_conversation_profiles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_conversation_profiles.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_conversation_profiles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.call_rpc :list_conversation_profiles, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @conversation_profiles_stub, :list_conversation_profiles, 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 + + ## + # Retrieves the specified conversation profile. + # + # @overload get_conversation_profile(request, options = nil) + # Pass arguments to `get_conversation_profile` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_profile(name: nil) + # Pass arguments to `get_conversation_profile` via keyword arguments. Note that at + # least one keyword argument is required. To 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 profile. + # Format: `projects//locations//conversationProfiles/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new + # + # # Call the get_conversation_profile method. + # result = client.get_conversation_profile request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + # p result + # + def get_conversation_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest + + # Converts hash and nil to 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_profile.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_conversation_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.call_rpc :get_conversation_profile, 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 profile in the specified project. + # + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#create_time ConversationProfile.create_time} + # and + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#update_time ConversationProfile.update_time} + # aren't populated in the response. You can retrieve them via + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile GetConversationProfile} + # API. + # + # @overload create_conversation_profile(request, options = nil) + # Pass arguments to `create_conversation_profile` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_profile(parent: nil, conversation_profile: nil) + # Pass arguments to `create_conversation_profile` via keyword arguments. Note that at + # least one keyword argument is 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 project to create a conversation profile for. + # Format: `projects//locations/`. + # @param conversation_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] + # Required. The conversation profile to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new + # + # # Call the create_conversation_profile method. + # result = client.create_conversation_profile request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + # p result + # + def create_conversation_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest + + # Converts hash and nil to 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_profile.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_conversation_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.call_rpc :create_conversation_profile, 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 the specified conversation profile. + # + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#create_time ConversationProfile.create_time} + # and + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#update_time ConversationProfile.update_time} + # aren't populated in the response. You can retrieve them via + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile GetConversationProfile} + # API. + # + # @overload update_conversation_profile(request, options = nil) + # Pass arguments to `update_conversation_profile` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_profile(conversation_profile: nil, update_mask: nil) + # Pass arguments to `update_conversation_profile` via keyword arguments. Note that at + # least one keyword argument is 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_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] + # Required. The conversation profile to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new + # + # # Call the update_conversation_profile method. + # result = client.update_conversation_profile request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + # p result + # + def update_conversation_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest + + # Converts hash and nil to 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_profile&.name + header_params["conversation_profile.name"] = request.conversation_profile.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_profile.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_conversation_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.call_rpc :update_conversation_profile, 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 specified conversation profile. + # + # @overload delete_conversation_profile(request, options = nil) + # Pass arguments to `delete_conversation_profile` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_profile(name: nil) + # Pass arguments to `delete_conversation_profile` via keyword arguments. Note that at + # least one keyword argument is required. To 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 conversation profile to delete. + # Format: `projects//locations//conversationProfiles/`. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new + # + # # Call the delete_conversation_profile method. + # result = client.delete_conversation_profile request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_conversation_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest + + # Converts hash and nil to 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_profile.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_conversation_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.call_rpc :delete_conversation_profile, 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 + + ## + # Adds or updates a suggestion feature in a conversation profile. + # If the conversation profile contains the type of suggestion feature for + # the participant role, it will update it. Otherwise it will insert the + # suggestion feature. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigOperationMetadata SetSuggestionFeatureConfigOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} + # + # If a long running operation to add or update suggestion feature + # config for the same conversation profile, participant role and suggestion + # feature type exists, please cancel the existing long running operation + # before sending such request, otherwise the request will be rejected. + # + # @overload set_suggestion_feature_config(request, options = nil) + # Pass arguments to `set_suggestion_feature_config` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_config: nil) + # Pass arguments to `set_suggestion_feature_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 conversation_profile [::String] + # Required. The Conversation Profile to add or update the suggestion feature + # config. Format: `projects//locations//conversationProfiles/`. + # @param participant_role [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Required. The participant role to add or update the suggestion feature + # config. Only HUMAN_AGENT or END_USER can be used. + # @param suggestion_feature_config [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig, ::Hash] + # Required. The suggestion feature config to add or update. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new + # + # # Call the set_suggestion_feature_config method. + # result = client.set_suggestion_feature_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 set_suggestion_feature_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_suggestion_feature_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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_profile + header_params["conversation_profile"] = request.conversation_profile + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_suggestion_feature_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_suggestion_feature_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.call_rpc :set_suggestion_feature_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 + + ## + # Clears a suggestion feature from a conversation profile for the given + # participant role. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigOperationMetadata ClearSuggestionFeatureConfigOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} + # + # @overload clear_suggestion_feature_config(request, options = nil) + # Pass arguments to `clear_suggestion_feature_config` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload clear_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_type: nil) + # Pass arguments to `clear_suggestion_feature_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 conversation_profile [::String] + # Required. The Conversation Profile to add or update the suggestion feature + # config. Format: `projects//locations//conversationProfiles/`. + # @param participant_role [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Required. The participant role to remove the suggestion feature + # config. Only HUMAN_AGENT or END_USER can be used. + # @param suggestion_feature_type [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] + # Required. The type of the suggestion feature to remove. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new + # + # # Call the clear_suggestion_feature_config method. + # result = client.clear_suggestion_feature_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 clear_suggestion_feature_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.clear_suggestion_feature_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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_profile + header_params["conversation_profile"] = request.conversation_profile + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.clear_suggestion_feature_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.clear_suggestion_feature_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.call_rpc :clear_suggestion_feature_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 ConversationProfiles API. + # + # This class represents the configuration for ConversationProfiles, + # 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::Dialogflow::V2::ConversationProfiles::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_conversation_profiles to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_conversation_profiles.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_conversation_profiles.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::Dialogflow::V2::ConversationProfiles::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 ConversationProfiles 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_conversation_profiles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversation_profiles + ## + # RPC-specific configuration for `get_conversation_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation_profile + ## + # RPC-specific configuration for `create_conversation_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation_profile + ## + # RPC-specific configuration for `update_conversation_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :update_conversation_profile + ## + # RPC-specific configuration for `delete_conversation_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_conversation_profile + ## + # RPC-specific configuration for `set_suggestion_feature_config` + # @return [::Gapic::Config::Method] + # + attr_reader :set_suggestion_feature_config + ## + # RPC-specific configuration for `clear_suggestion_feature_config` + # @return [::Gapic::Config::Method] + # + attr_reader :clear_suggestion_feature_config + + # @private + def initialize parent_rpcs = nil + list_conversation_profiles_config = parent_rpcs.list_conversation_profiles if parent_rpcs.respond_to? :list_conversation_profiles + @list_conversation_profiles = ::Gapic::Config::Method.new list_conversation_profiles_config + get_conversation_profile_config = parent_rpcs.get_conversation_profile if parent_rpcs.respond_to? :get_conversation_profile + @get_conversation_profile = ::Gapic::Config::Method.new get_conversation_profile_config + create_conversation_profile_config = parent_rpcs.create_conversation_profile if parent_rpcs.respond_to? :create_conversation_profile + @create_conversation_profile = ::Gapic::Config::Method.new create_conversation_profile_config + update_conversation_profile_config = parent_rpcs.update_conversation_profile if parent_rpcs.respond_to? :update_conversation_profile + @update_conversation_profile = ::Gapic::Config::Method.new update_conversation_profile_config + delete_conversation_profile_config = parent_rpcs.delete_conversation_profile if parent_rpcs.respond_to? :delete_conversation_profile + @delete_conversation_profile = ::Gapic::Config::Method.new delete_conversation_profile_config + set_suggestion_feature_config_config = parent_rpcs.set_suggestion_feature_config if parent_rpcs.respond_to? :set_suggestion_feature_config + @set_suggestion_feature_config = ::Gapic::Config::Method.new set_suggestion_feature_config_config + clear_suggestion_feature_config_config = parent_rpcs.clear_suggestion_feature_config if parent_rpcs.respond_to? :clear_suggestion_feature_config + @clear_suggestion_feature_config = ::Gapic::Config::Method.new clear_suggestion_feature_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb new file mode 100644 index 000000000000..94054753a29a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationProfiles + # Credentials for the ConversationProfiles API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb new file mode 100644 index 000000000000..2f1dfece87b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module ConversationProfiles + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ConversationProfiles 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 ConversationProfiles 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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb new file mode 100644 index 000000000000..543a40c5b1cd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb @@ -0,0 +1,325 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module ConversationProfiles + # Path helper methods for the ConversationProfiles API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # @overload agent_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/agent` + # + # @param project [String] + # + # @overload agent_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def agent_path **args + resources = { + "project" => (proc do |project:| + "projects/#{project}/agent" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent" + 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 CXSecuritySettings resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/securitySettings/{security_settings}` + # + # @param project [String] + # @param location [String] + # @param security_settings [String] + # + # @return [::String] + def cx_security_settings_path project:, location:, security_settings: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/securitySettings/#{security_settings}" + end + + ## + # Create a fully-qualified ConversationModel resource string. + # + # @overload conversation_model_path(project:, location:, conversation_model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversationModels/{conversation_model}` + # + # @param project [String] + # @param location [String] + # @param conversation_model [String] + # + # @overload conversation_model_path(project:, conversation_model:) + # The resource will be in the following format: + # + # `projects/{project}/conversationModels/{conversation_model}` + # + # @param project [String] + # @param conversation_model [String] + # + # @return [::String] + def conversation_model_path **args + resources = { + "conversation_model:location:project" => (proc do |project:, location:, conversation_model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}" + end), + "conversation_model:project" => (proc do |project:, conversation_model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/conversationModels/#{conversation_model}" + 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 ConversationProfile resource string. + # + # @overload conversation_profile_path(project:, conversation_profile:) + # The resource will be in the following format: + # + # `projects/{project}/conversationProfiles/{conversation_profile}` + # + # @param project [String] + # @param conversation_profile [String] + # + # @overload conversation_profile_path(project:, location:, conversation_profile:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}` + # + # @param project [String] + # @param location [String] + # @param conversation_profile [String] + # + # @return [::String] + def conversation_profile_path **args + resources = { + "conversation_profile:project" => (proc do |project:, conversation_profile:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/conversationProfiles/#{conversation_profile}" + end), + "conversation_profile:location:project" => (proc do |project:, location:, conversation_profile:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversationProfiles/#{conversation_profile}" + 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:, knowledge_base:, document:) + # The resource will be in the following format: + # + # `projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}` + # + # @param project [String] + # @param knowledge_base [String] + # @param document [String] + # + # @overload document_path(project:, location:, knowledge_base:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param knowledge_base [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" + + "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}" + end), + "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" + + "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/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 Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/generators/#{generator}" + end + + ## + # Create a fully-qualified KnowledgeBase resource string. + # + # @overload knowledge_base_path(project:, knowledge_base:) + # The resource will be in the following format: + # + # `projects/{project}/knowledgeBases/{knowledge_base}` + # + # @param project [String] + # @param knowledge_base [String] + # + # @overload knowledge_base_path(project:, location:, knowledge_base:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}` + # + # @param project [String] + # @param location [String] + # @param knowledge_base [String] + # + # @return [::String] + def knowledge_base_path **args + resources = { + "knowledge_base:project" => (proc do |project:, knowledge_base:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/knowledgeBases/#{knowledge_base}" + end), + "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}" + 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 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 PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + ## + # 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest.rb new file mode 100644 index 000000000000..af2abdf0a9a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/conversation_profiles/credentials" +require "google/cloud/dialogflow/v2/conversation_profiles/paths" +require "google/cloud/dialogflow/v2/conversation_profiles/rest/operations" +require "google/cloud/dialogflow/v2/conversation_profiles/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfiles}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/conversation_profiles/rest" + # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + module ConversationProfiles + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/conversation_profiles/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb new file mode 100644 index 000000000000..7beb6950af46 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb @@ -0,0 +1,1074 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_profile_pb" +require "google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationProfiles + module Rest + ## + # REST client for the ConversationProfiles service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfiles}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversation_profiles_stub + + ## + # Configure the ConversationProfiles Client class. + # + # See {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ConversationProfiles clients + # ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::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 + @conversation_profiles_stub.universe_domain + end + + ## + # Create a new ConversationProfiles REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::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 + + @conversation_profiles_stub = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @conversation_profiles_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 = @conversation_profiles_stub.endpoint + config.universe_domain = @conversation_profiles_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @conversation_profiles_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfiles::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 + @conversation_profiles_stub.logger + end + + # Service calls + + ## + # Returns the list of all conversation profiles in the specified project. + # + # @overload list_conversation_profiles(request, options = nil) + # Pass arguments to `list_conversation_profiles` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation_profiles(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_conversation_profiles` via keyword arguments. Note that at + # least one keyword argument is 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 project to list all conversation profiles from. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new + # + # # Call the list_conversation_profiles method. + # result = client.list_conversation_profiles 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::Dialogflow::V2::ConversationProfile. + # p item + # end + # + def list_conversation_profiles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest + + # Converts hash and nil to an 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_conversation_profiles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_conversation_profiles.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_conversation_profiles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.list_conversation_profiles request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @conversation_profiles_stub, :list_conversation_profiles, "conversation_profiles", 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 + + ## + # Retrieves the specified conversation profile. + # + # @overload get_conversation_profile(request, options = nil) + # Pass arguments to `get_conversation_profile` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_profile(name: nil) + # Pass arguments to `get_conversation_profile` via keyword arguments. Note that at + # least one keyword argument is required. To 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 profile. + # Format: `projects//locations//conversationProfiles/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new + # + # # Call the get_conversation_profile method. + # result = client.get_conversation_profile request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + # p result + # + def get_conversation_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest + + # Converts hash and nil to an 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_conversation_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.get_conversation_profile 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 profile in the specified project. + # + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#create_time ConversationProfile.create_time} + # and + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#update_time ConversationProfile.update_time} + # aren't populated in the response. You can retrieve them via + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client#get_conversation_profile GetConversationProfile} + # API. + # + # @overload create_conversation_profile(request, options = nil) + # Pass arguments to `create_conversation_profile` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_profile(parent: nil, conversation_profile: nil) + # Pass arguments to `create_conversation_profile` via keyword arguments. Note that at + # least one keyword argument is 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 project to create a conversation profile for. + # Format: `projects//locations/`. + # @param conversation_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] + # Required. The conversation profile to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new + # + # # Call the create_conversation_profile method. + # result = client.create_conversation_profile request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + # p result + # + def create_conversation_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest + + # Converts hash and nil to an 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_conversation_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.create_conversation_profile 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 the specified conversation profile. + # + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#create_time ConversationProfile.create_time} + # and + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#update_time ConversationProfile.update_time} + # aren't populated in the response. You can retrieve them via + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client#get_conversation_profile GetConversationProfile} + # API. + # + # @overload update_conversation_profile(request, options = nil) + # Pass arguments to `update_conversation_profile` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_profile(conversation_profile: nil, update_mask: nil) + # Pass arguments to `update_conversation_profile` via keyword arguments. Note that at + # least one keyword argument is 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_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] + # Required. The conversation profile to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new + # + # # Call the update_conversation_profile method. + # result = client.update_conversation_profile request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + # p result + # + def update_conversation_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest + + # Converts hash and nil to an 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_conversation_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.update_conversation_profile 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 specified conversation profile. + # + # @overload delete_conversation_profile(request, options = nil) + # Pass arguments to `delete_conversation_profile` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_profile(name: nil) + # Pass arguments to `delete_conversation_profile` via keyword arguments. Note that at + # least one keyword argument is required. To 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 conversation profile to delete. + # Format: `projects//locations//conversationProfiles/`. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new + # + # # Call the delete_conversation_profile method. + # result = client.delete_conversation_profile request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_conversation_profile request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest + + # Converts hash and nil to an 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_profile.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_conversation_profile.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.delete_conversation_profile 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 + + ## + # Adds or updates a suggestion feature in a conversation profile. + # If the conversation profile contains the type of suggestion feature for + # the participant role, it will update it. Otherwise it will insert the + # suggestion feature. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigOperationMetadata SetSuggestionFeatureConfigOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} + # + # If a long running operation to add or update suggestion feature + # config for the same conversation profile, participant role and suggestion + # feature type exists, please cancel the existing long running operation + # before sending such request, otherwise the request will be rejected. + # + # @overload set_suggestion_feature_config(request, options = nil) + # Pass arguments to `set_suggestion_feature_config` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_config: nil) + # Pass arguments to `set_suggestion_feature_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 conversation_profile [::String] + # Required. The Conversation Profile to add or update the suggestion feature + # config. Format: `projects//locations//conversationProfiles/`. + # @param participant_role [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Required. The participant role to add or update the suggestion feature + # config. Only HUMAN_AGENT or END_USER can be used. + # @param suggestion_feature_config [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig, ::Hash] + # Required. The suggestion feature config to add or update. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new + # + # # Call the set_suggestion_feature_config method. + # result = client.set_suggestion_feature_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 set_suggestion_feature_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_suggestion_feature_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_suggestion_feature_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_suggestion_feature_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.set_suggestion_feature_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 + + ## + # Clears a suggestion feature from a conversation profile for the given + # participant role. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigOperationMetadata ClearSuggestionFeatureConfigOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} + # + # @overload clear_suggestion_feature_config(request, options = nil) + # Pass arguments to `clear_suggestion_feature_config` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload clear_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_type: nil) + # Pass arguments to `clear_suggestion_feature_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 conversation_profile [::String] + # Required. The Conversation Profile to add or update the suggestion feature + # config. Format: `projects//locations//conversationProfiles/`. + # @param participant_role [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Required. The participant role to remove the suggestion feature + # config. Only HUMAN_AGENT or END_USER can be used. + # @param suggestion_feature_type [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] + # Required. The type of the suggestion feature to remove. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new + # + # # Call the clear_suggestion_feature_config method. + # result = client.clear_suggestion_feature_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 clear_suggestion_feature_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.clear_suggestion_feature_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.clear_suggestion_feature_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.clear_suggestion_feature_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversation_profiles_stub.clear_suggestion_feature_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 ConversationProfiles REST API. + # + # This class represents the configuration for ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::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_conversation_profiles to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_conversation_profiles.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_conversation_profiles.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 ConversationProfiles 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_conversation_profiles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversation_profiles + ## + # RPC-specific configuration for `get_conversation_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation_profile + ## + # RPC-specific configuration for `create_conversation_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation_profile + ## + # RPC-specific configuration for `update_conversation_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :update_conversation_profile + ## + # RPC-specific configuration for `delete_conversation_profile` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_conversation_profile + ## + # RPC-specific configuration for `set_suggestion_feature_config` + # @return [::Gapic::Config::Method] + # + attr_reader :set_suggestion_feature_config + ## + # RPC-specific configuration for `clear_suggestion_feature_config` + # @return [::Gapic::Config::Method] + # + attr_reader :clear_suggestion_feature_config + + # @private + def initialize parent_rpcs = nil + list_conversation_profiles_config = parent_rpcs.list_conversation_profiles if parent_rpcs.respond_to? :list_conversation_profiles + @list_conversation_profiles = ::Gapic::Config::Method.new list_conversation_profiles_config + get_conversation_profile_config = parent_rpcs.get_conversation_profile if parent_rpcs.respond_to? :get_conversation_profile + @get_conversation_profile = ::Gapic::Config::Method.new get_conversation_profile_config + create_conversation_profile_config = parent_rpcs.create_conversation_profile if parent_rpcs.respond_to? :create_conversation_profile + @create_conversation_profile = ::Gapic::Config::Method.new create_conversation_profile_config + update_conversation_profile_config = parent_rpcs.update_conversation_profile if parent_rpcs.respond_to? :update_conversation_profile + @update_conversation_profile = ::Gapic::Config::Method.new update_conversation_profile_config + delete_conversation_profile_config = parent_rpcs.delete_conversation_profile if parent_rpcs.respond_to? :delete_conversation_profile + @delete_conversation_profile = ::Gapic::Config::Method.new delete_conversation_profile_config + set_suggestion_feature_config_config = parent_rpcs.set_suggestion_feature_config if parent_rpcs.respond_to? :set_suggestion_feature_config + @set_suggestion_feature_config = ::Gapic::Config::Method.new set_suggestion_feature_config_config + clear_suggestion_feature_config_config = parent_rpcs.clear_suggestion_feature_config if parent_rpcs.respond_to? :clear_suggestion_feature_config + @clear_suggestion_feature_config = ::Gapic::Config::Method.new clear_suggestion_feature_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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb new file mode 100644 index 000000000000..4fe8e5f380f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb @@ -0,0 +1,947 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module ConversationProfiles + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ConversationProfiles 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 ConversationProfiles 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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb new file mode 100644 index 000000000000..0ee320bc115b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb @@ -0,0 +1,565 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_profile_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module ConversationProfiles + module Rest + ## + # REST service stub for the ConversationProfiles 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_conversation_profiles REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListConversationProfilesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse] + # A result object deserialized from the server's reply + def list_conversation_profiles request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_conversation_profiles_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_conversation_profiles", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse.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_profile REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ConversationProfile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # A result object deserialized from the server's reply + def get_conversation_profile request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_profile_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_profile", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.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_profile REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ConversationProfile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # A result object deserialized from the server's reply + def create_conversation_profile request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_profile_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_profile", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.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_profile REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ConversationProfile] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # A result object deserialized from the server's reply + def update_conversation_profile request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_conversation_profile_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_profile", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.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_profile REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_profile request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_conversation_profile_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_profile", + 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 set_suggestion_feature_config REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 set_suggestion_feature_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_suggestion_feature_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: "set_suggestion_feature_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 clear_suggestion_feature_config REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 clear_suggestion_feature_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_clear_suggestion_feature_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: "clear_suggestion_feature_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 list_conversation_profiles REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest] + # 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_conversation_profiles_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/conversationProfiles", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/conversationProfiles", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_conversation_profile REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest] + # 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_profile_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_conversation_profile REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest] + # 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_profile_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/conversationProfiles", + body: "conversation_profile", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/conversationProfiles", + body: "conversation_profile", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_conversation_profile REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest] + # 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_profile_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{conversation_profile.name}", + body: "conversation_profile", + matches: [ + ["conversation_profile.name", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{conversation_profile.name}", + body: "conversation_profile", + matches: [ + ["conversation_profile.name", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_conversation_profile REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest] + # 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_profile_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_suggestion_feature_config REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_suggestion_feature_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation_profile}:setSuggestionFeatureConfig", + body: "*", + matches: [ + ["conversation_profile", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation_profile}:setSuggestionFeatureConfig", + body: "*", + matches: [ + ["conversation_profile", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the clear_suggestion_feature_config REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_clear_suggestion_feature_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation_profile}:clearSuggestionFeatureConfig", + body: "*", + matches: [ + ["conversation_profile", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation_profile}:clearSuggestionFeatureConfig", + body: "*", + matches: [ + ["conversation_profile", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb new file mode 100644 index 000000000000..0638df8aff60 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb @@ -0,0 +1,98 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/conversation.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/conversation_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Conversations + # Service for managing + # [Conversations][google.cloud.dialogflow.v2.Conversation]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Conversations' + + # Creates a new conversation. Conversations are auto-completed after 24 + # hours. + # + # Conversation Lifecycle: + # There are two stages during a conversation: Automated Agent Stage and + # Assist Stage. + # + # For Automated Agent Stage, there will be a dialogflow agent responding to + # user queries. + # + # For Assist Stage, there's no dialogflow agent responding to user queries. + # But we will provide suggestions which are generated from conversation. + # + # If + # [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] + # is configured for a dialogflow agent, conversation will start from + # `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And + # during `Automated Agent Stage`, once an + # [Intent][google.cloud.dialogflow.v2.Intent] with + # [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] + # is triggered, conversation will transfer to Assist Stage. + rpc :CreateConversation, ::Google::Cloud::Dialogflow::V2::CreateConversationRequest, ::Google::Cloud::Dialogflow::V2::Conversation + # Returns the list of all conversations in the specified project. + rpc :ListConversations, ::Google::Cloud::Dialogflow::V2::ListConversationsRequest, ::Google::Cloud::Dialogflow::V2::ListConversationsResponse + # Retrieves the specific conversation. + rpc :GetConversation, ::Google::Cloud::Dialogflow::V2::GetConversationRequest, ::Google::Cloud::Dialogflow::V2::Conversation + # Completes the specified conversation. Finished conversations are purged + # from the database after 30 days. + rpc :CompleteConversation, ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest, ::Google::Cloud::Dialogflow::V2::Conversation + # Data ingestion API. + # Ingests context references for an existing conversation. + rpc :IngestContextReferences, ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest, ::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse + # Lists messages that belong to a given conversation. + # `messages` are ordered by `create_time` in descending order. To fetch + # updates without duplication, send request with filter + # `create_time_epoch_microseconds > + # [first item's create_time of previous request]` and empty page_token. + rpc :ListMessages, ::Google::Cloud::Dialogflow::V2::ListMessagesRequest, ::Google::Cloud::Dialogflow::V2::ListMessagesResponse + # Suggests summary for a conversation based on specific historical messages. + # The range of the messages to be used for summary can be specified in the + # request. + rpc :SuggestConversationSummary, ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest, ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse + # Generates and returns a summary for a conversation that does not have a + # resource created for it. + rpc :GenerateStatelessSummary, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse + # Generates and returns a suggestion for a conversation that does not have a + # resource created for it. + rpc :GenerateStatelessSuggestion, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse + # Get answers for the given query based on knowledge documents. + rpc :SearchKnowledge, ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse + # Generates all the suggestions using generators configured in the + # conversation profile. A generator is used only if its trigger event is + # matched. + rpc :GenerateSuggestions, ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest, ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations.rb new file mode 100644 index 000000000000..dc1025ee6d00 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/conversations/credentials" +require "google/cloud/dialogflow/v2/conversations/paths" +require "google/cloud/dialogflow/v2/conversations/client" +require "google/cloud/dialogflow/v2/conversations/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::Conversation Conversations}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/conversations" + # client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/conversations/rest" + # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + module Conversations + end + end + end + end +end + +helper_path = ::File.join __dir__, "conversations", "helpers.rb" +require "google/cloud/dialogflow/v2/conversations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb new file mode 100644 index 000000000000..fcf8cfea67dd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb @@ -0,0 +1,1639 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Conversations + ## + # Client for the Conversations service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::Conversation Conversations}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversations_stub + + ## + # Configure the Conversations Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Conversations::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Conversations clients + # ::Google::Cloud::Dialogflow::V2::Conversations::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Conversations 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::Dialogflow::V2::Conversations::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 + @conversations_stub.universe_domain + end + + ## + # Create a new Conversations client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Conversations 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/dialogflow/v2/conversation_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 + + @conversations_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Conversations::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 + ) + + @conversations_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 = @conversations_stub.endpoint + config.universe_domain = @conversations_stub.universe_domain + config.logger = @conversations_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 + @conversations_stub.logger + end + + # Service calls + + ## + # Creates a new conversation. Conversations are auto-completed after 24 + # hours. + # + # Conversation Lifecycle: + # There are two stages during a conversation: Automated Agent Stage and + # Assist Stage. + # + # For Automated Agent Stage, there will be a dialogflow agent responding to + # user queries. + # + # For Assist Stage, there's no dialogflow agent responding to user queries. + # But we will provide suggestions which are generated from conversation. + # + # If + # {::Google::Cloud::Dialogflow::V2::Conversation#conversation_profile Conversation.conversation_profile} + # is configured for a dialogflow agent, conversation will start from + # `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And + # during `Automated Agent Stage`, once an + # {::Google::Cloud::Dialogflow::V2::Intent Intent} with + # {::Google::Cloud::Dialogflow::V2::Intent#live_agent_handoff Intent.live_agent_handoff} + # is triggered, conversation will transfer to Assist Stage. + # + # @overload create_conversation(request, options = nil) + # Pass arguments to `create_conversation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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, conversation_id: 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. Resource identifier of the project creating the conversation. + # Format: `projects//locations/`. + # @param conversation [::Google::Cloud::Dialogflow::V2::Conversation, ::Hash] + # Required. The conversation to create. + # @param conversation_id [::String] + # Optional. Identifier of the conversation. Generally it's auto generated by + # Google. Only set it if you cannot wait for the response to return a + # auto-generated one to you. + # + # The conversation ID must be compliant with the regression formula + # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + # If the field is provided, the caller is responsible for + # 1. the uniqueness of the ID, otherwise the request will be rejected. + # 2. the consistency for whether to use custom ID or not under a project to + # better ensure uniqueness. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Conversation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Conversation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new + # + # # Call the create_conversation method. + # result = client.create_conversation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + + @conversations_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 + + ## + # Returns the list of all conversations in the specified project. + # + # @overload list_conversations(request, options = nil) + # Pass arguments to `list_conversations` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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) + # 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 project from which to list all conversation. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @param filter [::String] + # Optional. A filter expression that filters conversations listed in the + # response. Only `lifecycle_state` can be filtered on in this way. For + # example, the following expression only returns `COMPLETED` conversations: + # + # `lifecycle_state = "COMPLETED"` + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + + @conversations_stub.call_rpc :list_conversations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @conversations_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 + + ## + # Retrieves the specific conversation. + # + # @overload get_conversation(request, options = nil) + # Pass arguments to `get_conversation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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 name of the conversation. Format: + # `projects//locations//conversations/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Conversation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Conversation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new + # + # # Call the get_conversation method. + # result = client.get_conversation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + + @conversations_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 + + ## + # Completes the specified conversation. Finished conversations are purged + # from the database after 30 days. + # + # @overload complete_conversation(request, options = nil) + # Pass arguments to `complete_conversation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CompleteConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CompleteConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation(name: nil) + # Pass arguments to `complete_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. Resource identifier of the conversation to close. + # Format: `projects//locations//conversations/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Conversation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Conversation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new + # + # # Call the complete_conversation method. + # result = client.complete_conversation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + # p result + # + def complete_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest + + # Converts hash and nil to 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_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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.complete_conversation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.complete_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.call_rpc :complete_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 + + ## + # Data ingestion API. + # Ingests context references for an existing conversation. + # + # @overload ingest_context_references(request, options = nil) + # Pass arguments to `ingest_context_references` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload ingest_context_references(conversation: nil, context_references: nil) + # Pass arguments to `ingest_context_references` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. Resource identifier of the conversation to ingest context + # information for. Format: `projects//locations//conversations/`. + # @param context_references [::Hash{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference, ::Hash}] + # Required. The context references to ingest. The key is the name of the + # context reference and the value contains the contents of the context + # reference. The key is used to incorporate ingested context references to + # enhance the generator. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new + # + # # Call the ingest_context_references method. + # result = client.ingest_context_references request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse. + # p result + # + def ingest_context_references request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.ingest_context_references.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + header_params["conversation"] = request.conversation + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.ingest_context_references.timeout, + metadata: metadata, + retry_policy: @config.rpcs.ingest_context_references.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.call_rpc :ingest_context_references, 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 messages that belong to a given conversation. + # `messages` are ordered by `create_time` in descending order. To fetch + # updates without duplication, send request with filter + # `create_time_epoch_microseconds > + # [first item's create_time of previous request]` and empty page_token. + # + # @overload list_messages(request, options = nil) + # Pass arguments to `list_messages` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListMessagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListMessagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_messages(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_messages` via keyword arguments. Note that at + # least one keyword argument is 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 name of the conversation to list messages for. + # Format: `projects//locations//conversations/` + # @param filter [::String] + # Optional. Filter on message fields. Currently predicates on `create_time` + # and `create_time_epoch_microseconds` are supported. `create_time` only + # support milliseconds accuracy. E.g., + # `create_time_epoch_microseconds > 1551790877964485` or + # `create_time > 2017-01-15T01:30:15.01Z`. + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new + # + # # Call the list_messages method. + # result = client.list_messages 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::Dialogflow::V2::Message. + # p item + # end + # + def list_messages request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListMessagesRequest + + # Converts hash and nil to 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_messages.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_messages.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_messages.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.call_rpc :list_messages, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @conversations_stub, :list_messages, 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 + + ## + # Suggests summary for a conversation based on specific historical messages. + # The range of the messages to be used for summary can be specified in the + # request. + # + # @overload suggest_conversation_summary(request, options = nil) + # Pass arguments to `suggest_conversation_summary` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_conversation_summary(conversation: nil, latest_message: nil, context_size: nil, assist_query_params: nil) + # Pass arguments to `suggest_conversation_summary` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The conversation to fetch suggestion for. + # Format: `projects//locations//conversations/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message used as context for + # compiling suggestion. If empty, the latest message of the conversation will + # be used. + # + # Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Optional. Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 500 and at most 1000. + # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] + # Optional. Parameters for a human assist query. Only used for POC/demo + # purpose. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new + # + # # Call the suggest_conversation_summary method. + # result = client.suggest_conversation_summary request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse. + # p result + # + def suggest_conversation_summary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_conversation_summary.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + header_params["conversation"] = request.conversation + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.suggest_conversation_summary.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_conversation_summary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.call_rpc :suggest_conversation_summary, 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 and returns a summary for a conversation that does not have a + # resource created for it. + # + # @overload generate_stateless_summary(request, options = nil) + # Pass arguments to `generate_stateless_summary` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stateless_summary(stateless_conversation: nil, conversation_profile: nil, latest_message: nil, max_context_size: nil) + # Pass arguments to `generate_stateless_summary` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param stateless_conversation [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest::MinimalConversation, ::Hash] + # Required. The conversation to suggest a summary for. + # @param conversation_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] + # Required. A ConversationProfile containing information required for Summary + # generation. + # Required fields: \\{language_code, security_settings} + # Optional fields: \\{agent_assistant_config} + # @param latest_message [::String] + # Optional. The name of the latest conversation message used as context for + # generating a Summary. If empty, the latest message of the conversation will + # be used. The format is specific to the user and the names of the messages + # provided. + # @param max_context_size [::Integer] + # Optional. Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 500 and at most 1000. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new + # + # # Call the generate_stateless_summary method. + # result = client.generate_stateless_summary request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse. + # p result + # + def generate_stateless_summary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest + + # Converts hash and nil to 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_stateless_summary.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.stateless_conversation&.parent + header_params["stateless_conversation.parent"] = request.stateless_conversation.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.generate_stateless_summary.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_stateless_summary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.call_rpc :generate_stateless_summary, 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 and returns a suggestion for a conversation that does not have a + # resource created for it. + # + # @overload generate_stateless_suggestion(request, options = nil) + # Pass arguments to `generate_stateless_suggestion` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stateless_suggestion(parent: nil, generator: nil, generator_name: nil, context_references: nil, conversation_context: nil, trigger_events: nil, security_settings: nil) + # Pass arguments to `generate_stateless_suggestion` via keyword arguments. Note that at + # least one keyword argument is 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 to charge for the Suggestion's generation. + # Format: `projects//locations/`. + # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] + # Uncreated generator. It should be a complete generator that includes all + # information about the generator. + # + # Note: The following parameters are mutually exclusive: `generator`, `generator_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 generator_name [::String] + # The resource name of the existing created generator. Format: + # `projects//locations//generators/` + # + # Note: The following parameters are mutually exclusive: `generator_name`, `generator`. 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 context_references [::Hash{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference, ::Hash}] + # Optional. A section of ingested context information. The key is the name of + # the context reference and the value contains the contents of the context + # reference. The key is used to incorporate ingested context references to + # enhance the generator. + # @param conversation_context [::Google::Cloud::Dialogflow::V2::ConversationContext, ::Hash] + # Optional. Context of the conversation, including transcripts. + # @param trigger_events [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] + # Optional. A list of trigger events. Generator will be triggered only if + # it's trigger event is included here. + # @param security_settings [::String] + # Optional. Name of the CX SecuritySettings which is used to redact generated + # response. If this field is empty, try to fetch v2 security_settings, which + # is a project level setting. If this field is empty and no v2 + # security_settings set up in this project, no redaction will be done. + # + # Format: + # `projects//locations//securitySettings/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new + # + # # Call the generate_stateless_suggestion method. + # result = client.generate_stateless_suggestion request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse. + # p result + # + def generate_stateless_suggestion request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest + + # Converts hash and nil to 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_stateless_suggestion.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.generate_stateless_suggestion.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_stateless_suggestion.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.call_rpc :generate_stateless_suggestion, 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 + + ## + # Get answers for the given query based on knowledge documents. + # + # @overload search_knowledge(request, options = nil) + # Pass arguments to `search_knowledge` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge(parent: nil, query: nil, conversation_profile: nil, session_id: nil, conversation: nil, latest_message: nil, query_source: nil, end_user_metadata: nil, search_config: nil, exact_search: nil) + # Pass arguments to `search_knowledge` via keyword arguments. Note that at + # least one keyword argument is 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 contains the conversation profile + # Format: 'projects/' or `projects//locations/`. + # @param query [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] + # Required. The natural language text query for knowledge search. + # @param conversation_profile [::String] + # Required. The conversation profile used to configure the search. + # Format: `projects//locations//conversationProfiles/`. + # @param session_id [::String] + # Required. The ID of the search session. + # The session_id can be combined with Dialogflow V3 Agent ID retrieved from + # conversation profile or on its own to identify a search session. The search + # history of the same session will impact the search result. It's up to the + # API caller to choose an appropriate `Session ID`. It can be a random number + # or some type of session identifiers (preferably hashed). The length must + # not exceed 36 characters. + # @param conversation [::String] + # Optional. The conversation (between human agent and end user) where the + # search request is triggered. Format: `projects//locations//conversations/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message when the request is + # triggered. + # Format: `projects//locations//conversations//messages/`. + # @param query_source [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::QuerySource] + # Optional. The source of the query in the request. + # @param end_user_metadata [::Google::Protobuf::Struct, ::Hash] + # Optional. Information about the end-user to improve the relevance and + # accuracy of generative answers. + # + # This will be interpreted and used by a language model, so, for good + # results, the data should be self-descriptive, and in a simple structure. + # + # Example: + # + # ```json + # { + # "subscription plan": "Business Premium Plus", + # "devices owned": [ + # \\{"model": "Google Pixel 7"}, + # \\{"model": "Google Pixel Tablet"} + # ] + # } + # ``` + # @param search_config [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig, ::Hash] + # Optional. Configuration specific to search queries with data stores. + # @param exact_search [::Boolean] + # Optional. Whether to search the query exactly without query rewrite. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new + # + # # Call the search_knowledge method. + # result = client.search_knowledge request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse. + # p result + # + def search_knowledge request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest + + # Converts hash and nil to 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_knowledge.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.search_knowledge.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_knowledge.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.call_rpc :search_knowledge, 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 all the suggestions using generators configured in the + # conversation profile. A generator is used only if its trigger event is + # matched. + # + # @overload generate_suggestions(request, options = nil) + # Pass arguments to `generate_suggestions` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_suggestions(conversation: nil, latest_message: nil, trigger_events: nil) + # Pass arguments to `generate_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 conversation [::String] + # Required. The conversation for which the suggestions are generated. Format: + # `projects//locations//conversations/`. + # + # The conversation must be created with a conversation profile which has + # generators configured in it to be able to get suggestions. + # @param latest_message [::String] + # Optional. The name of the latest conversation message for which the request + # is triggered. Format: `projects//locations//conversations//messages/`. + # @param trigger_events [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] + # Optional. A list of trigger events. Only generators configured in the + # conversation_profile whose trigger_event is listed here will be triggered. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new + # + # # Call the generate_suggestions method. + # result = client.generate_suggestions request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse. + # p result + # + def generate_suggestions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest + + # Converts hash and nil to 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_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + header_params["conversation"] = request.conversation + end + + request_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_suggestions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_suggestions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.call_rpc :generate_suggestions, 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 Conversations API. + # + # This class represents the configuration for Conversations, + # 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::Dialogflow::V2::Conversations::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_conversation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Conversations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_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::Dialogflow::V2::Conversations::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Conversations 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation + ## + # RPC-specific configuration for `list_conversations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversations + ## + # RPC-specific configuration for `get_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation + ## + # RPC-specific configuration for `complete_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_conversation + ## + # RPC-specific configuration for `ingest_context_references` + # @return [::Gapic::Config::Method] + # + attr_reader :ingest_context_references + ## + # RPC-specific configuration for `list_messages` + # @return [::Gapic::Config::Method] + # + attr_reader :list_messages + ## + # RPC-specific configuration for `suggest_conversation_summary` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_conversation_summary + ## + # RPC-specific configuration for `generate_stateless_summary` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_stateless_summary + ## + # RPC-specific configuration for `generate_stateless_suggestion` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_stateless_suggestion + ## + # RPC-specific configuration for `search_knowledge` + # @return [::Gapic::Config::Method] + # + attr_reader :search_knowledge + ## + # RPC-specific configuration for `generate_suggestions` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_suggestions + + # @private + def initialize parent_rpcs = nil + create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation + @create_conversation = ::Gapic::Config::Method.new create_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 + get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation + @get_conversation = ::Gapic::Config::Method.new get_conversation_config + complete_conversation_config = parent_rpcs.complete_conversation if parent_rpcs.respond_to? :complete_conversation + @complete_conversation = ::Gapic::Config::Method.new complete_conversation_config + ingest_context_references_config = parent_rpcs.ingest_context_references if parent_rpcs.respond_to? :ingest_context_references + @ingest_context_references = ::Gapic::Config::Method.new ingest_context_references_config + list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages + @list_messages = ::Gapic::Config::Method.new list_messages_config + suggest_conversation_summary_config = parent_rpcs.suggest_conversation_summary if parent_rpcs.respond_to? :suggest_conversation_summary + @suggest_conversation_summary = ::Gapic::Config::Method.new suggest_conversation_summary_config + generate_stateless_summary_config = parent_rpcs.generate_stateless_summary if parent_rpcs.respond_to? :generate_stateless_summary + @generate_stateless_summary = ::Gapic::Config::Method.new generate_stateless_summary_config + generate_stateless_suggestion_config = parent_rpcs.generate_stateless_suggestion if parent_rpcs.respond_to? :generate_stateless_suggestion + @generate_stateless_suggestion = ::Gapic::Config::Method.new generate_stateless_suggestion_config + search_knowledge_config = parent_rpcs.search_knowledge if parent_rpcs.respond_to? :search_knowledge + @search_knowledge = ::Gapic::Config::Method.new search_knowledge_config + generate_suggestions_config = parent_rpcs.generate_suggestions if parent_rpcs.respond_to? :generate_suggestions + @generate_suggestions = ::Gapic::Config::Method.new generate_suggestions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/credentials.rb new file mode 100644 index 000000000000..ad828ce5e5ce --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Conversations + # Credentials for the Conversations API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/paths.rb new file mode 100644 index 000000000000..746a3a8fd459 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/paths.rb @@ -0,0 +1,541 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module Conversations + # Path helper methods for the Conversations API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # @overload agent_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/agent` + # + # @param project [String] + # + # @overload agent_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def agent_path **args + resources = { + "project" => (proc do |project:| + "projects/#{project}/agent" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent" + 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 App resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # + # @return [::String] + def app_path project:, location:, app: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}" + end + + ## + # Create a fully-qualified CXSecuritySettings resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/securitySettings/{security_settings}` + # + # @param project [String] + # @param location [String] + # @param security_settings [String] + # + # @return [::String] + def cx_security_settings_path project:, location:, security_settings: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/securitySettings/#{security_settings}" + end + + ## + # Create a fully-qualified Conversation resource string. + # + # @overload conversation_path(project:, conversation:) + # The resource will be in the following format: + # + # `projects/{project}/conversations/{conversation}` + # + # @param project [String] + # @param conversation [String] + # + # @overload conversation_path(project:, location:, conversation:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversations/{conversation}` + # + # @param project [String] + # @param location [String] + # @param conversation [String] + # + # @return [::String] + def conversation_path **args + resources = { + "conversation:project" => (proc do |project:, conversation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/conversations/#{conversation}" + end), + "conversation:location:project" => (proc do |project:, location:, conversation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/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 ConversationModel resource string. + # + # @overload conversation_model_path(project:, location:, conversation_model:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversationModels/{conversation_model}` + # + # @param project [String] + # @param location [String] + # @param conversation_model [String] + # + # @overload conversation_model_path(project:, conversation_model:) + # The resource will be in the following format: + # + # `projects/{project}/conversationModels/{conversation_model}` + # + # @param project [String] + # @param conversation_model [String] + # + # @return [::String] + def conversation_model_path **args + resources = { + "conversation_model:location:project" => (proc do |project:, location:, conversation_model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}" + end), + "conversation_model:project" => (proc do |project:, conversation_model:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/conversationModels/#{conversation_model}" + 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 ConversationProfile resource string. + # + # @overload conversation_profile_path(project:, conversation_profile:) + # The resource will be in the following format: + # + # `projects/{project}/conversationProfiles/{conversation_profile}` + # + # @param project [String] + # @param conversation_profile [String] + # + # @overload conversation_profile_path(project:, location:, conversation_profile:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}` + # + # @param project [String] + # @param location [String] + # @param conversation_profile [String] + # + # @return [::String] + def conversation_profile_path **args + resources = { + "conversation_profile:project" => (proc do |project:, conversation_profile:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/conversationProfiles/#{conversation_profile}" + end), + "conversation_profile:location:project" => (proc do |project:, location:, conversation_profile:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversationProfiles/#{conversation_profile}" + 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:, 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] + # + # @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] + # + # @return [::String] + def data_store_path **args + resources = { + "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), + "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) + } + + 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:, knowledge_base:, document:) + # The resource will be in the following format: + # + # `projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}` + # + # @param project [String] + # @param knowledge_base [String] + # @param document [String] + # + # @overload document_path(project:, location:, knowledge_base:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param knowledge_base [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" + + "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}" + end), + "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" + + "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/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 Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/generators/#{generator}" + end + + ## + # Create a fully-qualified KnowledgeBase resource string. + # + # @overload knowledge_base_path(project:, knowledge_base:) + # The resource will be in the following format: + # + # `projects/{project}/knowledgeBases/{knowledge_base}` + # + # @param project [String] + # @param knowledge_base [String] + # + # @overload knowledge_base_path(project:, location:, knowledge_base:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}` + # + # @param project [String] + # @param location [String] + # @param knowledge_base [String] + # + # @return [::String] + def knowledge_base_path **args + resources = { + "knowledge_base:project" => (proc do |project:, knowledge_base:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/knowledgeBases/#{knowledge_base}" + end), + "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}" + 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 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 Message resource string. + # + # @overload message_path(project:, conversation:, message:) + # The resource will be in the following format: + # + # `projects/{project}/conversations/{conversation}/messages/{message}` + # + # @param project [String] + # @param conversation [String] + # @param message [String] + # + # @overload message_path(project:, location:, conversation:, message:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}` + # + # @param project [String] + # @param location [String] + # @param conversation [String] + # @param message [String] + # + # @return [::String] + def message_path **args + resources = { + "conversation:message:project" => (proc do |project:, conversation:, message:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" + + "projects/#{project}/conversations/#{conversation}/messages/#{message}" + end), + "conversation:location:message:project" => (proc do |project:, location:, conversation:, message:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversations/#{conversation}/messages/#{message}" + 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 PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + ## + # 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 + + ## + # Create a fully-qualified Tool resource string. + # + # @overload tool_path(project:, location:, tool:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param tool [String] + # + # @overload tool_path(project:, location:, app:, tool:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # @param tool [String] + # + # @return [::String] + def tool_path **args + resources = { + "location:project:tool" => (proc do |project:, location:, tool:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tools/#{tool}" + end), + "app:location:project:tool" => (proc do |project:, location:, app:, tool:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}" + 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 Toolset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # @param toolset [String] + # + # @return [::String] + def toolset_path project:, location:, app:, toolset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest.rb new file mode 100644 index 000000000000..2f0d86acb368 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/conversations/credentials" +require "google/cloud/dialogflow/v2/conversations/paths" +require "google/cloud/dialogflow/v2/conversations/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::Conversation Conversations}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/conversations/rest" + # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + module Conversations + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/conversations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb new file mode 100644 index 000000000000..9cfe7bac8cf8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb @@ -0,0 +1,1527 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_pb" +require "google/cloud/dialogflow/v2/conversations/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Conversations + module Rest + ## + # REST client for the Conversations service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::Conversation Conversations}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :conversations_stub + + ## + # Configure the Conversations Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Conversations clients + # ::Google::Cloud::Dialogflow::V2::Conversations::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Conversations 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::Dialogflow::V2::Conversations::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 + @conversations_stub.universe_domain + end + + ## + # Create a new Conversations REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Conversations 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 + + @conversations_stub = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @conversations_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 = @conversations_stub.endpoint + config.universe_domain = @conversations_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @conversations_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 + @conversations_stub.logger + end + + # Service calls + + ## + # Creates a new conversation. Conversations are auto-completed after 24 + # hours. + # + # Conversation Lifecycle: + # There are two stages during a conversation: Automated Agent Stage and + # Assist Stage. + # + # For Automated Agent Stage, there will be a dialogflow agent responding to + # user queries. + # + # For Assist Stage, there's no dialogflow agent responding to user queries. + # But we will provide suggestions which are generated from conversation. + # + # If + # {::Google::Cloud::Dialogflow::V2::Conversation#conversation_profile Conversation.conversation_profile} + # is configured for a dialogflow agent, conversation will start from + # `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And + # during `Automated Agent Stage`, once an + # {::Google::Cloud::Dialogflow::V2::Intent Intent} with + # {::Google::Cloud::Dialogflow::V2::Intent#live_agent_handoff Intent.live_agent_handoff} + # is triggered, conversation will transfer to Assist Stage. + # + # @overload create_conversation(request, options = nil) + # Pass arguments to `create_conversation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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, conversation_id: 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. Resource identifier of the project creating the conversation. + # Format: `projects//locations/`. + # @param conversation [::Google::Cloud::Dialogflow::V2::Conversation, ::Hash] + # Required. The conversation to create. + # @param conversation_id [::String] + # Optional. Identifier of the conversation. Generally it's auto generated by + # Google. Only set it if you cannot wait for the response to return a + # auto-generated one to you. + # + # The conversation ID must be compliant with the regression formula + # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + # If the field is provided, the caller is responsible for + # 1. the uniqueness of the ID, otherwise the request will be rejected. + # 2. the consistency for whether to use custom ID or not under a project to + # better ensure uniqueness. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Conversation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new + # + # # Call the create_conversation method. + # result = client.create_conversation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + @conversations_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 + + ## + # Returns the list of all conversations in the specified project. + # + # @overload list_conversations(request, options = nil) + # Pass arguments to `list_conversations` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListConversationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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) + # 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 project from which to list all conversation. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @param filter [::String] + # Optional. A filter expression that filters conversations listed in the + # response. Only `lifecycle_state` can be filtered on in this way. For + # example, the following expression only returns `COMPLETED` conversations: + # + # `lifecycle_state = "COMPLETED"` + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + @conversations_stub.list_conversations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @conversations_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 + + ## + # Retrieves the specific conversation. + # + # @overload get_conversation(request, options = nil) + # Pass arguments to `get_conversation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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 name of the conversation. Format: + # `projects//locations//conversations/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Conversation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new + # + # # Call the get_conversation method. + # result = client.get_conversation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + @conversations_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 + + ## + # Completes the specified conversation. Finished conversations are purged + # from the database after 30 days. + # + # @overload complete_conversation(request, options = nil) + # Pass arguments to `complete_conversation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CompleteConversationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CompleteConversationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_conversation(name: nil) + # Pass arguments to `complete_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. Resource identifier of the conversation to close. + # Format: `projects//locations//conversations/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Conversation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new + # + # # Call the complete_conversation method. + # result = client.complete_conversation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + # p result + # + def complete_conversation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest + + # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_conversation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.complete_conversation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.complete_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 + + ## + # Data ingestion API. + # Ingests context references for an existing conversation. + # + # @overload ingest_context_references(request, options = nil) + # Pass arguments to `ingest_context_references` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload ingest_context_references(conversation: nil, context_references: nil) + # Pass arguments to `ingest_context_references` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. Resource identifier of the conversation to ingest context + # information for. Format: `projects//locations//conversations/`. + # @param context_references [::Hash{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference, ::Hash}] + # Required. The context references to ingest. The key is the name of the + # context reference and the value contains the contents of the context + # reference. The key is used to incorporate ingested context references to + # enhance the generator. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new + # + # # Call the ingest_context_references method. + # result = client.ingest_context_references request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse. + # p result + # + def ingest_context_references request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.ingest_context_references.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.ingest_context_references.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.ingest_context_references.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.ingest_context_references 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 messages that belong to a given conversation. + # `messages` are ordered by `create_time` in descending order. To fetch + # updates without duplication, send request with filter + # `create_time_epoch_microseconds > + # [first item's create_time of previous request]` and empty page_token. + # + # @overload list_messages(request, options = nil) + # Pass arguments to `list_messages` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListMessagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListMessagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_messages(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_messages` via keyword arguments. Note that at + # least one keyword argument is 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 name of the conversation to list messages for. + # Format: `projects//locations//conversations/` + # @param filter [::String] + # Optional. Filter on message fields. Currently predicates on `create_time` + # and `create_time_epoch_microseconds` are supported. `create_time` only + # support milliseconds accuracy. E.g., + # `create_time_epoch_microseconds > 1551790877964485` or + # `create_time > 2017-01-15T01:30:15.01Z`. + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new + # + # # Call the list_messages method. + # result = client.list_messages 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::Dialogflow::V2::Message. + # p item + # end + # + def list_messages request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListMessagesRequest + + # Converts hash and nil to an 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_messages.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_messages.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_messages.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.list_messages request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @conversations_stub, :list_messages, "messages", 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 + + ## + # Suggests summary for a conversation based on specific historical messages. + # The range of the messages to be used for summary can be specified in the + # request. + # + # @overload suggest_conversation_summary(request, options = nil) + # Pass arguments to `suggest_conversation_summary` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload suggest_conversation_summary(conversation: nil, latest_message: nil, context_size: nil, assist_query_params: nil) + # Pass arguments to `suggest_conversation_summary` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The conversation to fetch suggestion for. + # Format: `projects//locations//conversations/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message used as context for + # compiling suggestion. If empty, the latest message of the conversation will + # be used. + # + # Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Optional. Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 500 and at most 1000. + # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] + # Optional. Parameters for a human assist query. Only used for POC/demo + # purpose. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new + # + # # Call the suggest_conversation_summary method. + # result = client.suggest_conversation_summary request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse. + # p result + # + def suggest_conversation_summary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.suggest_conversation_summary.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.suggest_conversation_summary.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.suggest_conversation_summary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.suggest_conversation_summary 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 + + ## + # Generates and returns a summary for a conversation that does not have a + # resource created for it. + # + # @overload generate_stateless_summary(request, options = nil) + # Pass arguments to `generate_stateless_summary` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stateless_summary(stateless_conversation: nil, conversation_profile: nil, latest_message: nil, max_context_size: nil) + # Pass arguments to `generate_stateless_summary` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param stateless_conversation [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest::MinimalConversation, ::Hash] + # Required. The conversation to suggest a summary for. + # @param conversation_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] + # Required. A ConversationProfile containing information required for Summary + # generation. + # Required fields: \\{language_code, security_settings} + # Optional fields: \\{agent_assistant_config} + # @param latest_message [::String] + # Optional. The name of the latest conversation message used as context for + # generating a Summary. If empty, the latest message of the conversation will + # be used. The format is specific to the user and the names of the messages + # provided. + # @param max_context_size [::Integer] + # Optional. Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 500 and at most 1000. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new + # + # # Call the generate_stateless_summary method. + # result = client.generate_stateless_summary request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse. + # p result + # + def generate_stateless_summary request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest + + # Converts hash and nil to an 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_stateless_summary.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_stateless_summary.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_stateless_summary.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.generate_stateless_summary 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 + + ## + # Generates and returns a suggestion for a conversation that does not have a + # resource created for it. + # + # @overload generate_stateless_suggestion(request, options = nil) + # Pass arguments to `generate_stateless_suggestion` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stateless_suggestion(parent: nil, generator: nil, generator_name: nil, context_references: nil, conversation_context: nil, trigger_events: nil, security_settings: nil) + # Pass arguments to `generate_stateless_suggestion` via keyword arguments. Note that at + # least one keyword argument is 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 to charge for the Suggestion's generation. + # Format: `projects//locations/`. + # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] + # Uncreated generator. It should be a complete generator that includes all + # information about the generator. + # + # Note: The following parameters are mutually exclusive: `generator`, `generator_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 generator_name [::String] + # The resource name of the existing created generator. Format: + # `projects//locations//generators/` + # + # Note: The following parameters are mutually exclusive: `generator_name`, `generator`. 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 context_references [::Hash{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference, ::Hash}] + # Optional. A section of ingested context information. The key is the name of + # the context reference and the value contains the contents of the context + # reference. The key is used to incorporate ingested context references to + # enhance the generator. + # @param conversation_context [::Google::Cloud::Dialogflow::V2::ConversationContext, ::Hash] + # Optional. Context of the conversation, including transcripts. + # @param trigger_events [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] + # Optional. A list of trigger events. Generator will be triggered only if + # it's trigger event is included here. + # @param security_settings [::String] + # Optional. Name of the CX SecuritySettings which is used to redact generated + # response. If this field is empty, try to fetch v2 security_settings, which + # is a project level setting. If this field is empty and no v2 + # security_settings set up in this project, no redaction will be done. + # + # Format: + # `projects//locations//securitySettings/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new + # + # # Call the generate_stateless_suggestion method. + # result = client.generate_stateless_suggestion request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse. + # p result + # + def generate_stateless_suggestion request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest + + # Converts hash and nil to an 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_stateless_suggestion.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_stateless_suggestion.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_stateless_suggestion.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.generate_stateless_suggestion 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 + + ## + # Get answers for the given query based on knowledge documents. + # + # @overload search_knowledge(request, options = nil) + # Pass arguments to `search_knowledge` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge(parent: nil, query: nil, conversation_profile: nil, session_id: nil, conversation: nil, latest_message: nil, query_source: nil, end_user_metadata: nil, search_config: nil, exact_search: nil) + # Pass arguments to `search_knowledge` via keyword arguments. Note that at + # least one keyword argument is 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 contains the conversation profile + # Format: 'projects/' or `projects//locations/`. + # @param query [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] + # Required. The natural language text query for knowledge search. + # @param conversation_profile [::String] + # Required. The conversation profile used to configure the search. + # Format: `projects//locations//conversationProfiles/`. + # @param session_id [::String] + # Required. The ID of the search session. + # The session_id can be combined with Dialogflow V3 Agent ID retrieved from + # conversation profile or on its own to identify a search session. The search + # history of the same session will impact the search result. It's up to the + # API caller to choose an appropriate `Session ID`. It can be a random number + # or some type of session identifiers (preferably hashed). The length must + # not exceed 36 characters. + # @param conversation [::String] + # Optional. The conversation (between human agent and end user) where the + # search request is triggered. Format: `projects//locations//conversations/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message when the request is + # triggered. + # Format: `projects//locations//conversations//messages/`. + # @param query_source [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::QuerySource] + # Optional. The source of the query in the request. + # @param end_user_metadata [::Google::Protobuf::Struct, ::Hash] + # Optional. Information about the end-user to improve the relevance and + # accuracy of generative answers. + # + # This will be interpreted and used by a language model, so, for good + # results, the data should be self-descriptive, and in a simple structure. + # + # Example: + # + # ```json + # { + # "subscription plan": "Business Premium Plus", + # "devices owned": [ + # \\{"model": "Google Pixel 7"}, + # \\{"model": "Google Pixel Tablet"} + # ] + # } + # ``` + # @param search_config [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig, ::Hash] + # Optional. Configuration specific to search queries with data stores. + # @param exact_search [::Boolean] + # Optional. Whether to search the query exactly without query rewrite. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new + # + # # Call the search_knowledge method. + # result = client.search_knowledge request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse. + # p result + # + def search_knowledge request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest + + # Converts hash and nil to an 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_knowledge.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_knowledge.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_knowledge.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.search_knowledge 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 + + ## + # Generates all the suggestions using generators configured in the + # conversation profile. A generator is used only if its trigger event is + # matched. + # + # @overload generate_suggestions(request, options = nil) + # Pass arguments to `generate_suggestions` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_suggestions(conversation: nil, latest_message: nil, trigger_events: nil) + # Pass arguments to `generate_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 conversation [::String] + # Required. The conversation for which the suggestions are generated. Format: + # `projects//locations//conversations/`. + # + # The conversation must be created with a conversation profile which has + # generators configured in it to be able to get suggestions. + # @param latest_message [::String] + # Optional. The name of the latest conversation message for which the request + # is triggered. Format: `projects//locations//conversations//messages/`. + # @param trigger_events [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] + # Optional. A list of trigger events. Only generators configured in the + # conversation_profile whose trigger_event is listed here will be triggered. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new + # + # # Call the generate_suggestions method. + # result = client.generate_suggestions request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse. + # p result + # + def generate_suggestions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest + + # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_suggestions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_suggestions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @conversations_stub.generate_suggestions 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 Conversations REST API. + # + # This class represents the configuration for Conversations 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::Dialogflow::V2::Conversations::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_conversation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_conversation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Conversations 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_conversation + ## + # RPC-specific configuration for `list_conversations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_conversations + ## + # RPC-specific configuration for `get_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_conversation + ## + # RPC-specific configuration for `complete_conversation` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_conversation + ## + # RPC-specific configuration for `ingest_context_references` + # @return [::Gapic::Config::Method] + # + attr_reader :ingest_context_references + ## + # RPC-specific configuration for `list_messages` + # @return [::Gapic::Config::Method] + # + attr_reader :list_messages + ## + # RPC-specific configuration for `suggest_conversation_summary` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_conversation_summary + ## + # RPC-specific configuration for `generate_stateless_summary` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_stateless_summary + ## + # RPC-specific configuration for `generate_stateless_suggestion` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_stateless_suggestion + ## + # RPC-specific configuration for `search_knowledge` + # @return [::Gapic::Config::Method] + # + attr_reader :search_knowledge + ## + # RPC-specific configuration for `generate_suggestions` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_suggestions + + # @private + def initialize parent_rpcs = nil + create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation + @create_conversation = ::Gapic::Config::Method.new create_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 + get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation + @get_conversation = ::Gapic::Config::Method.new get_conversation_config + complete_conversation_config = parent_rpcs.complete_conversation if parent_rpcs.respond_to? :complete_conversation + @complete_conversation = ::Gapic::Config::Method.new complete_conversation_config + ingest_context_references_config = parent_rpcs.ingest_context_references if parent_rpcs.respond_to? :ingest_context_references + @ingest_context_references = ::Gapic::Config::Method.new ingest_context_references_config + list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages + @list_messages = ::Gapic::Config::Method.new list_messages_config + suggest_conversation_summary_config = parent_rpcs.suggest_conversation_summary if parent_rpcs.respond_to? :suggest_conversation_summary + @suggest_conversation_summary = ::Gapic::Config::Method.new suggest_conversation_summary_config + generate_stateless_summary_config = parent_rpcs.generate_stateless_summary if parent_rpcs.respond_to? :generate_stateless_summary + @generate_stateless_summary = ::Gapic::Config::Method.new generate_stateless_summary_config + generate_stateless_suggestion_config = parent_rpcs.generate_stateless_suggestion if parent_rpcs.respond_to? :generate_stateless_suggestion + @generate_stateless_suggestion = ::Gapic::Config::Method.new generate_stateless_suggestion_config + search_knowledge_config = parent_rpcs.search_knowledge if parent_rpcs.respond_to? :search_knowledge + @search_knowledge = ::Gapic::Config::Method.new search_knowledge_config + generate_suggestions_config = parent_rpcs.generate_suggestions if parent_rpcs.respond_to? :generate_suggestions + @generate_suggestions = ::Gapic::Config::Method.new generate_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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb new file mode 100644 index 000000000000..30b869a01b77 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb @@ -0,0 +1,845 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Conversations + module Rest + ## + # REST service stub for the Conversations 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_conversation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::ListConversationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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 get_conversation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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 complete_conversation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CompleteConversationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Conversation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Conversation] + # A result object deserialized from the server's reply + def complete_conversation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_complete_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: "complete_conversation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::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 ingest_context_references REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::IngestContextReferencesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] + # A result object deserialized from the server's reply + def ingest_context_references request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_ingest_context_references_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "ingest_context_references", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse.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_messages REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListMessagesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListMessagesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListMessagesResponse] + # A result object deserialized from the server's reply + def list_messages request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_messages_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_messages", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListMessagesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the suggest_conversation_summary REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SuggestConversationSummaryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] + # A result object deserialized from the server's reply + def suggest_conversation_summary request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_suggest_conversation_summary_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "suggest_conversation_summary", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the generate_stateless_summary REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::GenerateStatelessSummaryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] + # A result object deserialized from the server's reply + def generate_stateless_summary request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_stateless_summary_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_stateless_summary", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the generate_stateless_suggestion REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::GenerateStatelessSuggestionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] + # A result object deserialized from the server's reply + def generate_stateless_suggestion request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_stateless_suggestion_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_stateless_suggestion", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse.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_knowledge REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SearchKnowledgeResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] + # A result object deserialized from the server's reply + def search_knowledge request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_knowledge_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_knowledge", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the generate_suggestions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::GenerateSuggestionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] + # A result object deserialized from the server's reply + def generate_suggestions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_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: "generate_suggestions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse.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_conversation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/conversations", + body: "conversation", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/conversations", + body: "conversation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_conversations REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/conversations", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/conversations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_conversation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the complete_conversation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CompleteConversationRequest] + # 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_conversation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:complete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:complete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the ingest_context_references REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_ingest_context_references_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation}:ingestContextReferences", + body: "*", + matches: [ + ["conversation", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_messages REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListMessagesRequest] + # 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_messages_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/messages", + matches: [ + ["parent", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/messages", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the suggest_conversation_summary REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_suggest_conversation_summary_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation}/suggestions:suggestConversationSummary", + body: "*", + matches: [ + ["conversation", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation}/suggestions:suggestConversationSummary", + body: "*", + matches: [ + ["conversation", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_stateless_summary REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest] + # 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_stateless_summary_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{stateless_conversation.parent}/suggestions:generateStatelessSummary", + body: "*", + matches: [ + ["stateless_conversation.parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{stateless_conversation.parent}/suggestions:generateStatelessSummary", + body: "*", + matches: [ + ["stateless_conversation.parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_stateless_suggestion REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest] + # 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_stateless_suggestion_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/statelessSuggestion:generate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_knowledge REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest] + # 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_knowledge_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:searchKnowledge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:searchKnowledge", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation}/suggestions:searchKnowledge", + body: "*", + matches: [ + ["conversation", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation}/suggestions:searchKnowledge", + body: "*", + matches: [ + ["conversation", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_suggestions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest] + # 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_suggestions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation}/suggestions:generate", + body: "*", + matches: [ + ["conversation", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{conversation}/suggestions:generate", + body: "*", + matches: [ + ["conversation", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_pb.rb new file mode 100644 index 000000000000..3bfefeef2beb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/document.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/dialogflow/v2/gcs_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n)google/cloud/dialogflow/v2/document.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/dialogflow/v2/gcs.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa6\x08\n\x08\x44ocument\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12P\n\x0fknowledge_types\x18\x04 \x03(\x0e\x32\x32.google.cloud.dialogflow.v2.Document.KnowledgeTypeB\x03\xe0\x41\x02\x12\x15\n\x0b\x63ontent_uri\x18\x05 \x01(\tH\x00\x12\x15\n\x0braw_content\x18\t \x01(\x0cH\x00\x12\x1f\n\x12\x65nable_auto_reload\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12T\n\x14latest_reload_status\x18\x0c \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.Document.ReloadStatusB\x03\xe0\x41\x03\x12I\n\x08metadata\x18\x07 \x03(\x0b\x32\x32.google.cloud.dialogflow.v2.Document.MetadataEntryB\x03\xe0\x41\x01\x12>\n\x05state\x18\r \x01(\x0e\x32*.google.cloud.dialogflow.v2.Document.StateB\x03\xe0\x41\x03\x1a\\\n\x0cReloadStatus\x12(\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x81\x01\n\rKnowledgeType\x12\x1e\n\x1aKNOWLEDGE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x46\x41Q\x10\x01\x12\x11\n\rEXTRACTIVE_QA\x10\x02\x12\x16\n\x12\x41RTICLE_SUGGESTION\x10\x03\x12\x1c\n\x18\x41GENT_FACING_SMART_REPLY\x10\x04\"c\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\x0c\n\x08UPDATING\x10\x03\x12\r\n\tRELOADING\x10\x04\x12\x0c\n\x08\x44\x45LETING\x10\x05:\xcf\x01\xea\x41\xcb\x01\n\"dialogflow.googleapis.com/Document\x12Gprojects/{project}/knowledgeBases/{knowledge_base}/documents/{document}\x12\\projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}B\x08\n\x06source\"N\n\x12GetDocumentRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\"\x89\x01\n\x14ListDocumentsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/Document\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\"i\n\x15ListDocumentsResponse\x12\x37\n\tdocuments\x18\x01 \x03(\x0b\x32$.google.cloud.dialogflow.v2.Document\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x90\x01\n\x15\x43reateDocumentRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/Document\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.v2.DocumentB\x03\xe0\x41\x02\"\x99\x02\n\x16ImportDocumentsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/Document\x12\x41\n\ngcs_source\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.v2.GcsSourcesB\x03\xe0\x41\x01H\x00\x12R\n\x11\x64ocument_template\x18\x03 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.ImportDocumentTemplateB\x03\xe0\x41\x02\x12\"\n\x1aimport_gcs_custom_metadata\x18\x04 \x01(\x08\x42\x08\n\x06source\"\x87\x02\n\x16ImportDocumentTemplate\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12P\n\x0fknowledge_types\x18\x02 \x03(\x0e\x32\x32.google.cloud.dialogflow.v2.Document.KnowledgeTypeB\x03\xe0\x41\x02\x12R\n\x08metadata\x18\x03 \x03(\x0b\x32@.google.cloud.dialogflow.v2.ImportDocumentTemplate.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"?\n\x17ImportDocumentsResponse\x12$\n\x08warnings\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\"Q\n\x15\x44\x65leteDocumentRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\"\x8a\x01\n\x15UpdateDocumentRequest\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.v2.DocumentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xcd\x01\n\x15ReloadDocumentRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\x12\x1a\n\x0b\x63ontent_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x12\'\n\x1aimport_gcs_custom_metadata\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12+\n\x1esmart_messaging_partial_update\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x42\x08\n\x06source\"\xec\x01\n\x15\x45xportDocumentRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\x12\x45\n\x0fgcs_destination\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.v2.GcsDestinationH\x00\x12\x1b\n\x13\x65xport_full_content\x18\x03 \x01(\x08\x12&\n\x1esmart_messaging_partial_update\x18\x05 \x01(\x08\x42\r\n\x0b\x64\x65stination\"g\n\x17\x45xportOperationMetadata\x12L\n\x18\x65xported_gcs_destination\x18\x01 \x01(\x0b\x32*.google.cloud.dialogflow.v2.GcsDestination\"\xe9\x02\n\x1aKnowledgeOperationMetadata\x12P\n\x05state\x18\x01 \x01(\x0e\x32<.google.cloud.dialogflow.v2.KnowledgeOperationMetadata.StateB\x03\xe0\x41\x03\x12\x16\n\x0eknowledge_base\x18\x03 \x01(\t\x12X\n\x19\x65xport_operation_metadata\x18\x04 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.ExportOperationMetadataH\x00\x12-\n\tdone_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"B\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x42\x14\n\x12operation_metadata2\xac\x16\n\tDocuments\x12\xb9\x02\n\rListDocuments\x12\x30.google.cloud.dialogflow.v2.ListDocumentsRequest\x1a\x31.google.cloud.dialogflow.v2.ListDocumentsResponse\"\xc2\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb2\x01\x12\x32/v2/{parent=projects/*/knowledgeBases/*}/documentsZ@\x12>/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documentsZ:\x12\x38/v2/{parent=projects/*/agent/knowledgeBases/*}/documents\x12\xa6\x02\n\x0bGetDocument\x12..google.cloud.dialogflow.v2.GetDocumentRequest\x1a$.google.cloud.dialogflow.v2.Document\"\xc0\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb2\x01\x12\x32/v2/{name=projects/*/knowledgeBases/*/documents/*}Z@\x12>/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}Z:\x12\x38/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}\x12\xf7\x02\n\x0e\x43reateDocument\x12\x31.google.cloud.dialogflow.v2.CreateDocumentRequest\x1a\x1d.google.longrunning.Operation\"\x92\x02\xca\x41&\n\x08\x44ocument\x12\x1aKnowledgeOperationMetadata\xda\x41\x0fparent,document\x82\xd3\xe4\x93\x02\xd0\x01\"2/v2/{parent=projects/*/knowledgeBases/*}/documents:\x08\x64ocumentZJ\">/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:\x08\x64ocumentZD\"8/v2/{parent=projects/*/agent/knowledgeBases/*}/documents:\x08\x64ocument\x12\xb0\x02\n\x0fImportDocuments\x12\x32.google.cloud.dialogflow.v2.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\xc9\x01\xca\x41\x35\n\x17ImportDocumentsResponse\x12\x1aKnowledgeOperationMetadata\x82\xd3\xe4\x93\x02\x8a\x01\"9/v2/{parent=projects/*/knowledgeBases/*}/documents:import:\x01*ZJ\"E/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import:\x01*\x12\xdb\x02\n\x0e\x44\x65leteDocument\x12\x31.google.cloud.dialogflow.v2.DeleteDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xf6\x01\xca\x41\x33\n\x15google.protobuf.Empty\x12\x1aKnowledgeOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb2\x01*2/v2/{name=projects/*/knowledgeBases/*/documents/*}Z@*>/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}Z:*8/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}\x12\x97\x03\n\x0eUpdateDocument\x12\x31.google.cloud.dialogflow.v2.UpdateDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x02\xca\x41&\n\x08\x44ocument\x12\x1aKnowledgeOperationMetadata\xda\x41\x14\x64ocument,update_mask\x82\xd3\xe4\x93\x02\xeb\x01\x32;/v2/{document.name=projects/*/knowledgeBases/*/documents/*}:\x08\x64ocumentZS2G/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}:\x08\x64ocumentZM2A/v2/{document.name=projects/*/agent/knowledgeBases/*/documents/*}:\x08\x64ocument\x12\xf8\x02\n\x0eReloadDocument\x12\x31.google.cloud.dialogflow.v2.ReloadDocumentRequest\x1a\x1d.google.longrunning.Operation\"\x93\x02\xca\x41&\n\x08\x44ocument\x12\x1aKnowledgeOperationMetadata\xda\x41\x10name,content_uri\x82\xd3\xe4\x93\x02\xd0\x01\"9/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload:\x01*ZJ\"E/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload:\x01*ZD\"?/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload:\x01*\x12\x9f\x02\n\x0e\x45xportDocument\x12\x31.google.cloud.dialogflow.v2.ExportDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xba\x01\xca\x41&\n\x08\x44ocument\x12\x1aKnowledgeOperationMetadata\x82\xd3\xe4\x93\x02\x8a\x01\"9/v2/{name=projects/*/knowledgeBases/*/documents/*}:export:\x01*ZJ\"E/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:export:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x93\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\rDocumentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Document").msgclass + Document::ReloadStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Document.ReloadStatus").msgclass + Document::KnowledgeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Document.KnowledgeType").enummodule + Document::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Document.State").enummodule + GetDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetDocumentRequest").msgclass + ListDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListDocumentsRequest").msgclass + ListDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListDocumentsResponse").msgclass + CreateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateDocumentRequest").msgclass + ImportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportDocumentsRequest").msgclass + ImportDocumentTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportDocumentTemplate").msgclass + ImportDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportDocumentsResponse").msgclass + DeleteDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteDocumentRequest").msgclass + UpdateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateDocumentRequest").msgclass + ReloadDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ReloadDocumentRequest").msgclass + ExportDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ExportDocumentRequest").msgclass + ExportOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ExportOperationMetadata").msgclass + KnowledgeOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeOperationMetadata").msgclass + KnowledgeOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_services_pb.rb new file mode 100644 index 000000000000..d5f293a0501f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_services_pb.rb @@ -0,0 +1,119 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/document.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/document_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Documents + # Service for managing knowledge + # [Documents][google.cloud.dialogflow.v2.Document]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Documents' + + # Returns the list of all documents of the knowledge base. + rpc :ListDocuments, ::Google::Cloud::Dialogflow::V2::ListDocumentsRequest, ::Google::Cloud::Dialogflow::V2::ListDocumentsResponse + # Retrieves the specified document. + rpc :GetDocument, ::Google::Cloud::Dialogflow::V2::GetDocumentRequest, ::Google::Cloud::Dialogflow::V2::Document + # Creates a new document. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + # - `response`: [Document][google.cloud.dialogflow.v2.Document] + rpc :CreateDocument, ::Google::Cloud::Dialogflow::V2::CreateDocumentRequest, ::Google::Longrunning::Operation + # Creates documents by importing data from external sources. + # Dialogflow supports up to 350 documents in each request. If you try to + # import more, Dialogflow will return an error. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + # - `response`: + # [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] + rpc :ImportDocuments, ::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest, ::Google::Longrunning::Operation + # Deletes the specified document. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + rpc :DeleteDocument, ::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest, ::Google::Longrunning::Operation + # Updates the specified document. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + # - `response`: [Document][google.cloud.dialogflow.v2.Document] + rpc :UpdateDocument, ::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest, ::Google::Longrunning::Operation + # Reloads the specified document from its specified source, content_uri or + # content. The previously loaded content of the document will be deleted. + # Note: Even when the content of the document has not changed, there still + # may be side effects because of internal implementation changes. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + # - `response`: [Document][google.cloud.dialogflow.v2.Document] + # + # Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + # only use `projects.knowledgeBases.documents`. + rpc :ReloadDocument, ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest, ::Google::Longrunning::Operation + # Exports a smart messaging candidate document into the specified + # destination. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] + # - `response`: [Document][google.cloud.dialogflow.v2.Document] + rpc :ExportDocument, ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents.rb new file mode 100644 index 000000000000..a483b0d9f8b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/documents/credentials" +require "google/cloud/dialogflow/v2/documents/paths" +require "google/cloud/dialogflow/v2/documents/operations" +require "google/cloud/dialogflow/v2/documents/client" +require "google/cloud/dialogflow/v2/documents/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing knowledge + # {::Google::Cloud::Dialogflow::V2::Document Documents}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/documents" + # client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/documents/rest" + # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + module Documents + end + end + end + end +end + +helper_path = ::File.join __dir__, "documents", "helpers.rb" +require "google/cloud/dialogflow/v2/documents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb new file mode 100644 index 000000000000..4c487f772e30 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb @@ -0,0 +1,1354 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/document_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Documents + ## + # Client for the Documents service. + # + # Service for managing knowledge + # {::Google::Cloud::Dialogflow::V2::Document Documents}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :documents_stub + + ## + # Configure the Documents Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Documents::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Documents clients + # ::Google::Cloud::Dialogflow::V2::Documents::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Documents 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::Dialogflow::V2::Documents::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 + @documents_stub.universe_domain + end + + ## + # Create a new Documents client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Documents 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/dialogflow/v2/document_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 + + @documents_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Documents::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 + ) + + @documents_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 = @documents_stub.endpoint + config.universe_domain = @documents_stub.universe_domain + config.logger = @documents_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::Documents::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 + @documents_stub.logger + end + + # Service calls + + ## + # Returns the list of all documents of the knowledge base. + # + # @overload list_documents(request, options = nil) + # Pass arguments to `list_documents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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, filter: 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 knowledge base to list all documents for. + # Format: `projects//locations//knowledgeBases/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By + # default 10 and at most 100. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # @param filter [::String] + # The filter expression used to filter documents returned by the list method. + # The expression has the following syntax: + # + # [AND ] ... + # + # The following fields and operators are supported: + # + # * knowledge_types with has(:) operator + # * display_name with has(:) operator + # * state with equals(=) operator + # + # Examples: + # + # * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + # * "display_name:customer" matches documents whose display name contains + # "customer". + # * "state=ACTIVE" matches documents with ACTIVE state. + # * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + + @documents_stub.call_rpc :list_documents, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @documents_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 + + ## + # Retrieves the specified document. + # + # @overload get_document(request, options = nil) + # Pass arguments to `get_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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. The name of the document to retrieve. + # Format `projects//locations//knowledgeBases//documents/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Document] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Document] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + + @documents_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 + + ## + # Creates a new document. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} + # + # @overload create_document(request, options = nil) + # Pass arguments to `create_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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) + # 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 knowledge base to create a document for. + # Format: `projects//locations//knowledgeBases/`. + # @param document [::Google::Cloud::Dialogflow::V2::Document, ::Hash] + # Required. The document 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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new + # + # # Call the create_document method. + # result = client.create_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + + @documents_stub.call_rpc :create_document, 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 documents by importing data from external sources. + # Dialogflow supports up to 350 documents in each request. If you try to + # import more, Dialogflow will return an error. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ImportDocumentsResponse ImportDocumentsResponse} + # + # @overload import_documents(request, options = nil) + # Pass arguments to `import_documents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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(parent: nil, gcs_source: nil, document_template: nil, import_gcs_custom_metadata: 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 parent [::String] + # Required. The knowledge base to import documents into. + # Format: `projects//locations//knowledgeBases/`. + # @param gcs_source [::Google::Cloud::Dialogflow::V2::GcsSources, ::Hash] + # Optional. The Google Cloud Storage location for the documents. + # The path can include a wildcard. + # + # These URIs may have the forms + # `gs:///`. + # `gs:////*.`. + # @param document_template [::Google::Cloud::Dialogflow::V2::ImportDocumentTemplate, ::Hash] + # Required. Document template used for importing all the documents. + # @param import_gcs_custom_metadata [::Boolean] + # Whether to import custom metadata from Google Cloud Storage. + # Only valid when the document source is Google Cloud Storage URI. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + + @documents_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 + + ## + # Deletes the specified document. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload delete_document(request, options = nil) + # Pass arguments to `delete_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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. The name of the document to delete. + # Format: `projects//locations//knowledgeBases//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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new + # + # # Call the delete_document method. + # result = client.delete_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + + @documents_stub.call_rpc :delete_document, 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 the specified document. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} + # + # @overload update_document(request, options = nil) + # Pass arguments to `update_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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, 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::Dialogflow::V2::Document, ::Hash] + # Required. The document to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Not specified means `update all`. + # Currently, only `display_name` can be updated, an InvalidArgument will be + # returned for attempting to update other fields. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new + # + # # Call the update_document method. + # result = client.update_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + + @documents_stub.call_rpc :update_document, 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 + + ## + # Reloads the specified document from its specified source, content_uri or + # content. The previously loaded content of the document will be deleted. + # Note: Even when the content of the document has not changed, there still + # may be side effects because of internal implementation changes. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} + # + # Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + # only use `projects.knowledgeBases.documents`. + # + # @overload reload_document(request, options = nil) + # Pass arguments to `reload_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reload_document(name: nil, content_uri: nil, import_gcs_custom_metadata: nil, smart_messaging_partial_update: nil) + # Pass arguments to `reload_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. The name of the document to reload. + # Format: `projects//locations//knowledgeBases//documents/` + # @param content_uri [::String] + # Optional. The path of gcs source file for reloading document content. For + # now, only gcs uri is supported. + # + # For documents stored in Google Cloud Storage, these URIs must have + # the form `gs:///`. + # @param import_gcs_custom_metadata [::Boolean] + # Optional. Whether to import custom metadata from Google Cloud Storage. + # Only valid when the document source is Google Cloud Storage URI. + # @param smart_messaging_partial_update [::Boolean] + # Optional. When enabled, the reload request is to apply partial update to + # the smart messaging allowlist. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new + # + # # Call the reload_document method. + # result = client.reload_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 reload_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.reload_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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.reload_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reload_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @documents_stub.call_rpc :reload_document, 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 + + ## + # Exports a smart messaging candidate document into the specified + # destination. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} + # + # @overload export_document(request, options = nil) + # Pass arguments to `export_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ExportDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ExportDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload export_document(name: nil, gcs_destination: nil, export_full_content: nil, smart_messaging_partial_update: nil) + # Pass arguments to `export_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. The name of the document to export. + # Format: `projects//locations//knowledgeBases//documents/`. + # @param gcs_destination [::Google::Cloud::Dialogflow::V2::GcsDestination, ::Hash] + # Cloud Storage file path to export the document. + # @param export_full_content [::Boolean] + # When enabled, export the full content of the document including empirical + # probability. + # @param smart_messaging_partial_update [::Boolean] + # When enabled, export the smart messaging allowlist document for partial + # update. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new + # + # # Call the export_document method. + # result = client.export_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 export_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.export_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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.export_document.timeout, + metadata: metadata, + retry_policy: @config.rpcs.export_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @documents_stub.call_rpc :export_document, 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 Documents API. + # + # This class represents the configuration for Documents, + # 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::Dialogflow::V2::Documents::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_documents to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Documents::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_documents.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_documents.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::Dialogflow::V2::Documents::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Documents 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_documents + ## + # RPC-specific configuration for `get_document` + # @return [::Gapic::Config::Method] + # + attr_reader :get_document + ## + # RPC-specific configuration for `create_document` + # @return [::Gapic::Config::Method] + # + attr_reader :create_document + ## + # RPC-specific configuration for `import_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_documents + ## + # RPC-specific configuration for `delete_document` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_document + ## + # RPC-specific configuration for `update_document` + # @return [::Gapic::Config::Method] + # + attr_reader :update_document + ## + # RPC-specific configuration for `reload_document` + # @return [::Gapic::Config::Method] + # + attr_reader :reload_document + ## + # RPC-specific configuration for `export_document` + # @return [::Gapic::Config::Method] + # + attr_reader :export_document + + # @private + def initialize parent_rpcs = nil + list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents + @list_documents = ::Gapic::Config::Method.new list_documents_config + get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document + @get_document = ::Gapic::Config::Method.new get_document_config + create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document + @create_document = ::Gapic::Config::Method.new create_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 + delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document + @delete_document = ::Gapic::Config::Method.new delete_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 + reload_document_config = parent_rpcs.reload_document if parent_rpcs.respond_to? :reload_document + @reload_document = ::Gapic::Config::Method.new reload_document_config + export_document_config = parent_rpcs.export_document if parent_rpcs.respond_to? :export_document + @export_document = ::Gapic::Config::Method.new export_document_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/credentials.rb new file mode 100644 index 000000000000..85a7f2b9db14 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Documents + # Credentials for the Documents API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb new file mode 100644 index 000000000000..5c59147e0efc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module Documents + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Documents 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 Documents 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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/paths.rb new file mode 100644 index 000000000000..422e7cfc8ecf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/paths.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 Dialogflow + module V2 + module Documents + # Path helper methods for the Documents API. + module Paths + ## + # Create a fully-qualified Document resource string. + # + # @overload document_path(project:, knowledge_base:, document:) + # The resource will be in the following format: + # + # `projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}` + # + # @param project [String] + # @param knowledge_base [String] + # @param document [String] + # + # @overload document_path(project:, location:, knowledge_base:, document:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}` + # + # @param project [String] + # @param location [String] + # @param knowledge_base [String] + # @param document [String] + # + # @return [::String] + def document_path **args + resources = { + "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" + + "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}" + end), + "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" + + "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/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 KnowledgeBase resource string. + # + # @overload knowledge_base_path(project:, knowledge_base:) + # The resource will be in the following format: + # + # `projects/{project}/knowledgeBases/{knowledge_base}` + # + # @param project [String] + # @param knowledge_base [String] + # + # @overload knowledge_base_path(project:, location:, knowledge_base:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}` + # + # @param project [String] + # @param location [String] + # @param knowledge_base [String] + # + # @return [::String] + def knowledge_base_path **args + resources = { + "knowledge_base:project" => (proc do |project:, knowledge_base:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/knowledgeBases/#{knowledge_base}" + end), + "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest.rb new file mode 100644 index 000000000000..c04a2b4e8c03 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/documents/credentials" +require "google/cloud/dialogflow/v2/documents/paths" +require "google/cloud/dialogflow/v2/documents/rest/operations" +require "google/cloud/dialogflow/v2/documents/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing knowledge + # {::Google::Cloud::Dialogflow::V2::Document Documents}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/documents/rest" + # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + module Documents + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/documents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb new file mode 100644 index 000000000000..8cdca1dc7396 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb @@ -0,0 +1,1263 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/document_pb" +require "google/cloud/dialogflow/v2/documents/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Documents + module Rest + ## + # REST client for the Documents service. + # + # Service for managing knowledge + # {::Google::Cloud::Dialogflow::V2::Document Documents}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :documents_stub + + ## + # Configure the Documents Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Documents::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Documents clients + # ::Google::Cloud::Dialogflow::V2::Documents::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Documents 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::Dialogflow::V2::Documents::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 + @documents_stub.universe_domain + end + + ## + # Create a new Documents REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Documents 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::Dialogflow::V2::Documents::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 + + @documents_stub = ::Google::Cloud::Dialogflow::V2::Documents::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @documents_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 = @documents_stub.endpoint + config.universe_domain = @documents_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @documents_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::Documents::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 + @documents_stub.logger + end + + # Service calls + + ## + # Returns the list of all documents of the knowledge base. + # + # @overload list_documents(request, options = nil) + # Pass arguments to `list_documents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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, filter: 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 knowledge base to list all documents for. + # Format: `projects//locations//knowledgeBases/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By + # default 10 and at most 100. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # @param filter [::String] + # The filter expression used to filter documents returned by the list method. + # The expression has the following syntax: + # + # [AND ] ... + # + # The following fields and operators are supported: + # + # * knowledge_types with has(:) operator + # * display_name with has(:) operator + # * state with equals(=) operator + # + # Examples: + # + # * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + # * "display_name:customer" matches documents whose display name contains + # "customer". + # * "state=ACTIVE" matches documents with ACTIVE state. + # * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + @documents_stub.list_documents request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @documents_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 + + ## + # Retrieves the specified document. + # + # @overload get_document(request, options = nil) + # Pass arguments to `get_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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. The name of the document to retrieve. + # Format `projects//locations//knowledgeBases//documents/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Document] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new + # + # # Call the get_document method. + # result = client.get_document request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + @documents_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 + + ## + # Creates a new document. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} + # + # @overload create_document(request, options = nil) + # Pass arguments to `create_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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) + # 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 knowledge base to create a document for. + # Format: `projects//locations//knowledgeBases/`. + # @param document [::Google::Cloud::Dialogflow::V2::Document, ::Hash] + # Required. The document 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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new + # + # # Call the create_document method. + # result = client.create_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + @documents_stub.create_document 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 documents by importing data from external sources. + # Dialogflow supports up to 350 documents in each request. If you try to + # import more, Dialogflow will return an error. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: + # {::Google::Cloud::Dialogflow::V2::ImportDocumentsResponse ImportDocumentsResponse} + # + # @overload import_documents(request, options = nil) + # Pass arguments to `import_documents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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(parent: nil, gcs_source: nil, document_template: nil, import_gcs_custom_metadata: 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 parent [::String] + # Required. The knowledge base to import documents into. + # Format: `projects//locations//knowledgeBases/`. + # @param gcs_source [::Google::Cloud::Dialogflow::V2::GcsSources, ::Hash] + # Optional. The Google Cloud Storage location for the documents. + # The path can include a wildcard. + # + # These URIs may have the forms + # `gs:///`. + # `gs:////*.`. + # @param document_template [::Google::Cloud::Dialogflow::V2::ImportDocumentTemplate, ::Hash] + # Required. Document template used for importing all the documents. + # @param import_gcs_custom_metadata [::Boolean] + # Whether to import custom metadata from Google Cloud Storage. + # Only valid when the document source is Google Cloud Storage URI. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + @documents_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 + + ## + # Deletes the specified document. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # @overload delete_document(request, options = nil) + # Pass arguments to `delete_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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. The name of the document to delete. + # Format: `projects//locations//knowledgeBases//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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new + # + # # Call the delete_document method. + # result = client.delete_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + @documents_stub.delete_document 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 the specified document. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} + # + # @overload update_document(request, options = nil) + # Pass arguments to `update_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::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, 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::Dialogflow::V2::Document, ::Hash] + # Required. The document to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Not specified means `update all`. + # Currently, only `display_name` can be updated, an InvalidArgument will be + # returned for attempting to update other fields. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new + # + # # Call the update_document method. + # result = client.update_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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 + + @documents_stub.update_document 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 + + ## + # Reloads the specified document from its specified source, content_uri or + # content. The previously loaded content of the document will be deleted. + # Note: Even when the content of the document has not changed, there still + # may be side effects because of internal implementation changes. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} + # + # Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + # only use `projects.knowledgeBases.documents`. + # + # @overload reload_document(request, options = nil) + # Pass arguments to `reload_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reload_document(name: nil, content_uri: nil, import_gcs_custom_metadata: nil, smart_messaging_partial_update: nil) + # Pass arguments to `reload_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. The name of the document to reload. + # Format: `projects//locations//knowledgeBases//documents/` + # @param content_uri [::String] + # Optional. The path of gcs source file for reloading document content. For + # now, only gcs uri is supported. + # + # For documents stored in Google Cloud Storage, these URIs must have + # the form `gs:///`. + # @param import_gcs_custom_metadata [::Boolean] + # Optional. Whether to import custom metadata from Google Cloud Storage. + # Only valid when the document source is Google Cloud Storage URI. + # @param smart_messaging_partial_update [::Boolean] + # Optional. When enabled, the reload request is to apply partial update to + # the smart messaging allowlist. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new + # + # # Call the reload_document method. + # result = client.reload_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 reload_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.reload_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.reload_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reload_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @documents_stub.reload_document 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 + + ## + # Exports a smart messaging candidate document into the specified + # destination. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: + # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} + # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} + # + # @overload export_document(request, options = nil) + # Pass arguments to `export_document` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ExportDocumentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ExportDocumentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload export_document(name: nil, gcs_destination: nil, export_full_content: nil, smart_messaging_partial_update: nil) + # Pass arguments to `export_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. The name of the document to export. + # Format: `projects//locations//knowledgeBases//documents/`. + # @param gcs_destination [::Google::Cloud::Dialogflow::V2::GcsDestination, ::Hash] + # Cloud Storage file path to export the document. + # @param export_full_content [::Boolean] + # When enabled, export the full content of the document including empirical + # probability. + # @param smart_messaging_partial_update [::Boolean] + # When enabled, export the smart messaging allowlist document for partial + # update. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new + # + # # Call the export_document method. + # result = client.export_document request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 export_document request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.export_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.export_document.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.export_document.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @documents_stub.export_document 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 Documents REST API. + # + # This class represents the configuration for Documents 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::Dialogflow::V2::Documents::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_documents to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_documents.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_documents.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Documents 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_documents + ## + # RPC-specific configuration for `get_document` + # @return [::Gapic::Config::Method] + # + attr_reader :get_document + ## + # RPC-specific configuration for `create_document` + # @return [::Gapic::Config::Method] + # + attr_reader :create_document + ## + # RPC-specific configuration for `import_documents` + # @return [::Gapic::Config::Method] + # + attr_reader :import_documents + ## + # RPC-specific configuration for `delete_document` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_document + ## + # RPC-specific configuration for `update_document` + # @return [::Gapic::Config::Method] + # + attr_reader :update_document + ## + # RPC-specific configuration for `reload_document` + # @return [::Gapic::Config::Method] + # + attr_reader :reload_document + ## + # RPC-specific configuration for `export_document` + # @return [::Gapic::Config::Method] + # + attr_reader :export_document + + # @private + def initialize parent_rpcs = nil + list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents + @list_documents = ::Gapic::Config::Method.new list_documents_config + get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document + @get_document = ::Gapic::Config::Method.new get_document_config + create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document + @create_document = ::Gapic::Config::Method.new create_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 + delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document + @delete_document = ::Gapic::Config::Method.new delete_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 + reload_document_config = parent_rpcs.reload_document if parent_rpcs.respond_to? :reload_document + @reload_document = ::Gapic::Config::Method.new reload_document_config + export_document_config = parent_rpcs.export_document if parent_rpcs.respond_to? :export_document + @export_document = ::Gapic::Config::Method.new export_document_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb new file mode 100644 index 000000000000..9f381a7a3752 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb @@ -0,0 +1,947 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module Documents + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Documents 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 Documents 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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb new file mode 100644 index 000000000000..122413f47a76 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb @@ -0,0 +1,680 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/document_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Documents + module Rest + ## + # REST service stub for the Documents 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_documents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::ListDocumentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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 get_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Document] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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 create_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # 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::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_documents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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 delete_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # 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::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_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # 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::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 reload_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 reload_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reload_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: "reload_document", + 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 export_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ExportDocumentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 export_document request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_export_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: "export_document", + 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_documents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/documents", + matches: [ + ["parent", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/documents", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/documents", + matches: [ + ["parent", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/documents", + body: "document", + matches: [ + ["parent", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/documents", + body: "document", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/documents", + body: "document", + matches: [ + ["parent", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_documents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/documents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/documents:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{document.name}", + body: "document", + matches: [ + ["document.name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{document.name}", + body: "document", + matches: [ + ["document.name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{document.name}", + body: "document", + matches: [ + ["document.name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reload_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reload_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:reload", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:reload", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:reload", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the export_document REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ExportDocumentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_export_document_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:export", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_pb.rb new file mode 100644 index 000000000000..6062410d91a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_pb.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/encryption_spec.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' + + +descriptor_data = "\n0google/cloud/dialogflow/v2/encryption_spec.proto\x12\x1agoogle.cloud.dialogflow.v2\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\"Z\n\x18GetEncryptionSpecRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dialogflow.googleapis.com/EncryptionSpec\"\xc3\x01\n\x0e\x45ncryptionSpec\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x07kms_key\x18\x02 \x01(\tB\x03\xe0\x41\x02:\x87\x01\xea\x41\x83\x01\n(dialogflow.googleapis.com/EncryptionSpec\x12\x36projects/{project}/locations/{location}/encryptionSpec*\x0f\x65ncryptionSpecs2\x0e\x65ncryptionSpec\"k\n\x1fInitializeEncryptionSpecRequest\x12H\n\x0f\x65ncryption_spec\x18\x01 \x01(\x0b\x32*.google.cloud.dialogflow.v2.EncryptionSpecB\x03\xe0\x41\x02\"\"\n InitializeEncryptionSpecResponse\"u\n InitializeEncryptionSpecMetadata\x12Q\n\x07request\x18\x04 \x01(\x0b\x32;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequestB\x03\xe0\x41\x03\x32\xf5\x04\n\x15\x45ncryptionSpecService\x12\xb6\x01\n\x11GetEncryptionSpec\x12\x34.google.cloud.dialogflow.v2.GetEncryptionSpecRequest\x1a*.google.cloud.dialogflow.v2.EncryptionSpec\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v2/{name=projects/*/locations/*/encryptionSpec}\x12\xa8\x02\n\x18InitializeEncryptionSpec\x12;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest\x1a\x1d.google.longrunning.Operation\"\xaf\x01\xca\x41\x44\n InitializeEncryptionSpecResponse\x12 InitializeEncryptionSpecMetadata\xda\x41\x0f\x65ncryption_spec\x82\xd3\xe4\x93\x02P\"K/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x99\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x13\x45ncryptionSpecProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + GetEncryptionSpecRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEncryptionSpecRequest").msgclass + EncryptionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EncryptionSpec").msgclass + InitializeEncryptionSpecRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest").msgclass + InitializeEncryptionSpecResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InitializeEncryptionSpecResponse").msgclass + InitializeEncryptionSpecMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InitializeEncryptionSpecMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service.rb new file mode 100644 index 000000000000..048efc512b53 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/encryption_spec_service/credentials" +require "google/cloud/dialogflow/v2/encryption_spec_service/paths" +require "google/cloud/dialogflow/v2/encryption_spec_service/operations" +require "google/cloud/dialogflow/v2/encryption_spec_service/client" +require "google/cloud/dialogflow/v2/encryption_spec_service/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Manages encryption spec settings for Dialogflow and Agent Assist. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/encryption_spec_service" + # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/encryption_spec_service/rest" + # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new + # + module EncryptionSpecService + end + end + end + end +end + +helper_path = ::File.join __dir__, "encryption_spec_service", "helpers.rb" +require "google/cloud/dialogflow/v2/encryption_spec_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/client.rb new file mode 100644 index 000000000000..2fe652189650 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/client.rb @@ -0,0 +1,619 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/encryption_spec_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module EncryptionSpecService + ## + # Client for the EncryptionSpecService service. + # + # Manages encryption spec settings for Dialogflow and Agent Assist. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :encryption_spec_service_stub + + ## + # Configure the EncryptionSpecService Client class. + # + # See {::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EncryptionSpecService clients + # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::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 + @encryption_spec_service_stub.universe_domain + end + + ## + # Create a new EncryptionSpecService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EncryptionSpecService 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/dialogflow/v2/encryption_spec_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 + + @encryption_spec_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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 + ) + + @encryption_spec_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 = @encryption_spec_service_stub.endpoint + config.universe_domain = @encryption_spec_service_stub.universe_domain + config.logger = @encryption_spec_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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 + @encryption_spec_service_stub.logger + end + + # Service calls + + ## + # Gets location-level encryption key specification. + # + # @overload get_encryption_spec(request, options = nil) + # Pass arguments to `get_encryption_spec` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_encryption_spec(name: nil) + # Pass arguments to `get_encryption_spec` via keyword arguments. Note that at + # least one keyword argument is required. To 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 encryption spec resource to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::EncryptionSpec] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpec] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new + # + # # Call the get_encryption_spec method. + # result = client.get_encryption_spec request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EncryptionSpec. + # p result + # + def get_encryption_spec request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest + + # Converts hash and nil to 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_encryption_spec.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_encryption_spec.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_encryption_spec.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @encryption_spec_service_stub.call_rpc :get_encryption_spec, 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 + + ## + # Initializes a location-level encryption key specification. An error will + # be thrown if the location has resources already created before the + # initialization. Once the encryption specification is initialized at a + # location, it is immutable and all newly created resources under the + # location will be encrypted with the existing specification. + # + # @overload initialize_encryption_spec(request, options = nil) + # Pass arguments to `initialize_encryption_spec` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload initialize_encryption_spec(encryption_spec: nil) + # Pass arguments to `initialize_encryption_spec` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param encryption_spec [::Google::Cloud::Dialogflow::V2::EncryptionSpec, ::Hash] + # Required. The encryption spec used for CMEK encryption. It is required that + # the kms key is in the same region as the endpoint. The same key will be + # used for all provisioned resources, if encryption is available. If the + # kms_key_name is left empty, no encryption will be enforced. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new + # + # # Call the initialize_encryption_spec method. + # result = client.initialize_encryption_spec request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 initialize_encryption_spec request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.initialize_encryption_spec.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.encryption_spec&.name + header_params["encryption_spec.name"] = request.encryption_spec.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.initialize_encryption_spec.timeout, + metadata: metadata, + retry_policy: @config.rpcs.initialize_encryption_spec.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @encryption_spec_service_stub.call_rpc :initialize_encryption_spec, 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 EncryptionSpecService API. + # + # This class represents the configuration for EncryptionSpecService, + # 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::Dialogflow::V2::EncryptionSpecService::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_encryption_spec to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_encryption_spec.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_encryption_spec.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::Dialogflow::V2::EncryptionSpecService::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 EncryptionSpecService 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_encryption_spec` + # @return [::Gapic::Config::Method] + # + attr_reader :get_encryption_spec + ## + # RPC-specific configuration for `initialize_encryption_spec` + # @return [::Gapic::Config::Method] + # + attr_reader :initialize_encryption_spec + + # @private + def initialize parent_rpcs = nil + get_encryption_spec_config = parent_rpcs.get_encryption_spec if parent_rpcs.respond_to? :get_encryption_spec + @get_encryption_spec = ::Gapic::Config::Method.new get_encryption_spec_config + initialize_encryption_spec_config = parent_rpcs.initialize_encryption_spec if parent_rpcs.respond_to? :initialize_encryption_spec + @initialize_encryption_spec = ::Gapic::Config::Method.new initialize_encryption_spec_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/credentials.rb new file mode 100644 index 000000000000..87ea83d090ba --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module EncryptionSpecService + # Credentials for the EncryptionSpecService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/operations.rb new file mode 100644 index 000000000000..ee38ffdecbbc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module EncryptionSpecService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the EncryptionSpecService 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 EncryptionSpecService 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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/paths.rb new file mode 100644 index 000000000000..9312f50d4940 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/paths.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! + + +module Google + module Cloud + module Dialogflow + module V2 + module EncryptionSpecService + # Path helper methods for the EncryptionSpecService API. + module Paths + ## + # Create a fully-qualified EncryptionSpec resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/encryptionSpec` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def encryption_spec_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/encryptionSpec" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest.rb new file mode 100644 index 000000000000..07f9f47f31c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/encryption_spec_service/credentials" +require "google/cloud/dialogflow/v2/encryption_spec_service/paths" +require "google/cloud/dialogflow/v2/encryption_spec_service/rest/operations" +require "google/cloud/dialogflow/v2/encryption_spec_service/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Manages encryption spec settings for Dialogflow and Agent Assist. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/encryption_spec_service/rest" + # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new + # + module EncryptionSpecService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/encryption_spec_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/client.rb new file mode 100644 index 000000000000..185030bca83f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/client.rb @@ -0,0 +1,570 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/encryption_spec_pb" +require "google/cloud/dialogflow/v2/encryption_spec_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module EncryptionSpecService + module Rest + ## + # REST client for the EncryptionSpecService service. + # + # Manages encryption spec settings for Dialogflow and Agent Assist. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :encryption_spec_service_stub + + ## + # Configure the EncryptionSpecService Client class. + # + # See {::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EncryptionSpecService clients + # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::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 + @encryption_spec_service_stub.universe_domain + end + + ## + # Create a new EncryptionSpecService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::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 + + @encryption_spec_service_stub = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @encryption_spec_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 = @encryption_spec_service_stub.endpoint + config.universe_domain = @encryption_spec_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @encryption_spec_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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 + @encryption_spec_service_stub.logger + end + + # Service calls + + ## + # Gets location-level encryption key specification. + # + # @overload get_encryption_spec(request, options = nil) + # Pass arguments to `get_encryption_spec` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_encryption_spec(name: nil) + # Pass arguments to `get_encryption_spec` via keyword arguments. Note that at + # least one keyword argument is required. To 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 encryption spec resource to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::EncryptionSpec] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpec] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new + # + # # Call the get_encryption_spec method. + # result = client.get_encryption_spec request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EncryptionSpec. + # p result + # + def get_encryption_spec request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest + + # Converts hash and nil to an 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_encryption_spec.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_encryption_spec.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_encryption_spec.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @encryption_spec_service_stub.get_encryption_spec 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 + + ## + # Initializes a location-level encryption key specification. An error will + # be thrown if the location has resources already created before the + # initialization. Once the encryption specification is initialized at a + # location, it is immutable and all newly created resources under the + # location will be encrypted with the existing specification. + # + # @overload initialize_encryption_spec(request, options = nil) + # Pass arguments to `initialize_encryption_spec` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload initialize_encryption_spec(encryption_spec: nil) + # Pass arguments to `initialize_encryption_spec` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param encryption_spec [::Google::Cloud::Dialogflow::V2::EncryptionSpec, ::Hash] + # Required. The encryption spec used for CMEK encryption. It is required that + # the kms key is in the same region as the endpoint. The same key will be + # used for all provisioned resources, if encryption is available. If the + # kms_key_name is left empty, no encryption will be enforced. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new + # + # # Call the initialize_encryption_spec method. + # result = client.initialize_encryption_spec request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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 initialize_encryption_spec request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.initialize_encryption_spec.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.initialize_encryption_spec.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.initialize_encryption_spec.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @encryption_spec_service_stub.initialize_encryption_spec 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 EncryptionSpecService REST API. + # + # This class represents the configuration for EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::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_encryption_spec to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_encryption_spec.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_encryption_spec.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 EncryptionSpecService 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_encryption_spec` + # @return [::Gapic::Config::Method] + # + attr_reader :get_encryption_spec + ## + # RPC-specific configuration for `initialize_encryption_spec` + # @return [::Gapic::Config::Method] + # + attr_reader :initialize_encryption_spec + + # @private + def initialize parent_rpcs = nil + get_encryption_spec_config = parent_rpcs.get_encryption_spec if parent_rpcs.respond_to? :get_encryption_spec + @get_encryption_spec = ::Gapic::Config::Method.new get_encryption_spec_config + initialize_encryption_spec_config = parent_rpcs.initialize_encryption_spec if parent_rpcs.respond_to? :initialize_encryption_spec + @initialize_encryption_spec = ::Gapic::Config::Method.new initialize_encryption_spec_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/operations.rb new file mode 100644 index 000000000000..c98366afb3a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/operations.rb @@ -0,0 +1,947 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module EncryptionSpecService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the EncryptionSpecService 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 EncryptionSpecService 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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/service_stub.rb new file mode 100644 index 000000000000..67a69af2e0f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/encryption_spec_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module EncryptionSpecService + module Rest + ## + # REST service stub for the EncryptionSpecService 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_encryption_spec REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::EncryptionSpec] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpec] + # A result object deserialized from the server's reply + def get_encryption_spec request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_encryption_spec_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_encryption_spec", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::EncryptionSpec.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the initialize_encryption_spec REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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 initialize_encryption_spec request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_initialize_encryption_spec_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "initialize_encryption_spec", + 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_encryption_spec REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest] + # 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_encryption_spec_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/encryptionSpec/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the initialize_encryption_spec REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_initialize_encryption_spec_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{encryption_spec.name}:initialize", + body: "*", + matches: [ + ["encryption_spec.name", %r{^projects/[^/]+/locations/[^/]+/encryptionSpec/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_services_pb.rb new file mode 100644 index 000000000000..9b1cc6ee4edc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/encryption_spec.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/encryption_spec_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module EncryptionSpecService + # Manages encryption spec settings for Dialogflow and Agent Assist. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.EncryptionSpecService' + + # Gets location-level encryption key specification. + rpc :GetEncryptionSpec, ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest, ::Google::Cloud::Dialogflow::V2::EncryptionSpec + # Initializes a location-level encryption key specification. An error will + # be thrown if the location has resources already created before the + # initialization. Once the encryption specification is initialized at a + # location, it is immutable and all newly created resources under the + # location will be encrypted with the existing specification. + rpc :InitializeEncryptionSpec, ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_pb.rb new file mode 100644 index 000000000000..447ed3f86939 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/entity_type.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/field_mask_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n,google/cloud/dialogflow/v2/entity_type.proto\x12\x1agoogle.cloud.dialogflow.v2\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 google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xc3\x05\n\nEntityType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12>\n\x04kind\x18\x03 \x01(\x0e\x32+.google.cloud.dialogflow.v2.EntityType.KindB\x03\xe0\x41\x02\x12Z\n\x13\x61uto_expansion_mode\x18\x04 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.EntityType.AutoExpansionModeB\x03\xe0\x41\x01\x12\x44\n\x08\x65ntities\x18\x06 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xe0\x41\x01\x12$\n\x17\x65nable_fuzzy_extraction\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x33\n\x06\x45ntity\x12\x12\n\x05value\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08synonyms\x18\x02 \x03(\tB\x03\xe0\x41\x02\"J\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x0c\n\x08KIND_MAP\x10\x01\x12\r\n\tKIND_LIST\x10\x02\x12\x0f\n\x0bKIND_REGEXP\x10\x03\"Y\n\x11\x41utoExpansionMode\x12#\n\x1f\x41UTO_EXPANSION_MODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x41UTO_EXPANSION_MODE_DEFAULT\x10\x01:\xa7\x01\xea\x41\xa3\x01\n$dialogflow.googleapis.com/EntityType\x12\x32projects/{project}/agent/entityTypes/{entity_type}\x12Gprojects/{project}/locations/{location}/agent/entityTypes/{entity_type}\"\xa3\x01\n\x16ListEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"p\n\x17ListEntityTypesResponse\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.v2.EntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"n\n\x14GetEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb5\x01\n\x17\x43reateEntityTypeRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12@\n\x0b\x65ntity_type\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EntityTypeB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n\x17UpdateEntityTypeRequest\x12@\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EntityTypeB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"U\n\x17\x44\x65leteEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\"\xb6\x02\n\x1d\x42\x61tchUpdateEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x1f\n\x15\x65ntity_type_batch_uri\x18\x02 \x01(\tH\x00\x12O\n\x18\x65ntity_type_batch_inline\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.v2.EntityTypeBatchH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x42\x13\n\x11\x65ntity_type_batch\"^\n\x1e\x42\x61tchUpdateEntityTypesResponse\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.v2.EntityType\"}\n\x1d\x42\x61tchDeleteEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x1e\n\x11\x65ntity_type_names\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xbc\x01\n\x1a\x42\x61tchCreateEntitiesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x44\n\x08\x65ntities\x18\x02 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xf2\x01\n\x1a\x42\x61tchUpdateEntitiesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x44\n\x08\x65ntities\x18\x02 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x92\x01\n\x1a\x42\x61tchDeleteEntitiesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x1a\n\rentity_values\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\"O\n\x0f\x45ntityTypeBatch\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.v2.EntityType2\xd6\x19\n\x0b\x45ntityTypes\x12\x87\x02\n\x0fListEntityTypes\x12\x32.google.cloud.dialogflow.v2.ListEntityTypesRequest\x1a\x33.google.cloud.dialogflow.v2.ListEntityTypesResponse\"\x8a\x01\xda\x41\x06parent\xda\x41\x14parent,language_code\x82\xd3\xe4\x93\x02\x64\x12)/v2/{parent=projects/*/agent}/entityTypesZ7\x12\x35/v2/{parent=projects/*/locations/*/agent}/entityTypes\x12\xf2\x01\n\rGetEntityType\x12\x30.google.cloud.dialogflow.v2.GetEntityTypeRequest\x1a&.google.cloud.dialogflow.v2.EntityType\"\x86\x01\xda\x41\x04name\xda\x41\x12name,language_code\x82\xd3\xe4\x93\x02\x64\x12)/v2/{name=projects/*/agent/entityTypes/*}Z7\x12\x35/v2/{name=projects/*/locations/*/agent/entityTypes/*}\x12\xae\x02\n\x10\x43reateEntityType\x12\x33.google.cloud.dialogflow.v2.CreateEntityTypeRequest\x1a&.google.cloud.dialogflow.v2.EntityType\"\xbc\x01\xda\x41\x12parent,entity_type\xda\x41 parent,entity_type,language_code\x82\xd3\xe4\x93\x02~\")/v2/{parent=projects/*/agent}/entityTypes:\x0b\x65ntity_typeZD\"5/v2/{parent=projects/*/locations/*/agent}/entityTypes:\x0b\x65ntity_type\x12\xb9\x02\n\x10UpdateEntityType\x12\x33.google.cloud.dialogflow.v2.UpdateEntityTypeRequest\x1a&.google.cloud.dialogflow.v2.EntityType\"\xc7\x01\xda\x41\x0b\x65ntity_type\xda\x41\x19\x65ntity_type,language_code\x82\xd3\xe4\x93\x02\x96\x01\x32\x35/v2/{entity_type.name=projects/*/agent/entityTypes/*}:\x0b\x65ntity_typeZP2A/v2/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}:\x0b\x65ntity_type\x12\xd2\x01\n\x10\x44\x65leteEntityType\x12\x33.google.cloud.dialogflow.v2.DeleteEntityTypeRequest\x1a\x16.google.protobuf.Empty\"q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x64*)/v2/{name=projects/*/agent/entityTypes/*}Z7*5/v2/{name=projects/*/locations/*/agent/entityTypes/*}\x12\xd4\x02\n\x16\x42\x61tchUpdateEntityTypes\x12\x39.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"\xdf\x01\xca\x41S\n9google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x82\x01\"5/v2/{parent=projects/*/agent}/entityTypes:batchUpdate:\x01*ZF\"A/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate:\x01*\x12\xcb\x02\n\x16\x42\x61tchDeleteEntityTypes\x12\x39.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"\xd6\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x18parent,entity_type_names\x82\xd3\xe4\x93\x02\x82\x01\"5/v2/{parent=projects/*/agent}/entityTypes:batchDelete:\x01*ZF\"A/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete:\x01*\x12\xf2\x02\n\x13\x42\x61tchCreateEntities\x12\x36.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x02\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x0fparent,entities\xda\x41\x1dparent,entities,language_code\x82\xd3\xe4\x93\x02\x98\x01\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate:\x01*ZQ\"L/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate:\x01*\x12\xf2\x02\n\x13\x42\x61tchUpdateEntities\x12\x36.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x02\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x0fparent,entities\xda\x41\x1dparent,entities,language_code\x82\xd3\xe4\x93\x02\x98\x01\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate:\x01*ZQ\"L/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate:\x01*\x12\xfc\x02\n\x13\x42\x61tchDeleteEntities\x12\x36.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x02\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x14parent,entity_values\xda\x41\"parent,entity_values,language_code\x82\xd3\xe4\x93\x02\x98\x01\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete:\x01*ZQ\"L/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x95\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0f\x45ntityTypeProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType").msgclass + EntityType::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.Entity").msgclass + EntityType::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.Kind").enummodule + EntityType::AutoExpansionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.AutoExpansionMode").enummodule + ListEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEntityTypesRequest").msgclass + ListEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEntityTypesResponse").msgclass + GetEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEntityTypeRequest").msgclass + CreateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateEntityTypeRequest").msgclass + UpdateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateEntityTypeRequest").msgclass + DeleteEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteEntityTypeRequest").msgclass + BatchUpdateEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest").msgclass + BatchUpdateEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse").msgclass + BatchDeleteEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest").msgclass + BatchCreateEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchCreateEntitiesRequest").msgclass + BatchUpdateEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest").msgclass + BatchDeleteEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest").msgclass + EntityTypeBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityTypeBatch").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb new file mode 100644 index 000000000000..c04f16523e7f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb @@ -0,0 +1,143 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/entity_type.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/entity_type_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module EntityTypes + # Service for managing [EntityTypes][google.cloud.dialogflow.v2.EntityType]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.EntityTypes' + + # Returns the list of all entity types in the specified agent. + rpc :ListEntityTypes, ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, ::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse + # Retrieves the specified entity type. + rpc :GetEntityType, ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::EntityType + # Creates an entity type in the specified agent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :CreateEntityType, ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::EntityType + # Updates the specified entity type. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :UpdateEntityType, ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::EntityType + # Deletes the specified entity type. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :DeleteEntityType, ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, ::Google::Protobuf::Empty + # Updates/Creates multiple entity types in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse] + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :BatchUpdateEntityTypes, ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, ::Google::Longrunning::Operation + # Deletes entity types in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :BatchDeleteEntityTypes, ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, ::Google::Longrunning::Operation + # Creates multiple new entities in the specified entity type. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :BatchCreateEntities, ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, ::Google::Longrunning::Operation + # Updates or creates multiple entities in the specified entity type. This + # method does not affect entities in the entity type that aren't explicitly + # specified in the request. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + rpc :BatchUpdateEntities, ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, ::Google::Longrunning::Operation + # Deletes entities in the specified entity type. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :BatchDeleteEntities, ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types.rb new file mode 100644 index 000000000000..1814288b807b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/entity_types/credentials" +require "google/cloud/dialogflow/v2/entity_types/paths" +require "google/cloud/dialogflow/v2/entity_types/operations" +require "google/cloud/dialogflow/v2/entity_types/client" +require "google/cloud/dialogflow/v2/entity_types/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/entity_types" + # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/entity_types/rest" + # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + module EntityTypes + end + end + end + end +end + +helper_path = ::File.join __dir__, "entity_types", "helpers.rb" +require "google/cloud/dialogflow/v2/entity_types/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb new file mode 100644 index 000000000000..909e6fc7024f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb @@ -0,0 +1,1561 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/entity_type_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module EntityTypes + ## + # Client for the EntityTypes service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :entity_types_stub + + ## + # Configure the EntityTypes Client class. + # + # See {::Google::Cloud::Dialogflow::V2::EntityTypes::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EntityTypes clients + # ::Google::Cloud::Dialogflow::V2::EntityTypes::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EntityTypes 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::Dialogflow::V2::EntityTypes::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 + @entity_types_stub.universe_domain + end + + ## + # Create a new EntityTypes client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EntityTypes 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/dialogflow/v2/entity_type_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 + + @entity_types_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::EntityTypes::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 + ) + + @entity_types_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 = @entity_types_stub.endpoint + config.universe_domain = @entity_types_stub.universe_domain + config.logger = @entity_types_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::EntityTypes::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 + @entity_types_stub.logger + end + + # Service calls + + ## + # Returns the list of all entity types in the specified agent. + # + # @overload list_entity_types(request, options = nil) + # Pass arguments to `list_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_entity_types` via keyword arguments. Note that at + # least one keyword argument is 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 agent to list all entity types from. + # Format: `projects//agent`. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new + # + # # Call the list_entity_types method. + # result = client.list_entity_types 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::Dialogflow::V2::EntityType. + # p item + # end + # + def list_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest + + # Converts hash and nil to 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_entity_types.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entity_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :list_entity_types, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @entity_types_stub, :list_entity_types, 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 + + ## + # Retrieves the specified entity type. + # + # @overload get_entity_type(request, options = nil) + # Pass arguments to `get_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(name: nil, language_code: nil) + # Pass arguments to `get_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To 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 entity type. + # Format: `projects//agent/entityTypes/`. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::EntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new + # + # # Call the get_entity_type method. + # result = client.get_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + # p result + # + def get_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest + + # Converts hash and nil to 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :get_entity_type, 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 an entity type in the specified agent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload create_entity_type(request, options = nil) + # Pass arguments to `create_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(parent: nil, entity_type: nil, language_code: nil) + # Pass arguments to `create_entity_type` via keyword arguments. Note that at + # least one keyword argument is 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 agent to create a entity type for. + # Format: `projects//agent`. + # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash] + # Required. The entity type to create. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::EntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new + # + # # Call the create_entity_type method. + # result = client.create_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + # p result + # + def create_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest + + # Converts hash and nil to 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :create_entity_type, 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 the specified entity type. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload update_entity_type(request, options = nil) + # Pass arguments to `update_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(entity_type: nil, language_code: nil, update_mask: nil) + # Pass arguments to `update_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash] + # Required. The entity type to update. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::EntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new + # + # # Call the update_entity_type method. + # result = client.update_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + # p result + # + def update_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest + + # Converts hash and nil to 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.entity_type&.name + header_params["entity_type.name"] = request.entity_type.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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :update_entity_type, 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 specified entity type. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload delete_entity_type(request, options = nil) + # Pass arguments to `delete_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(name: nil) + # Pass arguments to `delete_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To 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 entity type to delete. + # Format: `projects//agent/entityTypes/`. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new + # + # # Call the delete_entity_type method. + # result = client.delete_entity_type request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest + + # Converts hash and nil to 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :delete_entity_type, 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/Creates multiple entity types in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse} + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_update_entity_types(request, options = nil) + # Pass arguments to `batch_update_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_type_batch_uri: nil, entity_type_batch_inline: nil, language_code: nil, update_mask: nil) + # Pass arguments to `batch_update_entity_types` via keyword arguments. Note that at + # least one keyword argument is 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 name of the agent to update or create entity types in. + # Format: `projects//agent`. + # @param entity_type_batch_uri [::String] + # The URI to a Google Cloud Storage file containing entity types to update + # or create. The file format can either be a serialized proto (of + # EntityBatch type) or a JSON object. Note: The URI must start with + # "gs://". + # + # Note: The following parameters are mutually exclusive: `entity_type_batch_uri`, `entity_type_batch_inline`. 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 entity_type_batch_inline [::Google::Cloud::Dialogflow::V2::EntityTypeBatch, ::Hash] + # The collection of entity types to update or create. + # + # Note: The following parameters are mutually exclusive: `entity_type_batch_inline`, `entity_type_batch_uri`. 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 language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new + # + # # Call the batch_update_entity_types method. + # result = client.batch_update_entity_types request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest + + # Converts hash and nil to 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_entity_types.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entity_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_update_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :batch_update_entity_types, 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 entity types in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_delete_entity_types(request, options = nil) + # Pass arguments to `batch_delete_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_delete_entity_types(parent: nil, entity_type_names: nil) + # Pass arguments to `batch_delete_entity_types` via keyword arguments. Note that at + # least one keyword argument is 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 name of the agent to delete all entities types for. Format: + # `projects//agent`. + # @param entity_type_names [::Array<::String>] + # Required. The names entity types to delete. All names must point to the + # same agent as `parent`. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new + # + # # Call the batch_delete_entity_types method. + # result = client.batch_delete_entity_types request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_delete_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest + + # Converts hash and nil to 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_delete_entity_types.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_delete_entity_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_delete_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :batch_delete_entity_types, 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 multiple new entities in the specified entity type. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_create_entities(request, options = nil) + # Pass arguments to `batch_create_entities` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entities(parent: nil, entities: nil, language_code: nil) + # Pass arguments to `batch_create_entities` via keyword arguments. Note that at + # least one keyword argument is 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 name of the entity type to create entities in. Format: + # `projects//agent/entityTypes/`. + # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>] + # Required. The entities to create. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new + # + # # Call the batch_create_entities method. + # result = client.batch_create_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_entities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest + + # Converts hash and nil to 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_entities.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entities.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_create_entities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :batch_create_entities, 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 or creates multiple entities in the specified entity type. This + # method does not affect entities in the entity type that aren't explicitly + # specified in the request. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_update_entities(request, options = nil) + # Pass arguments to `batch_update_entities` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entities(parent: nil, entities: nil, language_code: nil, update_mask: nil) + # Pass arguments to `batch_update_entities` via keyword arguments. Note that at + # least one keyword argument is 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 name of the entity type to update or create entities in. + # Format: `projects//agent/entityTypes/`. + # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>] + # Required. The entities to update or create. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new + # + # # Call the batch_update_entities method. + # result = client.batch_update_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_entities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest + + # Converts hash and nil to 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_entities.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entities.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_update_entities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :batch_update_entities, 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 entities in the specified entity type. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_delete_entities(request, options = nil) + # Pass arguments to `batch_delete_entities` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_delete_entities(parent: nil, entity_values: nil, language_code: nil) + # Pass arguments to `batch_delete_entities` via keyword arguments. Note that at + # least one keyword argument is 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 name of the entity type to delete entries for. Format: + # `projects//agent/entityTypes/`. + # @param entity_values [::Array<::String>] + # Required. The reference `values` of the entities to delete. Note that + # these are not fully-qualified names, i.e. they don't start with + # `projects/`. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new + # + # # Call the batch_delete_entities method. + # result = client.batch_delete_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_delete_entities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest + + # Converts hash and nil to 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_delete_entities.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_delete_entities.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_delete_entities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.call_rpc :batch_delete_entities, 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 EntityTypes API. + # + # This class represents the configuration for EntityTypes, + # 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::Dialogflow::V2::EntityTypes::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_entity_types to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_entity_types.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_entity_types.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::Dialogflow::V2::EntityTypes::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 EntityTypes 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entity_types + ## + # RPC-specific configuration for `get_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entity_type + ## + # RPC-specific configuration for `create_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entity_type + ## + # RPC-specific configuration for `update_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entity_type + ## + # RPC-specific configuration for `delete_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entity_type + ## + # RPC-specific configuration for `batch_update_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_entity_types + ## + # RPC-specific configuration for `batch_delete_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_entity_types + ## + # RPC-specific configuration for `batch_create_entities` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_entities + ## + # RPC-specific configuration for `batch_update_entities` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_entities + ## + # RPC-specific configuration for `batch_delete_entities` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_entities + + # @private + def initialize parent_rpcs = nil + list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types + @list_entity_types = ::Gapic::Config::Method.new list_entity_types_config + get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type + @get_entity_type = ::Gapic::Config::Method.new get_entity_type_config + create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type + @create_entity_type = ::Gapic::Config::Method.new create_entity_type_config + update_entity_type_config = parent_rpcs.update_entity_type if parent_rpcs.respond_to? :update_entity_type + @update_entity_type = ::Gapic::Config::Method.new update_entity_type_config + delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type + @delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config + batch_update_entity_types_config = parent_rpcs.batch_update_entity_types if parent_rpcs.respond_to? :batch_update_entity_types + @batch_update_entity_types = ::Gapic::Config::Method.new batch_update_entity_types_config + batch_delete_entity_types_config = parent_rpcs.batch_delete_entity_types if parent_rpcs.respond_to? :batch_delete_entity_types + @batch_delete_entity_types = ::Gapic::Config::Method.new batch_delete_entity_types_config + batch_create_entities_config = parent_rpcs.batch_create_entities if parent_rpcs.respond_to? :batch_create_entities + @batch_create_entities = ::Gapic::Config::Method.new batch_create_entities_config + batch_update_entities_config = parent_rpcs.batch_update_entities if parent_rpcs.respond_to? :batch_update_entities + @batch_update_entities = ::Gapic::Config::Method.new batch_update_entities_config + batch_delete_entities_config = parent_rpcs.batch_delete_entities if parent_rpcs.respond_to? :batch_delete_entities + @batch_delete_entities = ::Gapic::Config::Method.new batch_delete_entities_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/credentials.rb new file mode 100644 index 000000000000..34cbbc55eef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module EntityTypes + # Credentials for the EntityTypes API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb new file mode 100644 index 000000000000..0b17a8443b03 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module EntityTypes + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the EntityTypes 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 EntityTypes 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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/paths.rb new file mode 100644 index 000000000000..c41806b6b9a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/paths.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module EntityTypes + # Path helper methods for the EntityTypes API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # @overload agent_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/agent` + # + # @param project [String] + # + # @overload agent_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def agent_path **args + resources = { + "project" => (proc do |project:| + "projects/#{project}/agent" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent" + 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 EntityType resource string. + # + # @overload entity_type_path(project:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/agent/entityTypes/{entity_type}` + # + # @param project [String] + # @param entity_type [String] + # + # @overload entity_type_path(project:, location:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param entity_type [String] + # + # @return [::String] + def entity_type_path **args + resources = { + "entity_type:project" => (proc do |project:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/agent/entityTypes/#{entity_type}" + end), + "entity_type:location:project" => (proc do |project:, location:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/entityTypes/#{entity_type}" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest.rb new file mode 100644 index 000000000000..f408342e66c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/entity_types/credentials" +require "google/cloud/dialogflow/v2/entity_types/paths" +require "google/cloud/dialogflow/v2/entity_types/rest/operations" +require "google/cloud/dialogflow/v2/entity_types/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/entity_types/rest" + # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + module EntityTypes + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/entity_types/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb new file mode 100644 index 000000000000..0e6e900b528c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb @@ -0,0 +1,1456 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/entity_type_pb" +require "google/cloud/dialogflow/v2/entity_types/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module EntityTypes + module Rest + ## + # REST client for the EntityTypes service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :entity_types_stub + + ## + # Configure the EntityTypes Client class. + # + # See {::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all EntityTypes clients + # ::Google::Cloud::Dialogflow::V2::EntityTypes::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the EntityTypes 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::Dialogflow::V2::EntityTypes::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 + @entity_types_stub.universe_domain + end + + ## + # Create a new EntityTypes REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the EntityTypes 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::Dialogflow::V2::EntityTypes::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 + + @entity_types_stub = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @entity_types_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 = @entity_types_stub.endpoint + config.universe_domain = @entity_types_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @entity_types_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::EntityTypes::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 + @entity_types_stub.logger + end + + # Service calls + + ## + # Returns the list of all entity types in the specified agent. + # + # @overload list_entity_types(request, options = nil) + # Pass arguments to `list_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_entity_types` via keyword arguments. Note that at + # least one keyword argument is 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 agent to list all entity types from. + # Format: `projects//agent`. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new + # + # # Call the list_entity_types method. + # result = client.list_entity_types 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::Dialogflow::V2::EntityType. + # p item + # end + # + def list_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest + + # Converts hash and nil to an 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_entity_types.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.list_entity_types request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @entity_types_stub, :list_entity_types, "entity_types", 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 + + ## + # Retrieves the specified entity type. + # + # @overload get_entity_type(request, options = nil) + # Pass arguments to `get_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(name: nil, language_code: nil) + # Pass arguments to `get_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To 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 entity type. + # Format: `projects//agent/entityTypes/`. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new + # + # # Call the get_entity_type method. + # result = client.get_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + # p result + # + def get_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest + + # Converts hash and nil to an 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.get_entity_type 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 an entity type in the specified agent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload create_entity_type(request, options = nil) + # Pass arguments to `create_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(parent: nil, entity_type: nil, language_code: nil) + # Pass arguments to `create_entity_type` via keyword arguments. Note that at + # least one keyword argument is 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 agent to create a entity type for. + # Format: `projects//agent`. + # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash] + # Required. The entity type to create. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new + # + # # Call the create_entity_type method. + # result = client.create_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + # p result + # + def create_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest + + # Converts hash and nil to an 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.create_entity_type 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 the specified entity type. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload update_entity_type(request, options = nil) + # Pass arguments to `update_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(entity_type: nil, language_code: nil, update_mask: nil) + # Pass arguments to `update_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash] + # Required. The entity type to update. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new + # + # # Call the update_entity_type method. + # result = client.update_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + # p result + # + def update_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest + + # Converts hash and nil to an 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.update_entity_type 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 specified entity type. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload delete_entity_type(request, options = nil) + # Pass arguments to `delete_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(name: nil) + # Pass arguments to `delete_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To 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 entity type to delete. + # Format: `projects//agent/entityTypes/`. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new + # + # # Call the delete_entity_type method. + # result = client.delete_entity_type request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest + + # Converts hash and nil to an 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.delete_entity_type 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/Creates multiple entity types in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse} + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_update_entity_types(request, options = nil) + # Pass arguments to `batch_update_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_type_batch_uri: nil, entity_type_batch_inline: nil, language_code: nil, update_mask: nil) + # Pass arguments to `batch_update_entity_types` via keyword arguments. Note that at + # least one keyword argument is 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 name of the agent to update or create entity types in. + # Format: `projects//agent`. + # @param entity_type_batch_uri [::String] + # The URI to a Google Cloud Storage file containing entity types to update + # or create. The file format can either be a serialized proto (of + # EntityBatch type) or a JSON object. Note: The URI must start with + # "gs://". + # + # Note: The following parameters are mutually exclusive: `entity_type_batch_uri`, `entity_type_batch_inline`. 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 entity_type_batch_inline [::Google::Cloud::Dialogflow::V2::EntityTypeBatch, ::Hash] + # The collection of entity types to update or create. + # + # Note: The following parameters are mutually exclusive: `entity_type_batch_inline`, `entity_type_batch_uri`. 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 language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new + # + # # Call the batch_update_entity_types method. + # result = client.batch_update_entity_types request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest + + # Converts hash and nil to an 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_entity_types.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_update_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.batch_update_entity_types 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 entity types in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_delete_entity_types(request, options = nil) + # Pass arguments to `batch_delete_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_delete_entity_types(parent: nil, entity_type_names: nil) + # Pass arguments to `batch_delete_entity_types` via keyword arguments. Note that at + # least one keyword argument is 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 name of the agent to delete all entities types for. Format: + # `projects//agent`. + # @param entity_type_names [::Array<::String>] + # Required. The names entity types to delete. All names must point to the + # same agent as `parent`. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new + # + # # Call the batch_delete_entity_types method. + # result = client.batch_delete_entity_types request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_delete_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest + + # Converts hash and nil to an 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_delete_entity_types.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_delete_entity_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_delete_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.batch_delete_entity_types 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 multiple new entities in the specified entity type. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_create_entities(request, options = nil) + # Pass arguments to `batch_create_entities` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entities(parent: nil, entities: nil, language_code: nil) + # Pass arguments to `batch_create_entities` via keyword arguments. Note that at + # least one keyword argument is 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 name of the entity type to create entities in. Format: + # `projects//agent/entityTypes/`. + # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>] + # Required. The entities to create. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new + # + # # Call the batch_create_entities method. + # result = client.batch_create_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_entities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest + + # Converts hash and nil to an 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_entities.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entities.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_create_entities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.batch_create_entities 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 or creates multiple entities in the specified entity type. This + # method does not affect entities in the entity type that aren't explicitly + # specified in the request. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_update_entities(request, options = nil) + # Pass arguments to `batch_update_entities` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entities(parent: nil, entities: nil, language_code: nil, update_mask: nil) + # Pass arguments to `batch_update_entities` via keyword arguments. Note that at + # least one keyword argument is 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 name of the entity type to update or create entities in. + # Format: `projects//agent/entityTypes/`. + # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>] + # Required. The entities to update or create. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new + # + # # Call the batch_update_entities method. + # result = client.batch_update_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_entities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest + + # Converts hash and nil to an 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_entities.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entities.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_update_entities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.batch_update_entities 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 entities in the specified entity type. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_delete_entities(request, options = nil) + # Pass arguments to `batch_delete_entities` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_delete_entities(parent: nil, entity_values: nil, language_code: nil) + # Pass arguments to `batch_delete_entities` via keyword arguments. Note that at + # least one keyword argument is 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 name of the entity type to delete entries for. Format: + # `projects//agent/entityTypes/`. + # @param entity_values [::Array<::String>] + # Required. The reference `values` of the entities to delete. Note that + # these are not fully-qualified names, i.e. they don't start with + # `projects/`. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new + # + # # Call the batch_delete_entities method. + # result = client.batch_delete_entities request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_delete_entities request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest + + # Converts hash and nil to an 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_delete_entities.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_delete_entities.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_delete_entities.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @entity_types_stub.batch_delete_entities 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 EntityTypes REST API. + # + # This class represents the configuration for EntityTypes 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::Dialogflow::V2::EntityTypes::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_entity_types to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_entity_types.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_entity_types.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 EntityTypes 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_entity_types + ## + # RPC-specific configuration for `get_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_entity_type + ## + # RPC-specific configuration for `create_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :create_entity_type + ## + # RPC-specific configuration for `update_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :update_entity_type + ## + # RPC-specific configuration for `delete_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_entity_type + ## + # RPC-specific configuration for `batch_update_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_entity_types + ## + # RPC-specific configuration for `batch_delete_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_entity_types + ## + # RPC-specific configuration for `batch_create_entities` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_create_entities + ## + # RPC-specific configuration for `batch_update_entities` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_entities + ## + # RPC-specific configuration for `batch_delete_entities` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_entities + + # @private + def initialize parent_rpcs = nil + list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types + @list_entity_types = ::Gapic::Config::Method.new list_entity_types_config + get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type + @get_entity_type = ::Gapic::Config::Method.new get_entity_type_config + create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type + @create_entity_type = ::Gapic::Config::Method.new create_entity_type_config + update_entity_type_config = parent_rpcs.update_entity_type if parent_rpcs.respond_to? :update_entity_type + @update_entity_type = ::Gapic::Config::Method.new update_entity_type_config + delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type + @delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config + batch_update_entity_types_config = parent_rpcs.batch_update_entity_types if parent_rpcs.respond_to? :batch_update_entity_types + @batch_update_entity_types = ::Gapic::Config::Method.new batch_update_entity_types_config + batch_delete_entity_types_config = parent_rpcs.batch_delete_entity_types if parent_rpcs.respond_to? :batch_delete_entity_types + @batch_delete_entity_types = ::Gapic::Config::Method.new batch_delete_entity_types_config + batch_create_entities_config = parent_rpcs.batch_create_entities if parent_rpcs.respond_to? :batch_create_entities + @batch_create_entities = ::Gapic::Config::Method.new batch_create_entities_config + batch_update_entities_config = parent_rpcs.batch_update_entities if parent_rpcs.respond_to? :batch_update_entities + @batch_update_entities = ::Gapic::Config::Method.new batch_update_entities_config + batch_delete_entities_config = parent_rpcs.batch_delete_entities if parent_rpcs.respond_to? :batch_delete_entities + @batch_delete_entities = ::Gapic::Config::Method.new batch_delete_entities_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb new file mode 100644 index 000000000000..9fc9f446bad6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb @@ -0,0 +1,947 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module EntityTypes + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the EntityTypes 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 EntityTypes 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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb new file mode 100644 index 000000000000..4043c9431a56 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb @@ -0,0 +1,775 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/entity_type_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module EntityTypes + module Rest + ## + # REST service stub for the EntityTypes 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_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListEntityTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse] + # A result object deserialized from the server's reply + def list_entity_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_entity_types_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_types", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # A result object deserialized from the server's reply + def get_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_entity_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::EntityType.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # A result object deserialized from the server's reply + def create_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_entity_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::EntityType.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::EntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # A result object deserialized from the server's reply + def update_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_entity_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::EntityType.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_entity_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_type", + 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 batch_update_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_entity_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_entity_types_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_types", + 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_delete_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_delete_entity_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_entity_types_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_delete_entity_types", + 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_entities REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_entities request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_entities_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entities", + 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_update_entities REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_entities request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_entities_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entities", + 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_delete_entities REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_delete_entities request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_entities_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_delete_entities", + 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_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest] + # 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_entity_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes", + body: "entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes", + body: "entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{entity_type.name}", + body: "entity_type", + matches: [ + ["entity_type.name", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{entity_type.name}", + body: "entity_type", + matches: [ + ["entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_update_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest] + # 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_entity_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_delete_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest] + # 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_delete_entity_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_create_entities REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest] + # 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_entities_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entities:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entities:batchCreate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_update_entities REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest] + # 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_entities_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entities:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entities:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_delete_entities REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest] + # 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_delete_entities_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entities:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entities:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_pb.rb new file mode 100644 index 000000000000..0b3545def5e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/environment.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/dialogflow/v2/audio_config_pb' +require 'google/cloud/dialogflow/v2/fulfillment_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/dialogflow/v2/environment.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a,google/cloud/dialogflow/v2/fulfillment.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x84\x05\n\x0b\x45nvironment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12@\n\ragent_version\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x41\n\x05state\x18\x04 \x01(\x0e\x32-.google.cloud.dialogflow.v2.Environment.StateB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x17text_to_speech_settings\x18\x07 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.TextToSpeechSettingsB\x03\xe0\x41\x01\x12\x41\n\x0b\x66ulfillment\x18\x08 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.FulfillmentB\x03\xe0\x41\x01\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07STOPPED\x10\x01\x12\x0b\n\x07LOADING\x10\x02\x12\x0b\n\x07RUNNING\x10\x03:\xaa\x01\xea\x41\xa6\x01\n%dialogflow.googleapis.com/Environment\x12\x33projects/{project}/agent/environments/{environment}\x12Hprojects/{project}/locations/{location}/agent/environments/{environment}\"\x9a\x03\n\x14TextToSpeechSettings\x12\"\n\x15\x65nable_text_to_speech\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12S\n\x15output_audio_encoding\x18\x02 \x01(\x0e\x32/.google.cloud.dialogflow.v2.OutputAudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12u\n\x19synthesize_speech_configs\x18\x04 \x03(\x0b\x32M.google.cloud.dialogflow.v2.TextToSpeechSettings.SynthesizeSpeechConfigsEntryB\x03\xe0\x41\x01\x1ar\n\x1cSynthesizeSpeechConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig:\x02\x38\x01\"\x89\x01\n\x17ListEnvironmentsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Environment\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\"r\n\x18ListEnvironmentsResponse\x12=\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.v2.Environment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x15GetEnvironmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"\xb9\x01\n\x18\x43reateEnvironmentRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Environment\x12\x41\n\x0b\x65nvironment\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.EnvironmentB\x03\xe0\x41\x02\x12\x1b\n\x0e\x65nvironment_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xc9\x01\n\x18UpdateEnvironmentRequest\x12\x41\n\x0b\x65nvironment\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.EnvironmentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x34\n\'allow_load_to_draft_and_discard_changes\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"W\n\x18\x44\x65leteEnvironmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"\x8e\x01\n\x1cGetEnvironmentHistoryRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\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\"\xf9\x01\n\x12\x45nvironmentHistory\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\x07\x65ntries\x18\x02 \x03(\x0b\x32\x34.google.cloud.dialogflow.v2.EnvironmentHistory.EntryB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x03 \x01(\tB\x03\xe0\x41\x03\x1a\x64\n\x05\x45ntry\x12\x15\n\ragent_version\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xcb\x0c\n\x0c\x45nvironments\x12\xf4\x01\n\x10ListEnvironments\x12\x33.google.cloud.dialogflow.v2.ListEnvironmentsRequest\x1a\x34.google.cloud.dialogflow.v2.ListEnvironmentsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v2/{parent=projects/*/agent}/environmentsZ8\x12\x36/v2/{parent=projects/*/locations/*/agent}/environments\x12\xda\x01\n\x0eGetEnvironment\x12\x31.google.cloud.dialogflow.v2.GetEnvironmentRequest\x1a\'.google.cloud.dialogflow.v2.Environment\"l\x82\xd3\xe4\x93\x02\x66\x12*/v2/{name=projects/*/agent/environments/*}Z8\x12\x36/v2/{name=projects/*/locations/*/agent/environments/*}\x12\xfc\x01\n\x11\x43reateEnvironment\x12\x34.google.cloud.dialogflow.v2.CreateEnvironmentRequest\x1a\'.google.cloud.dialogflow.v2.Environment\"\x87\x01\x82\xd3\xe4\x93\x02\x80\x01\"*/v2/{parent=projects/*/agent}/environments:\x0b\x65nvironmentZE\"6/v2/{parent=projects/*/locations/*/agent}/environments:\x0b\x65nvironment\x12\x94\x02\n\x11UpdateEnvironment\x12\x34.google.cloud.dialogflow.v2.UpdateEnvironmentRequest\x1a\'.google.cloud.dialogflow.v2.Environment\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x32\x36/v2/{environment.name=projects/*/agent/environments/*}:\x0b\x65nvironmentZQ2B/v2/{environment.name=projects/*/locations/*/agent/environments/*}:\x0b\x65nvironment\x12\xcf\x01\n\x11\x44\x65leteEnvironment\x12\x34.google.cloud.dialogflow.v2.DeleteEnvironmentRequest\x1a\x16.google.protobuf.Empty\"l\x82\xd3\xe4\x93\x02\x66**/v2/{name=projects/*/agent/environments/*}Z8*6/v2/{name=projects/*/locations/*/agent/environments/*}\x12\x84\x02\n\x15GetEnvironmentHistory\x12\x38.google.cloud.dialogflow.v2.GetEnvironmentHistoryRequest\x1a..google.cloud.dialogflow.v2.EnvironmentHistory\"\x80\x01\x82\xd3\xe4\x93\x02z\x12\x34/v2/{parent=projects/*/agent/environments/*}/historyZB\x12@/v2/{parent=projects/*/locations/*/agent/environments/*}/history\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x10\x45nvironmentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Environment").msgclass + Environment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Environment.State").enummodule + TextToSpeechSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TextToSpeechSettings").msgclass + ListEnvironmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEnvironmentsRequest").msgclass + ListEnvironmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEnvironmentsResponse").msgclass + GetEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEnvironmentRequest").msgclass + CreateEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateEnvironmentRequest").msgclass + UpdateEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateEnvironmentRequest").msgclass + DeleteEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteEnvironmentRequest").msgclass + GetEnvironmentHistoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEnvironmentHistoryRequest").msgclass + EnvironmentHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EnvironmentHistory").msgclass + EnvironmentHistory::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EnvironmentHistory.Entry").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_services_pb.rb new file mode 100644 index 000000000000..3895fb82706e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_services_pb.rb @@ -0,0 +1,66 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/environment.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/environment_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Environments + # Service for managing [Environments][google.cloud.dialogflow.v2.Environment]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Environments' + + # Returns the list of all non-default environments of the specified agent. + rpc :ListEnvironments, ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse + # Retrieves the specified agent environment. + rpc :GetEnvironment, ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment + # Creates an agent environment. + rpc :CreateEnvironment, ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment + # Updates the specified agent environment. + # + # This method allows you to deploy new agent versions into the environment. + # When an environment is pointed to a new agent version by setting + # `environment.agent_version`, the environment is temporarily set to the + # `LOADING` state. During that time, the environment continues serving the + # previous version of the agent. After the new agent version is done loading, + # the environment is set back to the `RUNNING` state. + # You can use "-" as Environment ID in environment name to update an agent + # version in the default environment. WARNING: this will negate all recent + # changes to the draft agent and can't be undone. You may want to save the + # draft agent to a version before calling this method. + rpc :UpdateEnvironment, ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment + # Deletes the specified agent environment. + rpc :DeleteEnvironment, ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, ::Google::Protobuf::Empty + # Gets the history of the specified environment. + rpc :GetEnvironmentHistory, ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, ::Google::Cloud::Dialogflow::V2::EnvironmentHistory + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments.rb new file mode 100644 index 000000000000..2f0d27fc0206 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/environments/credentials" +require "google/cloud/dialogflow/v2/environments/paths" +require "google/cloud/dialogflow/v2/environments/client" +require "google/cloud/dialogflow/v2/environments/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Environment Environments}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/environments" + # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/environments/rest" + # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + module Environments + end + end + end + end +end + +helper_path = ::File.join __dir__, "environments", "helpers.rb" +require "google/cloud/dialogflow/v2/environments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb new file mode 100644 index 000000000000..c8885f83f50e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb @@ -0,0 +1,1030 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/environment_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Environments + ## + # Client for the Environments service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Environment Environments}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :environments_stub + + ## + # Configure the Environments Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Environments::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Environments clients + # ::Google::Cloud::Dialogflow::V2::Environments::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Environments 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::Dialogflow::V2::Environments::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 + @environments_stub.universe_domain + end + + ## + # Create a new Environments client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Environments 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/dialogflow/v2/environment_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 + + @environments_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Environments::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 + ) + + @environments_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 = @environments_stub.endpoint + config.universe_domain = @environments_stub.universe_domain + config.logger = @environments_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 + @environments_stub.logger + end + + # Service calls + + ## + # Returns the list of all non-default environments of the specified agent. + # + # @overload list_environments(request, options = nil) + # Pass arguments to `list_environments` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_environments` via keyword arguments. Note that at + # least one keyword argument is 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 agent to list all environments from. + # Format: + # + # - `projects//agent` + # - `projects//locations//agent` + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Environment>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Environment>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.new + # + # # Call the list_environments method. + # result = client.list_environments 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::Dialogflow::V2::Environment. + # p item + # end + # + def list_environments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest + + # Converts hash and nil to 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_environments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_environments.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_environments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :list_environments, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @environments_stub, :list_environments, 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 + + ## + # Retrieves the specified agent environment. + # + # @overload get_environment(request, options = nil) + # Pass arguments to `get_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment(name: nil) + # Pass arguments to `get_environment` via keyword arguments. Note that at + # least one keyword argument is required. To 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 environment. + # Supported formats: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new + # + # # Call the get_environment method. + # result = client.get_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + # p result + # + def get_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest + + # Converts hash and nil to 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_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_environment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :get_environment, 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 an agent environment. + # + # @overload create_environment(request, options = nil) + # Pass arguments to `create_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment(parent: nil, environment: nil, environment_id: nil) + # Pass arguments to `create_environment` via keyword arguments. Note that at + # least one keyword argument is 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 agent to create an environment for. + # Supported formats: + # + # - `projects//agent` + # - `projects//locations//agent` + # @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash] + # Required. The environment to create. + # @param environment_id [::String] + # Required. The unique id of the new environment. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new + # + # # Call the create_environment method. + # result = client.create_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + # p result + # + def create_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest + + # Converts hash and nil to 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_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_environment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :create_environment, 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 the specified agent environment. + # + # This method allows you to deploy new agent versions into the environment. + # When an environment is pointed to a new agent version by setting + # `environment.agent_version`, the environment is temporarily set to the + # `LOADING` state. During that time, the environment continues serving the + # previous version of the agent. After the new agent version is done loading, + # the environment is set back to the `RUNNING` state. + # You can use "-" as Environment ID in environment name to update an agent + # version in the default environment. WARNING: this will negate all recent + # changes to the draft agent and can't be undone. You may want to save the + # draft agent to a version before calling this method. + # + # @overload update_environment(request, options = nil) + # Pass arguments to `update_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment(environment: nil, update_mask: nil, allow_load_to_draft_and_discard_changes: nil) + # Pass arguments to `update_environment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash] + # Required. The environment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. + # @param allow_load_to_draft_and_discard_changes [::Boolean] + # Optional. This field is used to prevent accidental overwrite of the default + # environment, which is an operation that cannot be undone. To confirm that + # the caller desires this overwrite, this field must be explicitly set to + # true when updating the default environment (environment ID = `-`). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new + # + # # Call the update_environment method. + # result = client.update_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + # p result + # + def update_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest + + # Converts hash and nil to 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_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.environment&.name + header_params["environment.name"] = request.environment.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_environment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :update_environment, 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 specified agent environment. + # + # @overload delete_environment(request, options = nil) + # Pass arguments to `delete_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment(name: nil) + # Pass arguments to `delete_environment` via keyword arguments. Note that at + # least one keyword argument is required. To 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 environment to delete. + # / Format: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new + # + # # Call the delete_environment method. + # result = client.delete_environment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest + + # Converts hash and nil to 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_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_environment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :delete_environment, 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 history of the specified environment. + # + # @overload get_environment_history(request, options = nil) + # Pass arguments to `get_environment_history` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment_history(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `get_environment_history` via keyword arguments. Note that at + # least one keyword argument is 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 name of the environment to retrieve history for. + # Supported formats: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.new + # + # # Call the get_environment_history method. + # result = client.get_environment_history 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::Dialogflow::V2::EnvironmentHistory::Entry. + # p item + # end + # + def get_environment_history request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest + + # Converts hash and nil to 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_environment_history.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.get_environment_history.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_environment_history.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.call_rpc :get_environment_history, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @environments_stub, :get_environment_history, 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 Environments API. + # + # This class represents the configuration for Environments, + # 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::Dialogflow::V2::Environments::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_environments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Environments::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_environments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_environments.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::Dialogflow::V2::Environments::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Environments 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_environments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_environments + ## + # RPC-specific configuration for `get_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_environment + ## + # RPC-specific configuration for `create_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_environment + ## + # RPC-specific configuration for `update_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_environment + ## + # RPC-specific configuration for `delete_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_environment + ## + # RPC-specific configuration for `get_environment_history` + # @return [::Gapic::Config::Method] + # + attr_reader :get_environment_history + + # @private + def initialize parent_rpcs = nil + list_environments_config = parent_rpcs.list_environments if parent_rpcs.respond_to? :list_environments + @list_environments = ::Gapic::Config::Method.new list_environments_config + get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment + @get_environment = ::Gapic::Config::Method.new get_environment_config + create_environment_config = parent_rpcs.create_environment if parent_rpcs.respond_to? :create_environment + @create_environment = ::Gapic::Config::Method.new create_environment_config + update_environment_config = parent_rpcs.update_environment if parent_rpcs.respond_to? :update_environment + @update_environment = ::Gapic::Config::Method.new update_environment_config + delete_environment_config = parent_rpcs.delete_environment if parent_rpcs.respond_to? :delete_environment + @delete_environment = ::Gapic::Config::Method.new delete_environment_config + get_environment_history_config = parent_rpcs.get_environment_history if parent_rpcs.respond_to? :get_environment_history + @get_environment_history = ::Gapic::Config::Method.new get_environment_history_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/credentials.rb new file mode 100644 index 000000000000..2e833d4db565 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Environments + # Credentials for the Environments API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/paths.rb new file mode 100644 index 000000000000..82076cf3d5ea --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/paths.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! + + +module Google + module Cloud + module Dialogflow + module V2 + module Environments + # Path helper methods for the Environments API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # @overload agent_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/agent` + # + # @param project [String] + # + # @overload agent_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def agent_path **args + resources = { + "project" => (proc do |project:| + "projects/#{project}/agent" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent" + 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 Environment resource string. + # + # @overload environment_path(project:, environment:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}` + # + # @param project [String] + # @param environment [String] + # + # @overload environment_path(project:, location:, environment:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # + # @return [::String] + def environment_path **args + resources = { + "environment:project" => (proc do |project:, environment:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}" + end), + "environment:location:project" => (proc do |project:, location:, environment:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}" + 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 Fulfillment resource string. + # + # @overload fulfillment_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/agent/fulfillment` + # + # @param project [String] + # + # @overload fulfillment_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/fulfillment` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def fulfillment_path **args + resources = { + "project" => (proc do |project:| + "projects/#{project}/agent/fulfillment" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/fulfillment" + 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 Version resource string. + # + # @overload version_path(project:, version:) + # The resource will be in the following format: + # + # `projects/{project}/agent/versions/{version}` + # + # @param project [String] + # @param version [String] + # + # @overload version_path(project:, location:, version:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/versions/{version}` + # + # @param project [String] + # @param location [String] + # @param version [String] + # + # @return [::String] + def version_path **args + resources = { + "project:version" => (proc do |project:, version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/agent/versions/#{version}" + end), + "location:project:version" => (proc do |project:, location:, version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/versions/#{version}" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest.rb new file mode 100644 index 000000000000..59ab86f00835 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/environments/credentials" +require "google/cloud/dialogflow/v2/environments/paths" +require "google/cloud/dialogflow/v2/environments/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Environment Environments}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/environments/rest" + # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + module Environments + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/environments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb new file mode 100644 index 000000000000..33b80aefcd54 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb @@ -0,0 +1,953 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/environment_pb" +require "google/cloud/dialogflow/v2/environments/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Environments + module Rest + ## + # REST client for the Environments service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Environment Environments}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :environments_stub + + ## + # Configure the Environments Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Environments::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Environments clients + # ::Google::Cloud::Dialogflow::V2::Environments::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Environments 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::Dialogflow::V2::Environments::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 + @environments_stub.universe_domain + end + + ## + # Create a new Environments REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Environments 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 + + @environments_stub = ::Google::Cloud::Dialogflow::V2::Environments::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @environments_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 = @environments_stub.endpoint + config.universe_domain = @environments_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @environments_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 + @environments_stub.logger + end + + # Service calls + + ## + # Returns the list of all non-default environments of the specified agent. + # + # @overload list_environments(request, options = nil) + # Pass arguments to `list_environments` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environments(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_environments` via keyword arguments. Note that at + # least one keyword argument is 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 agent to list all environments from. + # Format: + # + # - `projects//agent` + # - `projects//locations//agent` + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Environment>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Environment>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.new + # + # # Call the list_environments method. + # result = client.list_environments 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::Dialogflow::V2::Environment. + # p item + # end + # + def list_environments request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest + + # Converts hash and nil to an 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_environments.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_environments.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_environments.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.list_environments request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :list_environments, "environments", 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 + + ## + # Retrieves the specified agent environment. + # + # @overload get_environment(request, options = nil) + # Pass arguments to `get_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment(name: nil) + # Pass arguments to `get_environment` via keyword arguments. Note that at + # least one keyword argument is required. To 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 environment. + # Supported formats: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new + # + # # Call the get_environment method. + # result = client.get_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + # p result + # + def get_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest + + # Converts hash and nil to an 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_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_environment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.get_environment 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 an agent environment. + # + # @overload create_environment(request, options = nil) + # Pass arguments to `create_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment(parent: nil, environment: nil, environment_id: nil) + # Pass arguments to `create_environment` via keyword arguments. Note that at + # least one keyword argument is 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 agent to create an environment for. + # Supported formats: + # + # - `projects//agent` + # - `projects//locations//agent` + # @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash] + # Required. The environment to create. + # @param environment_id [::String] + # Required. The unique id of the new environment. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new + # + # # Call the create_environment method. + # result = client.create_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + # p result + # + def create_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest + + # Converts hash and nil to an 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_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_environment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.create_environment 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 the specified agent environment. + # + # This method allows you to deploy new agent versions into the environment. + # When an environment is pointed to a new agent version by setting + # `environment.agent_version`, the environment is temporarily set to the + # `LOADING` state. During that time, the environment continues serving the + # previous version of the agent. After the new agent version is done loading, + # the environment is set back to the `RUNNING` state. + # You can use "-" as Environment ID in environment name to update an agent + # version in the default environment. WARNING: this will negate all recent + # changes to the draft agent and can't be undone. You may want to save the + # draft agent to a version before calling this method. + # + # @overload update_environment(request, options = nil) + # Pass arguments to `update_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment(environment: nil, update_mask: nil, allow_load_to_draft_and_discard_changes: nil) + # Pass arguments to `update_environment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash] + # Required. The environment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. + # @param allow_load_to_draft_and_discard_changes [::Boolean] + # Optional. This field is used to prevent accidental overwrite of the default + # environment, which is an operation that cannot be undone. To confirm that + # the caller desires this overwrite, this field must be explicitly set to + # true when updating the default environment (environment ID = `-`). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new + # + # # Call the update_environment method. + # result = client.update_environment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + # p result + # + def update_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest + + # Converts hash and nil to an 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_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_environment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.update_environment 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 specified agent environment. + # + # @overload delete_environment(request, options = nil) + # Pass arguments to `delete_environment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment(name: nil) + # Pass arguments to `delete_environment` via keyword arguments. Note that at + # least one keyword argument is required. To 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 environment to delete. + # / Format: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new + # + # # Call the delete_environment method. + # result = client.delete_environment request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_environment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest + + # Converts hash and nil to an 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_environment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_environment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_environment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.delete_environment 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 history of the specified environment. + # + # @overload get_environment_history(request, options = nil) + # Pass arguments to `get_environment_history` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_environment_history(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `get_environment_history` via keyword arguments. Note that at + # least one keyword argument is 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 name of the environment to retrieve history for. + # Supported formats: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.new + # + # # Call the get_environment_history method. + # result = client.get_environment_history 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::Dialogflow::V2::EnvironmentHistory::Entry. + # p item + # end + # + def get_environment_history request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest + + # Converts hash and nil to an 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_environment_history.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_environment_history.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_environment_history.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @environments_stub.get_environment_history request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :get_environment_history, "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 + + ## + # Configuration class for the Environments REST API. + # + # This class represents the configuration for Environments 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::Dialogflow::V2::Environments::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_environments to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_environments.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_environments.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Environments 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_environments` + # @return [::Gapic::Config::Method] + # + attr_reader :list_environments + ## + # RPC-specific configuration for `get_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_environment + ## + # RPC-specific configuration for `create_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :create_environment + ## + # RPC-specific configuration for `update_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_environment + ## + # RPC-specific configuration for `delete_environment` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_environment + ## + # RPC-specific configuration for `get_environment_history` + # @return [::Gapic::Config::Method] + # + attr_reader :get_environment_history + + # @private + def initialize parent_rpcs = nil + list_environments_config = parent_rpcs.list_environments if parent_rpcs.respond_to? :list_environments + @list_environments = ::Gapic::Config::Method.new list_environments_config + get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment + @get_environment = ::Gapic::Config::Method.new get_environment_config + create_environment_config = parent_rpcs.create_environment if parent_rpcs.respond_to? :create_environment + @create_environment = ::Gapic::Config::Method.new create_environment_config + update_environment_config = parent_rpcs.update_environment if parent_rpcs.respond_to? :update_environment + @update_environment = ::Gapic::Config::Method.new update_environment_config + delete_environment_config = parent_rpcs.delete_environment if parent_rpcs.respond_to? :delete_environment + @delete_environment = ::Gapic::Config::Method.new delete_environment_config + get_environment_history_config = parent_rpcs.get_environment_history if parent_rpcs.respond_to? :get_environment_history + @get_environment_history = ::Gapic::Config::Method.new get_environment_history_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb new file mode 100644 index 000000000000..eeb22574d802 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb @@ -0,0 +1,493 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/environment_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Environments + module Rest + ## + # REST service stub for the Environments 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_environments REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListEnvironmentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse] + # A result object deserialized from the server's reply + def list_environments request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_environments_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_environments", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse.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_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # A result object deserialized from the server's reply + def get_environment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_environment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_environment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Environment.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_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # A result object deserialized from the server's reply + def create_environment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_environment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_environment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Environment.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_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Environment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # A result object deserialized from the server's reply + def update_environment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_environment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_environment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Environment.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_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_environment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_environment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_environment", + 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 get_environment_history REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::EnvironmentHistory] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::EnvironmentHistory] + # A result object deserialized from the server's reply + def get_environment_history request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_environment_history_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_environment_history", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::EnvironmentHistory.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_environments REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest] + # 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_environments_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/environments", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/environments", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest] + # 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_environment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest] + # 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_environment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/environments", + body: "environment", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/environments", + body: "environment", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest] + # 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_environment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{environment.name}", + body: "environment", + matches: [ + ["environment.name", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{environment.name}", + body: "environment", + matches: [ + ["environment.name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_environment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest] + # 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_environment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_environment_history REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest] + # 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_environment_history_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/history", + matches: [ + ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/history", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb new file mode 100644 index 000000000000..43fbece088dd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/fulfillment.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/protobuf/field_mask_pb' + + +descriptor_data = "\n,google/cloud/dialogflow/v2/fulfillment.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xa9\x06\n\x0b\x46ulfillment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12X\n\x13generic_web_service\x18\x03 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Fulfillment.GenericWebServiceH\x00\x12\x14\n\x07\x65nabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x46\n\x08\x66\x65\x61tures\x18\x05 \x03(\x0b\x32/.google.cloud.dialogflow.v2.Fulfillment.FeatureB\x03\xe0\x41\x01\x1a\x99\x02\n\x11GenericWebService\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08username\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08password\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12k\n\x0frequest_headers\x18\x04 \x03(\x0b\x32M.google.cloud.dialogflow.v2.Fulfillment.GenericWebService.RequestHeadersEntryB\x03\xe0\x41\x01\x12 \n\x11is_cloud_function\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x1a\x35\n\x13RequestHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1az\n\x07\x46\x65\x61ture\x12\x42\n\x04type\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.v2.Fulfillment.Feature.Type\"+\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSMALLTALK\x10\x01:\x8c\x01\xea\x41\x88\x01\n%dialogflow.googleapis.com/Fulfillment\x12$projects/{project}/agent/fulfillment\x12\x39projects/{project}/locations/{location}/agent/fulfillmentB\r\n\x0b\x66ulfillment\"T\n\x15GetFulfillmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Fulfillment\"\x93\x01\n\x18UpdateFulfillmentRequest\x12\x41\n\x0b\x66ulfillment\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.FulfillmentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x32\x91\x05\n\x0c\x46ulfillments\x12\xdb\x01\n\x0eGetFulfillment\x12\x31.google.cloud.dialogflow.v2.GetFulfillmentRequest\x1a\'.google.cloud.dialogflow.v2.Fulfillment\"m\xda\x41\x04name\x82\xd3\xe4\x93\x02`\x12\'/v2/{name=projects/*/agent/fulfillment}Z5\x12\x33/v2/{name=projects/*/locations/*/agent/fulfillment}\x12\xa8\x02\n\x11UpdateFulfillment\x12\x34.google.cloud.dialogflow.v2.UpdateFulfillmentRequest\x1a\'.google.cloud.dialogflow.v2.Fulfillment\"\xb3\x01\xda\x41\x17\x66ulfillment,update_mask\x82\xd3\xe4\x93\x02\x92\x01\x32\x33/v2/{fulfillment.name=projects/*/agent/fulfillment}:\x0b\x66ulfillmentZN2?/v2/{fulfillment.name=projects/*/locations/*/agent/fulfillment}:\x0b\x66ulfillment\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x10\x46ulfillmentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + Fulfillment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Fulfillment").msgclass + Fulfillment::GenericWebService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Fulfillment.GenericWebService").msgclass + Fulfillment::Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Fulfillment.Feature").msgclass + Fulfillment::Feature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Fulfillment.Feature.Type").enummodule + GetFulfillmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetFulfillmentRequest").msgclass + UpdateFulfillmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateFulfillmentRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb new file mode 100644 index 000000000000..478ae0407689 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/fulfillment.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/fulfillment_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Fulfillments + # Service for managing [Fulfillments][google.cloud.dialogflow.v2.Fulfillment]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Fulfillments' + + # Retrieves the fulfillment. + rpc :GetFulfillment, ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest, ::Google::Cloud::Dialogflow::V2::Fulfillment + # Updates the fulfillment. + rpc :UpdateFulfillment, ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest, ::Google::Cloud::Dialogflow::V2::Fulfillment + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments.rb new file mode 100644 index 000000000000..6a596099d8e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/fulfillments/credentials" +require "google/cloud/dialogflow/v2/fulfillments/paths" +require "google/cloud/dialogflow/v2/fulfillments/client" +require "google/cloud/dialogflow/v2/fulfillments/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Fulfillment Fulfillments}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/fulfillments" + # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/fulfillments/rest" + # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new + # + module Fulfillments + end + end + end + end +end + +helper_path = ::File.join __dir__, "fulfillments", "helpers.rb" +require "google/cloud/dialogflow/v2/fulfillments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb new file mode 100644 index 000000000000..38826423c123 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/fulfillment_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Fulfillments + ## + # Client for the Fulfillments service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Fulfillment Fulfillments}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :fulfillments_stub + + ## + # Configure the Fulfillments Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Fulfillments::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Fulfillments clients + # ::Google::Cloud::Dialogflow::V2::Fulfillments::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Fulfillments 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::Dialogflow::V2::Fulfillments::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 + @fulfillments_stub.universe_domain + end + + ## + # Create a new Fulfillments client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Fulfillments 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/dialogflow/v2/fulfillment_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 + + @fulfillments_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Fulfillments::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 + ) + + @fulfillments_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 = @fulfillments_stub.endpoint + config.universe_domain = @fulfillments_stub.universe_domain + config.logger = @fulfillments_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 + @fulfillments_stub.logger + end + + # Service calls + + ## + # Retrieves the fulfillment. + # + # @overload get_fulfillment(request, options = nil) + # Pass arguments to `get_fulfillment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_fulfillment(name: nil) + # Pass arguments to `get_fulfillment` via keyword arguments. Note that at + # least one keyword argument is required. To 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 fulfillment. + # Format: `projects//agent/fulfillment`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Fulfillment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new + # + # # Call the get_fulfillment method. + # result = client.get_fulfillment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + # p result + # + def get_fulfillment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest + + # Converts hash and nil to 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_fulfillment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_fulfillment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_fulfillment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @fulfillments_stub.call_rpc :get_fulfillment, 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 the fulfillment. + # + # @overload update_fulfillment(request, options = nil) + # Pass arguments to `update_fulfillment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_fulfillment(fulfillment: nil, update_mask: nil) + # Pass arguments to `update_fulfillment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param fulfillment [::Google::Cloud::Dialogflow::V2::Fulfillment, ::Hash] + # Required. The fulfillment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. If the mask is not + # present, all fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Fulfillment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new + # + # # Call the update_fulfillment method. + # result = client.update_fulfillment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + # p result + # + def update_fulfillment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest + + # Converts hash and nil to 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_fulfillment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.fulfillment&.name + header_params["fulfillment.name"] = request.fulfillment.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_fulfillment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_fulfillment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @fulfillments_stub.call_rpc :update_fulfillment, 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 Fulfillments API. + # + # This class represents the configuration for Fulfillments, + # 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::Dialogflow::V2::Fulfillments::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_fulfillment to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_fulfillment.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_fulfillment.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::Dialogflow::V2::Fulfillments::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Fulfillments 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_fulfillment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_fulfillment + ## + # RPC-specific configuration for `update_fulfillment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_fulfillment + + # @private + def initialize parent_rpcs = nil + get_fulfillment_config = parent_rpcs.get_fulfillment if parent_rpcs.respond_to? :get_fulfillment + @get_fulfillment = ::Gapic::Config::Method.new get_fulfillment_config + update_fulfillment_config = parent_rpcs.update_fulfillment if parent_rpcs.respond_to? :update_fulfillment + @update_fulfillment = ::Gapic::Config::Method.new update_fulfillment_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb new file mode 100644 index 000000000000..ec29602e876d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Fulfillments + # Credentials for the Fulfillments API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb new file mode 100644 index 000000000000..3b691fac79cd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module Fulfillments + # Path helper methods for the Fulfillments API. + module Paths + ## + # Create a fully-qualified Fulfillment resource string. + # + # @overload fulfillment_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/agent/fulfillment` + # + # @param project [String] + # + # @overload fulfillment_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/fulfillment` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def fulfillment_path **args + resources = { + "project" => (proc do |project:| + "projects/#{project}/agent/fulfillment" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/fulfillment" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest.rb new file mode 100644 index 000000000000..d4aec855ef6f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/fulfillments/credentials" +require "google/cloud/dialogflow/v2/fulfillments/paths" +require "google/cloud/dialogflow/v2/fulfillments/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Fulfillment Fulfillments}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/fulfillments/rest" + # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new + # + module Fulfillments + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/fulfillments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb new file mode 100644 index 000000000000..9afa329971e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb @@ -0,0 +1,544 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/fulfillment_pb" +require "google/cloud/dialogflow/v2/fulfillments/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Fulfillments + module Rest + ## + # REST client for the Fulfillments service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Fulfillment Fulfillments}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :fulfillments_stub + + ## + # Configure the Fulfillments Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Fulfillments clients + # ::Google::Cloud::Dialogflow::V2::Fulfillments::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Fulfillments 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::Dialogflow::V2::Fulfillments::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 + @fulfillments_stub.universe_domain + end + + ## + # Create a new Fulfillments REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Fulfillments 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 + + @fulfillments_stub = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @fulfillments_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 = @fulfillments_stub.endpoint + config.universe_domain = @fulfillments_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @fulfillments_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 + @fulfillments_stub.logger + end + + # Service calls + + ## + # Retrieves the fulfillment. + # + # @overload get_fulfillment(request, options = nil) + # Pass arguments to `get_fulfillment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_fulfillment(name: nil) + # Pass arguments to `get_fulfillment` via keyword arguments. Note that at + # least one keyword argument is required. To 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 fulfillment. + # Format: `projects//agent/fulfillment`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Fulfillment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new + # + # # Call the get_fulfillment method. + # result = client.get_fulfillment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + # p result + # + def get_fulfillment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest + + # Converts hash and nil to an 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_fulfillment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_fulfillment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_fulfillment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @fulfillments_stub.get_fulfillment 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 the fulfillment. + # + # @overload update_fulfillment(request, options = nil) + # Pass arguments to `update_fulfillment` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_fulfillment(fulfillment: nil, update_mask: nil) + # Pass arguments to `update_fulfillment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param fulfillment [::Google::Cloud::Dialogflow::V2::Fulfillment, ::Hash] + # Required. The fulfillment to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. If the mask is not + # present, all fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Fulfillment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new + # + # # Call the update_fulfillment method. + # result = client.update_fulfillment request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + # p result + # + def update_fulfillment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest + + # Converts hash and nil to an 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_fulfillment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_fulfillment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_fulfillment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @fulfillments_stub.update_fulfillment 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 Fulfillments REST API. + # + # This class represents the configuration for Fulfillments 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::Dialogflow::V2::Fulfillments::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_fulfillment to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_fulfillment.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_fulfillment.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Fulfillments 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_fulfillment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_fulfillment + ## + # RPC-specific configuration for `update_fulfillment` + # @return [::Gapic::Config::Method] + # + attr_reader :update_fulfillment + + # @private + def initialize parent_rpcs = nil + get_fulfillment_config = parent_rpcs.get_fulfillment if parent_rpcs.respond_to? :get_fulfillment + @get_fulfillment = ::Gapic::Config::Method.new get_fulfillment_config + update_fulfillment_config = parent_rpcs.update_fulfillment if parent_rpcs.respond_to? :update_fulfillment + @update_fulfillment = ::Gapic::Config::Method.new update_fulfillment_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb new file mode 100644 index 000000000000..fbc24bbbdf5b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb @@ -0,0 +1,219 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/fulfillment_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Fulfillments + module Rest + ## + # REST service stub for the Fulfillments 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_fulfillment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Fulfillment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] + # A result object deserialized from the server's reply + def get_fulfillment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_fulfillment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_fulfillment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Fulfillment.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_fulfillment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Fulfillment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] + # A result object deserialized from the server's reply + def update_fulfillment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_fulfillment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_fulfillment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Fulfillment.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_fulfillment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest] + # 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_fulfillment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/fulfillment/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/fulfillment/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_fulfillment REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest] + # 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_fulfillment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{fulfillment.name}", + body: "fulfillment", + matches: [ + ["fulfillment.name", %r{^projects/[^/]+/agent/fulfillment/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{fulfillment.name}", + body: "fulfillment", + matches: [ + ["fulfillment.name", %r{^projects/[^/]+/locations/[^/]+/agent/fulfillment/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/gcs_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/gcs_pb.rb new file mode 100644 index 000000000000..84c6f949f401 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/gcs_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/gcs.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n$google/cloud/dialogflow/v2/gcs.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\"\x1f\n\nGcsSources\x12\x11\n\x04uris\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\tB\x8e\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x08GcsProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + GcsSources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GcsSources").msgclass + GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GcsDestination").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_pb.rb new file mode 100644 index 000000000000..0d91a5f1de81 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/generator_evaluation.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/dialogflow/v2/generator_pb' +require 'google/cloud/dialogflow/v2/operations_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n5google/cloud/dialogflow/v2/generator_evaluation.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a+google/cloud/dialogflow/v2/operations.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xbd\x01\n CreateGeneratorEvaluationRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/GeneratorEvaluation\x12R\n\x14generator_evaluation\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorEvaluationB\x03\xe0\x41\x02\"d\n\x1dGetGeneratorEvaluationRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/GeneratorEvaluation\"\x99\x01\n\x1fListGeneratorEvaluationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/GeneratorEvaluation\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\"\x8b\x01\n ListGeneratorEvaluationsResponse\x12N\n\x15generator_evaluations\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorEvaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n DeleteGeneratorEvaluationRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/GeneratorEvaluation\"\xb7\x06\n\x13GeneratorEvaluation\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12_\n\x1bgenerator_evaluation_config\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.GeneratorEvaluationConfigB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rcomplete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x11initial_generator\x18\x05 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorB\x03\xe0\x41\x02\x12`\n\x15summarization_metrics\x18\x06 \x01(\x0b\x32:.google.cloud.dialogflow.v2.SummarizationEvaluationMetricsB\x03\xe0\x41\x03H\x00\x12L\n\x11\x65valuation_status\x18\n \x01(\x0b\x32,.google.cloud.dialogflow.v2.EvaluationStatusB\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzs\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03H\x02\x88\x01\x01:\xb7\x01\xea\x41\xb3\x01\n-dialogflow.googleapis.com/GeneratorEvaluation\x12Wprojects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation}*\x14generatorEvaluations2\x13generatorEvaluationB\t\n\x07metricsB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"\xa2\x17\n\x1eSummarizationEvaluationMetrics\x12\x87\x01\n summarization_evaluation_results\x18\x04 \x03(\x0b\x32X.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SummarizationEvaluationResultB\x03\xe0\x41\x03\x12\x38\n+summarization_evaluation_merged_results_uri\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12n\n\x0foverall_metrics\x18\x06 \x03(\x0b\x32P.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.OverallScoresByMetricB\x03\xe0\x41\x03\x12l\n\x16overall_section_tokens\x18\x07 \x03(\x0b\x32G.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionTokenB\x03\xe0\x41\x03\x12p\n\x14\x63onversation_details\x18\x08 \x03(\x0b\x32M.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetailB\x03\xe0\x41\x03\x1a{\n\x15\x41\x63\x63uracyDecomposition\x12\x12\n\x05point\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12\x61\x63\x63uracy_reasoning\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x0bis_accurate\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0e\n\x0c_is_accurate\x1al\n\x16\x41\x64herenceDecomposition\x12\x12\n\x05point\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12 \n\x13\x61\x64herence_reasoning\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bis_adherent\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03:\x02\x18\x01\x1aq\n\x0f\x41\x64herenceRubric\x12\x15\n\x08question\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\treasoning\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x0cis_addressed\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0f\n\r_is_addressed\x1a\\\n\x12\x43ompletenessRubric\x12\x15\n\x08question\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x0cis_addressed\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0f\n\r_is_addressed\x1a\x8e\x02\n\rDecomposition\x12r\n\x16\x61\x63\x63uracy_decomposition\x18\x01 \x01(\x0b\x32P.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecompositionH\x00\x12t\n\x17\x61\x64herence_decomposition\x18\x02 \x01(\x0b\x32Q.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceDecompositionH\x00:\x02\x18\x01\x42\x0f\n\rdecomposition\x1a\xe6\x02\n\x10\x45valuationResult\x12r\n\x16\x61\x63\x63uracy_decomposition\x18\x01 \x01(\x0b\x32P.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecompositionH\x00\x12\x66\n\x10\x61\x64herence_rubric\x18\x02 \x01(\x0b\x32J.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubricH\x00\x12l\n\x13\x63ompleteness_rubric\x18\x03 \x01(\x0b\x32M.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubricH\x00\x42\x08\n\x06result\x1a\xee\x02\n\x1dSummarizationEvaluationResult\x12\x19\n\nsession_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x03\x12\x13\n\x06metric\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07section\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05score\x18\x04 \x01(\x02\x42\x03\xe0\x41\x03\x12\x1c\n\x0fsection_summary\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12g\n\x0e\x64\x65\x63ompositions\x18\x07 \x03(\x0b\x32H.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.DecompositionB\x05\x18\x01\xe0\x41\x03\x12l\n\x12\x65valuation_results\x18\x08 \x03(\x0b\x32K.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResultB\x03\xe0\x41\x03\x1a,\n\x15OverallScoresByMetric\x12\x13\n\x06metric\x18\x01 \x01(\tB\x03\xe0\x41\x03\x1aS\n\x0cSectionToken\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x0btoken_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0e\n\x0c_token_count\x1a\xc1\x06\n\x12\x43onversationDetail\x12\x46\n\x0fmessage_entries\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.MessageEntryB\x03\xe0\x41\x03\x12[\n\x10summary_sections\x18\x04 \x03(\x0b\x32<.google.cloud.dialogflow.v2.SummarySuggestion.SummarySectionB\x03\xe0\x41\x03\x12w\n\x0emetric_details\x18\x02 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetailB\x03\xe0\x41\x03\x12\x64\n\x0esection_tokens\x18\x03 \x03(\x0b\x32G.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionTokenB\x03\xe0\x41\x03\x1a\xa6\x03\n\x0cMetricDetail\x12\x13\n\x06metric\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\x05score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x86\x01\n\x0fsection_details\x18\x04 \x03(\x0b\x32h.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetailB\x03\xe0\x41\x03\x1a\xd4\x01\n\rSectionDetail\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\x05score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1c\n\x0fsection_summary\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12l\n\x12\x65valuation_results\x18\x05 \x03(\x0b\x32K.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResultB\x03\xe0\x41\x03\x42\x08\n\x06_scoreB\x08\n\x06_score\"\xbf\r\n\x19GeneratorEvaluationConfig\x12\x65\n\x11input_data_config\x18\x01 \x01(\x0b\x32\x45.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfigB\x03\xe0\x41\x02\x12#\n\x16output_gcs_bucket_path\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12i\n\x14summarization_config\x18\x03 \x01(\x0b\x32I.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.SummarizationConfigH\x00\x1a\x84\x01\n\x1a\x41gentAssistInputDataConfig\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x1a.\n\x16\x44\x61tasetInputDataConfig\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\xd2\x06\n\x0fInputDataConfig\x12p\n\x16input_data_source_type\x18\x01 \x01(\x0e\x32I.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataSourceTypeB\x05\x18\x01\xe0\x41\x02\x12\x35\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x05\x18\x01\xe0\x41\x01\x12\x33\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x05\x18\x01\xe0\x41\x01\x12\x18\n\x0bsample_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12,\n\x1dis_summary_generation_allowed\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12\x85\x01\n\x19summary_generation_option\x18\x08 \x01(\x0e\x32].google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig.SummaryGenerationOptionB\x03\xe0\x41\x01\x12z\n\x1e\x61gent_assist_input_data_config\x18\x06 \x01(\x0b\x32P.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.AgentAssistInputDataConfigH\x00\x12q\n\x19\x64\x61taset_input_data_config\x18\x07 \x01(\x0b\x32L.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.DatasetInputDataConfigH\x00\"\x87\x01\n\x17SummaryGenerationOption\x12)\n%SUMMARY_GENERATION_OPTION_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x41LWAYS_GENERATE\x10\x01\x12\x17\n\x13GENERATE_IF_MISSING\x10\x02\x12\x13\n\x0f\x44O_NOT_GENERATE\x10\x03\x42\x18\n\x16source_specific_config\x1a\x86\x02\n\x13SummarizationConfig\x12)\n\x1a\x65nable_accuracy_evaluation\x18\x01 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12*\n\x1b\x61\x63\x63uracy_evaluation_version\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12-\n\x1e\x65nable_completeness_evaluation\x18\x03 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12.\n\x1f\x63ompleteness_evaluation_version\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12#\n\x11\x65valuator_version\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x14\n\x12_evaluator_version\"y\n\x13InputDataSourceType\x12&\n\"INPUT_DATA_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x41GENT_ASSIST_CONVERSATIONS\x10\x01\x12\x1a\n\x16INSIGHTS_CONVERSATIONS\x10\x02\x42\x1b\n\x19\x65valuation_feature_config\"e\n\x10\x45valuationStatus\x12\x16\n\x04\x64one\x18\x01 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x30\n\x0fpipeline_status\x18\x02 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x42\x07\n\x05_done2\xdb\x08\n\x14GeneratorEvaluations\x12\xcc\x02\n\x19\x43reateGeneratorEvaluation\x12<.google.cloud.dialogflow.v2.CreateGeneratorEvaluationRequest\x1a\x1d.google.longrunning.Operation\"\xd1\x01\xca\x41V\n\x13GeneratorEvaluation\x12?google.cloud.dialogflow.v2.GeneratorEvaluationOperationMetadata\xda\x41\x1bparent,generator_evaluation\x82\xd3\xe4\x93\x02T\"\x12\x12*cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + CreateGeneratorEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateGeneratorEvaluationRequest").msgclass + GetGeneratorEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetGeneratorEvaluationRequest").msgclass + ListGeneratorEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListGeneratorEvaluationsRequest").msgclass + ListGeneratorEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListGeneratorEvaluationsResponse").msgclass + DeleteGeneratorEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteGeneratorEvaluationRequest").msgclass + GeneratorEvaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluation").msgclass + SummarizationEvaluationMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics").msgclass + SummarizationEvaluationMetrics::AccuracyDecomposition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecomposition").msgclass + SummarizationEvaluationMetrics::AdherenceDecomposition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceDecomposition").msgclass + SummarizationEvaluationMetrics::AdherenceRubric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubric").msgclass + SummarizationEvaluationMetrics::CompletenessRubric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubric").msgclass + SummarizationEvaluationMetrics::Decomposition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.Decomposition").msgclass + SummarizationEvaluationMetrics::EvaluationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult").msgclass + SummarizationEvaluationMetrics::SummarizationEvaluationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SummarizationEvaluationResult").msgclass + SummarizationEvaluationMetrics::OverallScoresByMetric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.OverallScoresByMetric").msgclass + SummarizationEvaluationMetrics::SectionToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionToken").msgclass + SummarizationEvaluationMetrics::ConversationDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail").msgclass + SummarizationEvaluationMetrics::ConversationDetail::MetricDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail").msgclass + SummarizationEvaluationMetrics::ConversationDetail::MetricDetail::SectionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetail").msgclass + GeneratorEvaluationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig").msgclass + GeneratorEvaluationConfig::AgentAssistInputDataConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.AgentAssistInputDataConfig").msgclass + GeneratorEvaluationConfig::DatasetInputDataConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.DatasetInputDataConfig").msgclass + GeneratorEvaluationConfig::InputDataConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig").msgclass + GeneratorEvaluationConfig::InputDataConfig::SummaryGenerationOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig.SummaryGenerationOption").enummodule + GeneratorEvaluationConfig::SummarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.SummarizationConfig").msgclass + GeneratorEvaluationConfig::InputDataSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataSourceType").enummodule + EvaluationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EvaluationStatus").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_services_pb.rb new file mode 100644 index 000000000000..ace1ee743f8b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/generator_evaluation.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/generator_evaluation_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module GeneratorEvaluations + # Service for managing generator evaluations. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.GeneratorEvaluations' + + # Creates evaluation of a generator. + rpc :CreateGeneratorEvaluation, ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest, ::Google::Longrunning::Operation + # Gets an evaluation of generator. + rpc :GetGeneratorEvaluation, ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest, ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation + # Lists evaluations of generator. + rpc :ListGeneratorEvaluations, ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest, ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse + # Deletes an evaluation of generator. + rpc :DeleteGeneratorEvaluation, ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations.rb new file mode 100644 index 000000000000..82927e0f1cc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/generator_evaluations/credentials" +require "google/cloud/dialogflow/v2/generator_evaluations/paths" +require "google/cloud/dialogflow/v2/generator_evaluations/operations" +require "google/cloud/dialogflow/v2/generator_evaluations/client" +require "google/cloud/dialogflow/v2/generator_evaluations/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing generator evaluations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/generator_evaluations" + # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/generator_evaluations/rest" + # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new + # + module GeneratorEvaluations + end + end + end + end +end + +helper_path = ::File.join __dir__, "generator_evaluations", "helpers.rb" +require "google/cloud/dialogflow/v2/generator_evaluations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/client.rb new file mode 100644 index 000000000000..bc4b0d6a1f44 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/client.rb @@ -0,0 +1,817 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/generator_evaluation_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module GeneratorEvaluations + ## + # Client for the GeneratorEvaluations service. + # + # Service for managing generator evaluations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :generator_evaluations_stub + + ## + # Configure the GeneratorEvaluations Client class. + # + # See {::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GeneratorEvaluations clients + # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::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 + @generator_evaluations_stub.universe_domain + end + + ## + # Create a new GeneratorEvaluations client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GeneratorEvaluations 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/dialogflow/v2/generator_evaluation_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 + + @generator_evaluations_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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 + ) + + @generator_evaluations_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 = @generator_evaluations_stub.endpoint + config.universe_domain = @generator_evaluations_stub.universe_domain + config.logger = @generator_evaluations_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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 + @generator_evaluations_stub.logger + end + + # Service calls + + ## + # Creates evaluation of a generator. + # + # @overload create_generator_evaluation(request, options = nil) + # Pass arguments to `create_generator_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator_evaluation(parent: nil, generator_evaluation: nil) + # Pass arguments to `create_generator_evaluation` via keyword arguments. Note that at + # least one keyword argument is 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 generator resource name. Format: + # `projects//locations//generators/` + # @param generator_evaluation [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation, ::Hash] + # Required. The generator evaluation to be created. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new + # + # # Call the create_generator_evaluation method. + # result = client.create_generator_evaluation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_generator_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest + + # Converts hash and nil to 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_generator_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_generator_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_generator_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generator_evaluations_stub.call_rpc :create_generator_evaluation, 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 an evaluation of generator. + # + # @overload get_generator_evaluation(request, options = nil) + # Pass arguments to `get_generator_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator_evaluation(name: nil) + # Pass arguments to `get_generator_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To 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 generator evaluation resource name. Format: + # `projects//locations//generators//evaluations/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new + # + # # Call the get_generator_evaluation method. + # result = client.get_generator_evaluation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::GeneratorEvaluation. + # p result + # + def get_generator_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest + + # Converts hash and nil to 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_generator_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_generator_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_generator_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generator_evaluations_stub.call_rpc :get_generator_evaluation, 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 evaluations of generator. + # + # @overload list_generator_evaluations(request, options = nil) + # Pass arguments to `list_generator_evaluations` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator_evaluations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_generator_evaluations` via keyword arguments. Note that at + # least one keyword argument is 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 generator resource name. Format: + # `projects//locations//generators/` + # Wildcard value `-` is supported on generator_id to list evaluations across + # all generators under same project. + # @param page_size [::Integer] + # Optional. Maximum number of evaluations to return in a + # single page. By default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.new + # + # # Call the list_generator_evaluations method. + # result = client.list_generator_evaluations 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::Dialogflow::V2::GeneratorEvaluation. + # p item + # end + # + def list_generator_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest + + # Converts hash and nil to 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_generator_evaluations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_generator_evaluations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_generator_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generator_evaluations_stub.call_rpc :list_generator_evaluations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @generator_evaluations_stub, :list_generator_evaluations, 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 an evaluation of generator. + # + # @overload delete_generator_evaluation(request, options = nil) + # Pass arguments to `delete_generator_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator_evaluation(name: nil) + # Pass arguments to `delete_generator_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To 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 generator evaluation resource name. Format: + # `projects//locations//generators// + # evaluations/` + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new + # + # # Call the delete_generator_evaluation method. + # result = client.delete_generator_evaluation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_generator_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest + + # Converts hash and nil to 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_generator_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_generator_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_generator_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generator_evaluations_stub.call_rpc :delete_generator_evaluation, 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 GeneratorEvaluations API. + # + # This class represents the configuration for GeneratorEvaluations, + # 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::Dialogflow::V2::GeneratorEvaluations::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_generator_evaluation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_generator_evaluation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_generator_evaluation.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::Dialogflow::V2::GeneratorEvaluations::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 GeneratorEvaluations 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_generator_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_generator_evaluation + ## + # RPC-specific configuration for `get_generator_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generator_evaluation + ## + # RPC-specific configuration for `list_generator_evaluations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_generator_evaluations + ## + # RPC-specific configuration for `delete_generator_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_generator_evaluation + + # @private + def initialize parent_rpcs = nil + create_generator_evaluation_config = parent_rpcs.create_generator_evaluation if parent_rpcs.respond_to? :create_generator_evaluation + @create_generator_evaluation = ::Gapic::Config::Method.new create_generator_evaluation_config + get_generator_evaluation_config = parent_rpcs.get_generator_evaluation if parent_rpcs.respond_to? :get_generator_evaluation + @get_generator_evaluation = ::Gapic::Config::Method.new get_generator_evaluation_config + list_generator_evaluations_config = parent_rpcs.list_generator_evaluations if parent_rpcs.respond_to? :list_generator_evaluations + @list_generator_evaluations = ::Gapic::Config::Method.new list_generator_evaluations_config + delete_generator_evaluation_config = parent_rpcs.delete_generator_evaluation if parent_rpcs.respond_to? :delete_generator_evaluation + @delete_generator_evaluation = ::Gapic::Config::Method.new delete_generator_evaluation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/credentials.rb new file mode 100644 index 000000000000..95e71680bf96 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module GeneratorEvaluations + # Credentials for the GeneratorEvaluations API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/operations.rb new file mode 100644 index 000000000000..bd204efd8fd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module GeneratorEvaluations + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the GeneratorEvaluations 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 GeneratorEvaluations 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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb new file mode 100644 index 000000000000..35ff8fdd4622 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/paths.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! + + +module Google + module Cloud + module Dialogflow + module V2 + module GeneratorEvaluations + # Path helper methods for the GeneratorEvaluations API. + module Paths + ## + # Create a fully-qualified App resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # + # @return [::String] + def app_path project:, location:, app: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}" + end + + ## + # Create a fully-qualified Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/generators/#{generator}" + end + + ## + # Create a fully-qualified GeneratorEvaluation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation}` + # + # @param project [String] + # @param location [String] + # @param generator [String] + # @param evaluation [String] + # + # @return [::String] + def generator_evaluation_path project:, location:, generator:, evaluation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "generator cannot contain /" if generator.to_s.include? "/" + + "projects/#{project}/locations/#{location}/generators/#{generator}/evaluations/#{evaluation}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # @overload tool_path(project:, location:, tool:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param tool [String] + # + # @overload tool_path(project:, location:, app:, tool:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # @param tool [String] + # + # @return [::String] + def tool_path **args + resources = { + "location:project:tool" => (proc do |project:, location:, tool:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tools/#{tool}" + end), + "app:location:project:tool" => (proc do |project:, location:, app:, tool:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}" + 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 Toolset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # @param toolset [String] + # + # @return [::String] + def toolset_path project:, location:, app:, toolset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest.rb new file mode 100644 index 000000000000..6ab5134a9bff --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/generator_evaluations/credentials" +require "google/cloud/dialogflow/v2/generator_evaluations/paths" +require "google/cloud/dialogflow/v2/generator_evaluations/rest/operations" +require "google/cloud/dialogflow/v2/generator_evaluations/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing generator evaluations. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/generator_evaluations/rest" + # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new + # + module GeneratorEvaluations + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/generator_evaluations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/client.rb new file mode 100644 index 000000000000..c4e20ba5da57 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/client.rb @@ -0,0 +1,754 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/generator_evaluation_pb" +require "google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module GeneratorEvaluations + module Rest + ## + # REST client for the GeneratorEvaluations service. + # + # Service for managing generator evaluations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :generator_evaluations_stub + + ## + # Configure the GeneratorEvaluations Client class. + # + # See {::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all GeneratorEvaluations clients + # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::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 + @generator_evaluations_stub.universe_domain + end + + ## + # Create a new GeneratorEvaluations REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::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 + + @generator_evaluations_stub = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @generator_evaluations_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 = @generator_evaluations_stub.endpoint + config.universe_domain = @generator_evaluations_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @generator_evaluations_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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 + @generator_evaluations_stub.logger + end + + # Service calls + + ## + # Creates evaluation of a generator. + # + # @overload create_generator_evaluation(request, options = nil) + # Pass arguments to `create_generator_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator_evaluation(parent: nil, generator_evaluation: nil) + # Pass arguments to `create_generator_evaluation` via keyword arguments. Note that at + # least one keyword argument is 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 generator resource name. Format: + # `projects//locations//generators/` + # @param generator_evaluation [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation, ::Hash] + # Required. The generator evaluation to be created. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new + # + # # Call the create_generator_evaluation method. + # result = client.create_generator_evaluation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_generator_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest + + # Converts hash and nil to an 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_generator_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generator_evaluation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_generator_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generator_evaluations_stub.create_generator_evaluation 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 an evaluation of generator. + # + # @overload get_generator_evaluation(request, options = nil) + # Pass arguments to `get_generator_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator_evaluation(name: nil) + # Pass arguments to `get_generator_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To 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 generator evaluation resource name. Format: + # `projects//locations//generators//evaluations/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new + # + # # Call the get_generator_evaluation method. + # result = client.get_generator_evaluation request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::GeneratorEvaluation. + # p result + # + def get_generator_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest + + # Converts hash and nil to an 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_generator_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generator_evaluation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_generator_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generator_evaluations_stub.get_generator_evaluation 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 evaluations of generator. + # + # @overload list_generator_evaluations(request, options = nil) + # Pass arguments to `list_generator_evaluations` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator_evaluations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_generator_evaluations` via keyword arguments. Note that at + # least one keyword argument is 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 generator resource name. Format: + # `projects//locations//generators/` + # Wildcard value `-` is supported on generator_id to list evaluations across + # all generators under same project. + # @param page_size [::Integer] + # Optional. Maximum number of evaluations to return in a + # single page. By default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.new + # + # # Call the list_generator_evaluations method. + # result = client.list_generator_evaluations 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::Dialogflow::V2::GeneratorEvaluation. + # p item + # end + # + def list_generator_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest + + # Converts hash and nil to an 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_generator_evaluations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generator_evaluations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_generator_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generator_evaluations_stub.list_generator_evaluations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @generator_evaluations_stub, :list_generator_evaluations, "generator_evaluations", 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 an evaluation of generator. + # + # @overload delete_generator_evaluation(request, options = nil) + # Pass arguments to `delete_generator_evaluation` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator_evaluation(name: nil) + # Pass arguments to `delete_generator_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To 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 generator evaluation resource name. Format: + # `projects//locations//generators// + # evaluations/` + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new + # + # # Call the delete_generator_evaluation method. + # result = client.delete_generator_evaluation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_generator_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest + + # Converts hash and nil to an 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_generator_evaluation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generator_evaluation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_generator_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generator_evaluations_stub.delete_generator_evaluation 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 GeneratorEvaluations REST API. + # + # This class represents the configuration for GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::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_generator_evaluation to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_generator_evaluation.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_generator_evaluation.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 GeneratorEvaluations 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_generator_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_generator_evaluation + ## + # RPC-specific configuration for `get_generator_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generator_evaluation + ## + # RPC-specific configuration for `list_generator_evaluations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_generator_evaluations + ## + # RPC-specific configuration for `delete_generator_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_generator_evaluation + + # @private + def initialize parent_rpcs = nil + create_generator_evaluation_config = parent_rpcs.create_generator_evaluation if parent_rpcs.respond_to? :create_generator_evaluation + @create_generator_evaluation = ::Gapic::Config::Method.new create_generator_evaluation_config + get_generator_evaluation_config = parent_rpcs.get_generator_evaluation if parent_rpcs.respond_to? :get_generator_evaluation + @get_generator_evaluation = ::Gapic::Config::Method.new get_generator_evaluation_config + list_generator_evaluations_config = parent_rpcs.list_generator_evaluations if parent_rpcs.respond_to? :list_generator_evaluations + @list_generator_evaluations = ::Gapic::Config::Method.new list_generator_evaluations_config + delete_generator_evaluation_config = parent_rpcs.delete_generator_evaluation if parent_rpcs.respond_to? :delete_generator_evaluation + @delete_generator_evaluation = ::Gapic::Config::Method.new delete_generator_evaluation_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/operations.rb new file mode 100644 index 000000000000..c26d845cca6c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/operations.rb @@ -0,0 +1,947 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module GeneratorEvaluations + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the GeneratorEvaluations 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 GeneratorEvaluations 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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub.rb new file mode 100644 index 000000000000..3e0881667b1d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub.rb @@ -0,0 +1,326 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/generator_evaluation_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module GeneratorEvaluations + module Rest + ## + # REST service stub for the GeneratorEvaluations 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_generator_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_generator_evaluation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_generator_evaluation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generator_evaluation", + 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_generator_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::GeneratorEvaluation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] + # A result object deserialized from the server's reply + def get_generator_evaluation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_generator_evaluation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generator_evaluation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation.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_generator_evaluations REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListGeneratorEvaluationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse] + # A result object deserialized from the server's reply + def list_generator_evaluations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_generator_evaluations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generator_evaluations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse.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_generator_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_generator_evaluation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_generator_evaluation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generator_evaluation", + 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 create_generator_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest] + # 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_generator_evaluation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/evaluations", + body: "generator_evaluation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_generator_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest] + # 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_generator_evaluation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_generator_evaluations REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest] + # 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_generator_evaluations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/evaluations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_generator_evaluation REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest] + # 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_generator_evaluation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/evaluations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_pb.rb new file mode 100644 index 000000000000..7df048b57c5c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_pb.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/generator.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/dialogflow/v2/agent_coaching_instruction_pb' +require 'google/cloud/dialogflow/v2/ces_app_pb' +require 'google/cloud/dialogflow/v2/ces_tool_pb' +require 'google/cloud/dialogflow/v2/tool_call_pb' +require 'google/cloud/dialogflow/v2/toolset_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/cloud/dialogflow/v2/generator.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a;google/cloud/dialogflow/v2/agent_coaching_instruction.proto\x1a(google/cloud/dialogflow/v2/ces_app.proto\x1a)google/cloud/dialogflow/v2/ces_tool.proto\x1a*google/cloud/dialogflow/v2/tool_call.proto\x1a(google/cloud/dialogflow/v2/toolset.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb7\x01\n\x16\x43reateGeneratorRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12=\n\tgenerator\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorB\x03\xe0\x41\x02\x12\x19\n\x0cgenerator_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"P\n\x13GetGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\"\x8d\x01\n\x15ListGeneratorsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\"l\n\x16ListGeneratorsResponse\x12\x39\n\ngenerators\x18\x01 \x03(\x0b\x32%.google.cloud.dialogflow.v2.Generator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x16\x44\x65leteGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\"\x8d\x01\n\x16UpdateGeneratorRequest\x12=\n\tgenerator\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x87\x02\n\x0cMessageEntry\x12@\n\x04role\x18\x01 \x01(\x0e\x32-.google.cloud.dialogflow.v2.MessageEntry.RoleB\x03\xe0\x41\x01\x12\x11\n\x04text\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"P\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHUMAN_AGENT\x10\x01\x12\x13\n\x0f\x41UTOMATED_AGENT\x10\x02\x12\x0c\n\x08\x45ND_USER\x10\x03\"]\n\x13\x43onversationContext\x12\x46\n\x0fmessage_entries\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.MessageEntryB\x03\xe0\x41\x01\"q\n\x18SummarizationSectionList\x12U\n\x16summarization_sections\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.v2.SummarizationSectionB\x03\xe0\x41\x01\"\xa0\x03\n\x0e\x46\x65wShotExample\x12R\n\x14\x63onversation_context\x18\x03 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationContextB\x03\xe0\x41\x01\x12R\n\nextra_info\x18\x04 \x03(\x0b\x32\x39.google.cloud.dialogflow.v2.FewShotExample.ExtraInfoEntryB\x03\xe0\x41\x01\x12Z\n\x1asummarization_section_list\x18\x06 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.SummarizationSectionListH\x00\x12\x44\n\x06output\x18\x07 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xe0\x41\x02\x1a\x30\n\x0e\x45xtraInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x12\n\x10instruction_list\"\xc4\x01\n\x12InferenceParameter\x12#\n\x11max_output_tokens\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1d\n\x0btemperature\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x17\n\x05top_k\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x17\n\x05top_p\x18\x04 \x01(\x01\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x42\x14\n\x12_max_output_tokensB\x0e\n\x0c_temperatureB\x08\n\x06_top_kB\x08\n\x06_top_p\"\xc3\x01\n\x14\x41gentCoachingContext\x12!\n\x14overarching_guidance\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12O\n\x0cinstructions\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.v2.AgentCoachingInstructionB\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14output_language_code\x18\t \x01(\tB\x03\xe0\x41\x01\"\xdc\x02\n\x14SummarizationSection\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\ndefinition\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12H\n\x04type\x18\x03 \x01(\x0e\x32\x35.google.cloud.dialogflow.v2.SummarizationSection.TypeB\x03\xe0\x41\x01\"\xce\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSITUATION\x10\x01\x12\n\n\x06\x41\x43TION\x10\x02\x12\x0e\n\nRESOLUTION\x10\x03\x12\x1b\n\x17REASON_FOR_CANCELLATION\x10\x04\x12\x19\n\x15\x43USTOMER_SATISFACTION\x10\x05\x12\x0c\n\x08\x45NTITIES\x10\x06\x12\x14\n\x10\x43USTOMER_DEFINED\x10\x07\x12\x15\n\x11SITUATION_CONCISE\x10\t\x12\x12\n\x0e\x41\x43TION_CONCISE\x10\n\"\xf2\x01\n\x14SummarizationContext\x12U\n\x16summarization_sections\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.v2.SummarizationSectionB\x03\xe0\x41\x01\x12J\n\x11\x66\x65w_shot_examples\x18\x02 \x03(\x0b\x32*.google.cloud.dialogflow.v2.FewShotExampleB\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14output_language_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\"$\n\x0f\x46reeFormContext\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xd5\x08\n\tGenerator\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12H\n\x11\x66ree_form_context\x18\x0b \x01(\x0b\x32+.google.cloud.dialogflow.v2.FreeFormContextH\x00\x12R\n\x16\x61gent_coaching_context\x18\x0c \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.AgentCoachingContextH\x00\x12Q\n\x15summarization_context\x18\r \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.SummarizationContextH\x00\x12P\n\x13inference_parameter\x18\x04 \x01(\x0b\x32..google.cloud.dialogflow.v2.InferenceParameterB\x03\xe0\x41\x01\x12\x44\n\rtrigger_event\x18\x05 \x01(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x12\x1e\n\x0fpublished_model\x18\x0f \x01(\tB\x03\xe0\x41\x01H\x01\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\x35\n\x05tools\x18\x0e \x03(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\x12]\n\x1asuggestion_deduping_config\x18\x17 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.SuggestionDedupingConfigB\x03\xe0\x41\x01\x12\x43\n\rtoolset_tools\x18\x1b \x03(\x0b\x32\'.google.cloud.dialogflow.v2.ToolsetToolB\x03\xe0\x41\x01\x12\x44\n\x0e\x63\x65s_tool_specs\x18\x1c \x03(\x0b\x32\'.google.cloud.dialogflow.v2.CesToolSpecB\x03\xe0\x41\x01\x12\x42\n\rces_app_specs\x18\x1d \x03(\x0b\x32&.google.cloud.dialogflow.v2.CesAppSpecB\x03\xe0\x41\x01:\x7f\xea\x41|\n#dialogflow.googleapis.com/Generator\x12>projects/{project}/locations/{location}/generators/{generator}*\ngenerators2\tgeneratorB\t\n\x07\x63ontextB\x12\n\x10\x66oundation_model\"+\n\x12\x46reeFormSuggestion\x12\x15\n\x08response\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xae\x01\n\x11SummarySuggestion\x12[\n\x10summary_sections\x18\x01 \x03(\x0b\x32<.google.cloud.dialogflow.v2.SummarySuggestion.SummarySectionB\x03\xe0\x41\x02\x1a<\n\x0eSummarySection\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07summary\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xc0\t\n\x17\x41gentCoachingSuggestion\x12Z\n\x17\x61pplicable_instructions\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.v2.AgentCoachingInstructionB\x03\xe0\x41\x01\x12p\n\x18\x61gent_action_suggestions\x18\x02 \x03(\x0b\x32I.google.cloud.dialogflow.v2.AgentCoachingSuggestion.AgentActionSuggestionB\x03\xe0\x41\x01\x12\x61\n\x10sample_responses\x18\x03 \x03(\x0b\x32\x42.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SampleResponseB\x03\xe0\x41\x01\x1a+\n\x07Sources\x12 \n\x13instruction_indexes\x18\x02 \x03(\x05\x42\x03\xe0\x41\x03\x1a\xde\x02\n\x14\x44uplicateCheckResult\x12\x80\x01\n\x15\x64uplicate_suggestions\x18\x01 \x03(\x0b\x32\\.google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult.DuplicateSuggestionB\x03\xe0\x41\x03\x1a\xc2\x01\n\x13\x44uplicateSuggestion\x12\x1a\n\ranswer_record\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12Q\n\x07sources\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SourcesB\x03\xe0\x41\x03\x12\x1d\n\x10suggestion_index\x18\x03 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1d\n\x10similarity_score\x18\x04 \x01(\x02\x42\x03\xe0\x41\x03\x1a\xf4\x01\n\x15\x41gentActionSuggestion\x12\x19\n\x0c\x61gent_action\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x07sources\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SourcesB\x03\xe0\x41\x03\x12m\n\x16\x64uplicate_check_result\x18\x03 \x01(\x0b\x32H.google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResultB\x03\xe0\x41\x03\x1a\xee\x01\n\x0eSampleResponse\x12\x1a\n\rresponse_text\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x07sources\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SourcesB\x03\xe0\x41\x03\x12m\n\x16\x64uplicate_check_result\x18\x03 \x01(\x0b\x32H.google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResultB\x03\xe0\x41\x03\"\x9e\x04\n\x13GeneratorSuggestion\x12S\n\x14\x66ree_form_suggestion\x18\x01 \x01(\x0b\x32..google.cloud.dialogflow.v2.FreeFormSuggestionB\x03\xe0\x41\x01H\x00\x12P\n\x12summary_suggestion\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SummarySuggestionB\x03\xe0\x41\x01H\x00\x12]\n\x19\x61gent_coaching_suggestion\x18\x03 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.AgentCoachingSuggestionB\x03\xe0\x41\x01H\x00\x12Y\n\x0etool_call_info\x18\t \x03(\x0b\x32<.google.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfoB\x03\xe0\x41\x01\x1a\x97\x01\n\x0cToolCallInfo\x12<\n\ttool_call\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.v2.ToolCallB\x03\xe0\x41\x02\x12I\n\x10tool_call_result\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ToolCallResultB\x03\xe0\x41\x02\x42\x0c\n\nsuggestion\"[\n\x18SuggestionDedupingConfig\x12\x1c\n\x0f\x65nable_deduping\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12!\n\x14similarity_threshold\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\"\xb8\x04\n\x0bRaiSettings\x12W\n\x14rai_category_configs\x18\x01 \x03(\x0b\x32\x39.google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig\x1a\xcf\x03\n\x11RaiCategoryConfig\x12\\\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32\x45.google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategoryB\x03\xe0\x41\x01\x12j\n\x11sensitivity_level\x18\x02 \x01(\x0e\x32J.google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.SensitivityLevelB\x03\xe0\x41\x01\"z\n\x0bRaiCategory\x12\x1c\n\x18RAI_CATEGORY_UNSPECIFIED\x10\x00\x12\x15\n\x11\x44\x41NGEROUS_CONTENT\x10\x01\x12\x15\n\x11SEXUALLY_EXPLICIT\x10\x02\x12\x0e\n\nHARASSMENT\x10\x03\x12\x0f\n\x0bHATE_SPEECH\x10\x04\"t\n\x10SensitivityLevel\x12!\n\x1dSENSITIVITY_LEVEL_UNSPECIFIED\x10\x00\x12\x0e\n\nBLOCK_MOST\x10\x01\x12\x0e\n\nBLOCK_SOME\x10\x02\x12\r\n\tBLOCK_FEW\x10\x03\x12\x0e\n\nBLOCK_NONE\x10\x04*}\n\x0cTriggerEvent\x12\x1d\n\x19TRIGGER_EVENT_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45ND_OF_UTTERANCE\x10\x01\x12\x0f\n\x0bMANUAL_CALL\x10\x02\x12\x14\n\x10\x43USTOMER_MESSAGE\x10\x03\x12\x11\n\rAGENT_MESSAGE\x10\x04\x32\x86\t\n\nGenerators\x12\x81\x02\n\x0f\x43reateGenerator\x12\x32.google.cloud.dialogflow.v2.CreateGeneratorRequest\x1a%.google.cloud.dialogflow.v2.Generator\"\x92\x01\xda\x41\x1dparent,generator,generator_id\x82\xd3\xe4\x93\x02l\"./v2/{parent=projects/*/locations/*}/generators:\tgeneratorZ/\"\"/v2/{parent=projects/*}/generators:\tgenerator\x12\xa5\x01\n\x0cGetGenerator\x12/.google.cloud.dialogflow.v2.GetGeneratorRequest\x1a%.google.cloud.dialogflow.v2.Generator\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v2/{name=projects/*/locations/*/generators/*}\x12\xde\x01\n\x0eListGenerators\x12\x31.google.cloud.dialogflow.v2.ListGeneratorsRequest\x1a\x32.google.cloud.dialogflow.v2.ListGeneratorsResponse\"e\xda\x41\x06parent\x82\xd3\xe4\x93\x02V\x12./v2/{parent=projects/*/locations/*}/generatorsZ$\x12\"/v2/{parent=projects/*}/generators\x12\x9c\x01\n\x0f\x44\x65leteGenerator\x12\x32.google.cloud.dialogflow.v2.DeleteGeneratorRequest\x1a\x16.google.protobuf.Empty\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v2/{name=projects/*/locations/*/generators/*}\x12\xd1\x01\n\x0fUpdateGenerator\x12\x32.google.cloud.dialogflow.v2.UpdateGeneratorRequest\x1a%.google.cloud.dialogflow.v2.Generator\"c\xda\x41\x15generator,update_mask\x82\xd3\xe4\x93\x02\x45\x32\x38/v2/{generator.name=projects/*/locations/*/generators/*}:\tgenerator\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x91\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x0eGeneratorProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41z\n%discoveryengine.googleapis.com/Engine\x12Qprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + CreateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateGeneratorRequest").msgclass + GetGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetGeneratorRequest").msgclass + ListGeneratorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListGeneratorsRequest").msgclass + ListGeneratorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListGeneratorsResponse").msgclass + DeleteGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteGeneratorRequest").msgclass + UpdateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateGeneratorRequest").msgclass + MessageEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.MessageEntry").msgclass + MessageEntry::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.MessageEntry.Role").enummodule + ConversationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationContext").msgclass + SummarizationSectionList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationSectionList").msgclass + FewShotExample = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FewShotExample").msgclass + InferenceParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InferenceParameter").msgclass + AgentCoachingContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingContext").msgclass + SummarizationSection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationSection").msgclass + SummarizationSection::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationSection.Type").enummodule + SummarizationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationContext").msgclass + FreeFormContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FreeFormContext").msgclass + Generator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Generator").msgclass + FreeFormSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FreeFormSuggestion").msgclass + SummarySuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarySuggestion").msgclass + SummarySuggestion::SummarySection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarySuggestion.SummarySection").msgclass + AgentCoachingSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion").msgclass + AgentCoachingSuggestion::Sources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources").msgclass + AgentCoachingSuggestion::DuplicateCheckResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult").msgclass + AgentCoachingSuggestion::DuplicateCheckResult::DuplicateSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult.DuplicateSuggestion").msgclass + AgentCoachingSuggestion::AgentActionSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.AgentActionSuggestion").msgclass + AgentCoachingSuggestion::SampleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.SampleResponse").msgclass + GeneratorSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorSuggestion").msgclass + GeneratorSuggestion::ToolCallInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfo").msgclass + SuggestionDedupingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionDedupingConfig").msgclass + RaiSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RaiSettings").msgclass + RaiSettings::RaiCategoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig").msgclass + RaiSettings::RaiCategoryConfig::RaiCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategory").enummodule + RaiSettings::RaiCategoryConfig::SensitivityLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.SensitivityLevel").enummodule + TriggerEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TriggerEvent").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_services_pb.rb new file mode 100644 index 000000000000..b00d0a5139f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_services_pb.rb @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/generator.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/generator_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Generators + # Generator Service for LLM powered Agent Assist. This service manages the + # configurations of user owned Generators, such as description, context and + # instruction, input/output format, etc. The generator resources will be used + # inside a conversation and will be triggered by TriggerEvent to query LLM for + # answers. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Generators' + + # Creates a generator. + rpc :CreateGenerator, ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest, ::Google::Cloud::Dialogflow::V2::Generator + # Retrieves a generator. + rpc :GetGenerator, ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest, ::Google::Cloud::Dialogflow::V2::Generator + # Lists generators. + rpc :ListGenerators, ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest, ::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse + # Deletes a generator. + rpc :DeleteGenerator, ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest, ::Google::Protobuf::Empty + # Updates a generator. + rpc :UpdateGenerator, ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest, ::Google::Cloud::Dialogflow::V2::Generator + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators.rb new file mode 100644 index 000000000000..ed9938455991 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/generators/credentials" +require "google/cloud/dialogflow/v2/generators/paths" +require "google/cloud/dialogflow/v2/generators/client" +require "google/cloud/dialogflow/v2/generators/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Generator Service for LLM powered Agent Assist. This service manages the + # configurations of user owned Generators, such as description, context and + # instruction, input/output format, etc. The generator resources will be used + # inside a conversation and will be triggered by TriggerEvent to query LLM for + # answers. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/generators" + # client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/generators/rest" + # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new + # + module Generators + end + end + end + end +end + +helper_path = ::File.join __dir__, "generators", "helpers.rb" +require "google/cloud/dialogflow/v2/generators/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/client.rb new file mode 100644 index 000000000000..9c0e10b47d47 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/client.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 "google/cloud/errors" +require "google/cloud/dialogflow/v2/generator_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Generators + ## + # Client for the Generators service. + # + # Generator Service for LLM powered Agent Assist. This service manages the + # configurations of user owned Generators, such as description, context and + # instruction, input/output format, etc. The generator resources will be used + # inside a conversation and will be triggered by TriggerEvent to query LLM for + # answers. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :generators_stub + + ## + # Configure the Generators Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Generators::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Generators clients + # ::Google::Cloud::Dialogflow::V2::Generators::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Generators 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::Dialogflow::V2::Generators::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 + @generators_stub.universe_domain + end + + ## + # Create a new Generators client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Generators 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/dialogflow/v2/generator_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 + + @generators_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Generators::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 + ) + + @generators_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 = @generators_stub.endpoint + config.universe_domain = @generators_stub.universe_domain + config.logger = @generators_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 + @generators_stub.logger + end + + # Service calls + + ## + # Creates a generator. + # + # @overload create_generator(request, options = nil) + # Pass arguments to `create_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator(parent: nil, generator: nil, generator_id: nil) + # Pass arguments to `create_generator` via keyword arguments. Note that at + # least one keyword argument is 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 project/location to create generator for. Format: + # `projects//locations/` + # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] + # Required. The generator to create. + # @param generator_id [::String] + # Optional. The ID to use for the generator, which will become the final + # component of the generator's resource name. + # + # The generator ID must be compliant with the regression formula + # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + # If the field is not provided, an Id will be auto-generated. + # If the field is provided, the caller is responsible for + # 1. the uniqueness of the ID, otherwise the request will be rejected. + # 2. the consistency for whether to use custom ID or not under a project to + # better ensure uniqueness. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Generator] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new + # + # # Call the create_generator method. + # result = client.create_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. + # p result + # + def create_generator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest + + # Converts hash and nil to 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_generator.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_generator.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_generator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.call_rpc :create_generator, 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 + + ## + # Retrieves a generator. + # + # @overload get_generator(request, options = nil) + # Pass arguments to `get_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetGeneratorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator(name: nil) + # Pass arguments to `get_generator` via keyword arguments. Note that at + # least one keyword argument is required. To 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 generator resource name to retrieve. Format: + # `projects//locations//generators/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Generator] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new + # + # # Call the get_generator method. + # result = client.get_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. + # p result + # + def get_generator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest + + # Converts hash and nil to 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_generator.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_generator.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_generator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.call_rpc :get_generator, 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 generators. + # + # @overload list_generators(request, options = nil) + # Pass arguments to `list_generators` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generators(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_generators` via keyword arguments. Note that at + # least one keyword argument is 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 project/location to list generators for. Format: + # `projects//locations/` + # @param page_size [::Integer] + # Optional. Maximum number of conversation models to return in a single page. + # Default to 10. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Generator>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Generator>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.new + # + # # Call the list_generators method. + # result = client.list_generators 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::Dialogflow::V2::Generator. + # p item + # end + # + def list_generators request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest + + # Converts hash and nil to 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_generators.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_generators.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_generators.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.call_rpc :list_generators, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @generators_stub, :list_generators, 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 generator. + # + # @overload delete_generator(request, options = nil) + # Pass arguments to `delete_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator(name: nil) + # Pass arguments to `delete_generator` via keyword arguments. Note that at + # least one keyword argument is required. To 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 generator resource name to delete. Format: + # `projects//locations//generators/` + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new + # + # # Call the delete_generator method. + # result = client.delete_generator request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_generator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest + + # Converts hash and nil to 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_generator.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_generator.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_generator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.call_rpc :delete_generator, 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 generator. + # + # @overload update_generator(request, options = nil) + # Pass arguments to `update_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator(generator: nil, update_mask: nil) + # Pass arguments to `update_generator` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] + # Required. The generator to update. + # The name field of generator is to identify the generator to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Generator] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new + # + # # Call the update_generator method. + # result = client.update_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. + # p result + # + def update_generator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest + + # Converts hash and nil to 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_generator.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.generator&.name + header_params["generator.name"] = request.generator.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_generator.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_generator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.call_rpc :update_generator, 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 Generators API. + # + # This class represents the configuration for Generators, + # 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::Dialogflow::V2::Generators::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_generator to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Generators::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_generator.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_generator.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::Dialogflow::V2::Generators::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Generators 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :create_generator + ## + # RPC-specific configuration for `get_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generator + ## + # RPC-specific configuration for `list_generators` + # @return [::Gapic::Config::Method] + # + attr_reader :list_generators + ## + # RPC-specific configuration for `delete_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_generator + ## + # RPC-specific configuration for `update_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generator + + # @private + def initialize parent_rpcs = nil + create_generator_config = parent_rpcs.create_generator if parent_rpcs.respond_to? :create_generator + @create_generator = ::Gapic::Config::Method.new create_generator_config + get_generator_config = parent_rpcs.get_generator if parent_rpcs.respond_to? :get_generator + @get_generator = ::Gapic::Config::Method.new get_generator_config + list_generators_config = parent_rpcs.list_generators if parent_rpcs.respond_to? :list_generators + @list_generators = ::Gapic::Config::Method.new list_generators_config + delete_generator_config = parent_rpcs.delete_generator if parent_rpcs.respond_to? :delete_generator + @delete_generator = ::Gapic::Config::Method.new delete_generator_config + update_generator_config = parent_rpcs.update_generator if parent_rpcs.respond_to? :update_generator + @update_generator = ::Gapic::Config::Method.new update_generator_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/credentials.rb new file mode 100644 index 000000000000..9aa7a8751e1f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Generators + # Credentials for the Generators API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/paths.rb new file mode 100644 index 000000000000..5728fa010b92 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/paths.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! + + +module Google + module Cloud + module Dialogflow + module V2 + module Generators + # Path helper methods for the Generators API. + module Paths + ## + # Create a fully-qualified App resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # + # @return [::String] + def app_path project:, location:, app: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}" + end + + ## + # Create a fully-qualified Generator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/generators/{generator}` + # + # @param project [String] + # @param location [String] + # @param generator [String] + # + # @return [::String] + def generator_path project:, location:, generator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/generators/#{generator}" + end + + ## + # 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 + + ## + # Create a fully-qualified Tool resource string. + # + # @overload tool_path(project:, location:, tool:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param tool [String] + # + # @overload tool_path(project:, location:, app:, tool:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # @param tool [String] + # + # @return [::String] + def tool_path **args + resources = { + "location:project:tool" => (proc do |project:, location:, tool:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tools/#{tool}" + end), + "app:location:project:tool" => (proc do |project:, location:, app:, tool:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}" + 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 Toolset resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + # + # @param project [String] + # @param location [String] + # @param app [String] + # @param toolset [String] + # + # @return [::String] + def toolset_path project:, location:, app:, toolset: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" + + "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest.rb new file mode 100644 index 000000000000..a10b5a88669c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/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 "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/generators/credentials" +require "google/cloud/dialogflow/v2/generators/paths" +require "google/cloud/dialogflow/v2/generators/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Generator Service for LLM powered Agent Assist. This service manages the + # configurations of user owned Generators, such as description, context and + # instruction, input/output format, etc. The generator resources will be used + # inside a conversation and will be triggered by TriggerEvent to query LLM for + # answers. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/generators/rest" + # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new + # + module Generators + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/generators/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/client.rb new file mode 100644 index 000000000000..b0c35f150054 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/client.rb @@ -0,0 +1,830 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/generator_pb" +require "google/cloud/dialogflow/v2/generators/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Generators + module Rest + ## + # REST client for the Generators service. + # + # Generator Service for LLM powered Agent Assist. This service manages the + # configurations of user owned Generators, such as description, context and + # instruction, input/output format, etc. The generator resources will be used + # inside a conversation and will be triggered by TriggerEvent to query LLM for + # answers. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :generators_stub + + ## + # Configure the Generators Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Generators::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Generators clients + # ::Google::Cloud::Dialogflow::V2::Generators::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Generators 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::Dialogflow::V2::Generators::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 + @generators_stub.universe_domain + end + + ## + # Create a new Generators REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Generators 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 + + @generators_stub = ::Google::Cloud::Dialogflow::V2::Generators::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @generators_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 = @generators_stub.endpoint + config.universe_domain = @generators_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @generators_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 + @generators_stub.logger + end + + # Service calls + + ## + # Creates a generator. + # + # @overload create_generator(request, options = nil) + # Pass arguments to `create_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator(parent: nil, generator: nil, generator_id: nil) + # Pass arguments to `create_generator` via keyword arguments. Note that at + # least one keyword argument is 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 project/location to create generator for. Format: + # `projects//locations/` + # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] + # Required. The generator to create. + # @param generator_id [::String] + # Optional. The ID to use for the generator, which will become the final + # component of the generator's resource name. + # + # The generator ID must be compliant with the regression formula + # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + # If the field is not provided, an Id will be auto-generated. + # If the field is provided, the caller is responsible for + # 1. the uniqueness of the ID, otherwise the request will be rejected. + # 2. the consistency for whether to use custom ID or not under a project to + # better ensure uniqueness. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new + # + # # Call the create_generator method. + # result = client.create_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. + # p result + # + def create_generator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest + + # Converts hash and nil to an 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_generator.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generator.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_generator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.create_generator 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 + + ## + # Retrieves a generator. + # + # @overload get_generator(request, options = nil) + # Pass arguments to `get_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetGeneratorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator(name: nil) + # Pass arguments to `get_generator` via keyword arguments. Note that at + # least one keyword argument is required. To 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 generator resource name to retrieve. Format: + # `projects//locations//generators/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new + # + # # Call the get_generator method. + # result = client.get_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. + # p result + # + def get_generator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest + + # Converts hash and nil to an 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_generator.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generator.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_generator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.get_generator 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 generators. + # + # @overload list_generators(request, options = nil) + # Pass arguments to `list_generators` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generators(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_generators` via keyword arguments. Note that at + # least one keyword argument is 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 project/location to list generators for. Format: + # `projects//locations/` + # @param page_size [::Integer] + # Optional. Maximum number of conversation models to return in a single page. + # Default to 10. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Generator>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Generator>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.new + # + # # Call the list_generators method. + # result = client.list_generators 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::Dialogflow::V2::Generator. + # p item + # end + # + def list_generators request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest + + # Converts hash and nil to an 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_generators.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generators.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_generators.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.list_generators request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @generators_stub, :list_generators, "generators", 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 generator. + # + # @overload delete_generator(request, options = nil) + # Pass arguments to `delete_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator(name: nil) + # Pass arguments to `delete_generator` via keyword arguments. Note that at + # least one keyword argument is required. To 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 generator resource name to delete. Format: + # `projects//locations//generators/` + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new + # + # # Call the delete_generator method. + # result = client.delete_generator request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_generator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest + + # Converts hash and nil to an 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_generator.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generator.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_generator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.delete_generator 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 generator. + # + # @overload update_generator(request, options = nil) + # Pass arguments to `update_generator` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_generator(generator: nil, update_mask: nil) + # Pass arguments to `update_generator` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] + # Required. The generator to update. + # The name field of generator is to identify the generator to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new + # + # # Call the update_generator method. + # result = client.update_generator request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. + # p result + # + def update_generator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest + + # Converts hash and nil to an 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_generator.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_generator.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_generator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @generators_stub.update_generator 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 Generators REST API. + # + # This class represents the configuration for Generators 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::Dialogflow::V2::Generators::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_generator to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_generator.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_generator.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Generators 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :create_generator + ## + # RPC-specific configuration for `get_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :get_generator + ## + # RPC-specific configuration for `list_generators` + # @return [::Gapic::Config::Method] + # + attr_reader :list_generators + ## + # RPC-specific configuration for `delete_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_generator + ## + # RPC-specific configuration for `update_generator` + # @return [::Gapic::Config::Method] + # + attr_reader :update_generator + + # @private + def initialize parent_rpcs = nil + create_generator_config = parent_rpcs.create_generator if parent_rpcs.respond_to? :create_generator + @create_generator = ::Gapic::Config::Method.new create_generator_config + get_generator_config = parent_rpcs.get_generator if parent_rpcs.respond_to? :get_generator + @get_generator = ::Gapic::Config::Method.new get_generator_config + list_generators_config = parent_rpcs.list_generators if parent_rpcs.respond_to? :list_generators + @list_generators = ::Gapic::Config::Method.new list_generators_config + delete_generator_config = parent_rpcs.delete_generator if parent_rpcs.respond_to? :delete_generator + @delete_generator = ::Gapic::Config::Method.new delete_generator_config + update_generator_config = parent_rpcs.update_generator if parent_rpcs.respond_to? :update_generator + @update_generator = ::Gapic::Config::Method.new update_generator_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/service_stub.rb new file mode 100644 index 000000000000..30346afe94d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/service_stub.rb @@ -0,0 +1,403 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/generator_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Generators + module Rest + ## + # REST service stub for the Generators 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_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # A result object deserialized from the server's reply + def create_generator request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_generator_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generator", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Generator.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_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetGeneratorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # A result object deserialized from the server's reply + def get_generator request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_generator_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generator", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Generator.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_generators REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListGeneratorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse] + # A result object deserialized from the server's reply + def list_generators request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_generators_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generators", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse.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_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_generator request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_generator_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generator", + 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_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Generator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # A result object deserialized from the server's reply + def update_generator request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_generator_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_generator", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Generator.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_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest] + # 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_generator_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/generators", + body: "generator", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/generators", + body: "generator", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetGeneratorRequest] + # 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_generator_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_generators REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest] + # 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_generators_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/generators", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/generators", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest] + # 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_generator_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_generator REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest] + # 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_generator_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{generator.name}", + body: "generator", + matches: [ + ["generator.name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb new file mode 100644 index 000000000000..76de63cd451f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/human_agent_assistant_event.proto + +require 'google/protobuf' + +require 'google/cloud/dialogflow/v2/participant_pb' + + +descriptor_data = "\ncloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + HumanAgentAssistantEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantEvent").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_pb.rb new file mode 100644 index 000000000000..b65cd336e1cd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_pb.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/intent.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/dialogflow/v2/context_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n\'google/cloud/dialogflow/v2/intent.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/dialogflow/v2/context.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xdc\x38\n\x06Intent\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\rwebhook_state\x18\x06 \x01(\x0e\x32/.google.cloud.dialogflow.v2.Intent.WebhookStateB\x03\xe0\x41\x01\x12\x15\n\x08priority\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x18\n\x0bis_fallback\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0bml_disabled\x18\x13 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\x12live_agent_handoff\x18\x14 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1c\n\x0f\x65nd_interaction\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12 \n\x13input_context_names\x18\x07 \x03(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x65vents\x18\x08 \x03(\tB\x03\xe0\x41\x01\x12P\n\x10training_phrases\x18\t \x03(\x0b\x32\x31.google.cloud.dialogflow.v2.Intent.TrainingPhraseB\x03\xe0\x41\x01\x12\x13\n\x06\x61\x63tion\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x41\n\x0foutput_contexts\x18\x0b \x03(\x0b\x32#.google.cloud.dialogflow.v2.ContextB\x03\xe0\x41\x01\x12\x1b\n\x0ereset_contexts\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\x45\n\nparameters\x18\r \x03(\x0b\x32,.google.cloud.dialogflow.v2.Intent.ParameterB\x03\xe0\x41\x01\x12\x41\n\x08messages\x18\x0e \x03(\x0b\x32*.google.cloud.dialogflow.v2.Intent.MessageB\x03\xe0\x41\x01\x12\\\n\x1a\x64\x65\x66\x61ult_response_platforms\x18\x0f \x03(\x0e\x32\x33.google.cloud.dialogflow.v2.Intent.Message.PlatformB\x03\xe0\x41\x01\x12&\n\x19root_followup_intent_name\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12#\n\x1bparent_followup_intent_name\x18\x11 \x01(\t\x12X\n\x14\x66ollowup_intent_info\x18\x12 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.Intent.FollowupIntentInfoB\x03\xe0\x41\x03\x1a\xf6\x02\n\x0eTrainingPhrase\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12I\n\x04type\x18\x02 \x01(\x0e\x32\x36.google.cloud.dialogflow.v2.Intent.TrainingPhrase.TypeB\x03\xe0\x41\x02\x12J\n\x05parts\x18\x03 \x03(\x0b\x32\x36.google.cloud.dialogflow.v2.Intent.TrainingPhrase.PartB\x03\xe0\x41\x02\x12\x1e\n\x11times_added_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x1a]\n\x04Part\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x18\n\x0b\x65ntity_type\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x61lias\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cuser_defined\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45XAMPLE\x10\x01\x12\x10\n\x08TEMPLATE\x10\x02\x1a\x02\x08\x01\x1a\xca\x01\n\tParameter\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x12\n\x05value\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rdefault_value\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18\x65ntity_type_display_name\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tmandatory\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07prompts\x18\x07 \x03(\tB\x03\xe0\x41\x01\x12\x14\n\x07is_list\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x96*\n\x07Message\x12?\n\x04text\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.Intent.Message.TextH\x00\x12\x41\n\x05image\x18\x02 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageH\x00\x12P\n\rquick_replies\x18\x03 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.Intent.Message.QuickRepliesH\x00\x12?\n\x04\x63\x61rd\x18\x04 \x01(\x0b\x32/.google.cloud.dialogflow.v2.Intent.Message.CardH\x00\x12*\n\x07payload\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12V\n\x10simple_responses\x18\x07 \x01(\x0b\x32:.google.cloud.dialogflow.v2.Intent.Message.SimpleResponsesH\x00\x12J\n\nbasic_card\x18\x08 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.Intent.Message.BasicCardH\x00\x12M\n\x0bsuggestions\x18\t \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.Intent.Message.SuggestionsH\x00\x12[\n\x13link_out_suggestion\x18\n \x01(\x0b\x32<.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestionH\x00\x12L\n\x0blist_select\x18\x0b \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.Intent.Message.ListSelectH\x00\x12T\n\x0f\x63\x61rousel_select\x18\x0c \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.CarouselSelectH\x00\x12]\n\x14\x62rowse_carousel_card\x18\x16 \x01(\x0b\x32=.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCardH\x00\x12J\n\ntable_card\x18\x17 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.Intent.Message.TableCardH\x00\x12P\n\rmedia_content\x18\x18 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.Intent.Message.MediaContentH\x00\x12J\n\x08platform\x18\x06 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.Intent.Message.PlatformB\x03\xe0\x41\x01\x1a\x19\n\x04Text\x12\x11\n\x04text\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a@\n\x05Image\x12\x16\n\timage_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x61\x63\x63\x65ssibility_text\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a>\n\x0cQuickReplies\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rquick_replies\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1a\xcb\x01\n\x04\x43\x61rd\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08subtitle\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\timage_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12L\n\x07\x62uttons\x18\x04 \x03(\x0b\x32\x36.google.cloud.dialogflow.v2.Intent.Message.Card.ButtonB\x03\xe0\x41\x01\x1a\x32\n\x06\x42utton\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08postback\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1aQ\n\x0eSimpleResponse\x12\x16\n\x0etext_to_speech\x18\x01 \x01(\t\x12\x0c\n\x04ssml\x18\x02 \x01(\t\x12\x19\n\x0c\x64isplay_text\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1ak\n\x0fSimpleResponses\x12X\n\x10simple_responses\x18\x01 \x03(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.SimpleResponseB\x03\xe0\x41\x02\x1a\x88\x03\n\tBasicCard\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08subtitle\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\x0e\x66ormatted_text\x18\x03 \x01(\t\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x12Q\n\x07\x62uttons\x18\x05 \x03(\x0b\x32;.google.cloud.dialogflow.v2.Intent.Message.BasicCard.ButtonB\x03\xe0\x41\x01\x1a\x9e\x01\n\x06\x42utton\x12\r\n\x05title\x18\x01 \x01(\t\x12g\n\x0fopen_uri_action\x18\x02 \x01(\x0b\x32I.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriActionB\x03\xe0\x41\x02\x1a\x1c\n\rOpenUriAction\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a \n\nSuggestion\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a^\n\x0bSuggestions\x12O\n\x0bsuggestions\x18\x01 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.Intent.Message.SuggestionB\x03\xe0\x41\x02\x1a\x44\n\x11LinkOutSuggestion\x12\x1d\n\x10\x64\x65stination_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a\xd2\x02\n\nListSelect\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12N\n\x05items\x18\x02 \x03(\x0b\x32:.google.cloud.dialogflow.v2.Intent.Message.ListSelect.ItemB\x03\xe0\x41\x02\x12\x15\n\x08subtitle\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a\xc8\x01\n\x04Item\x12L\n\x04info\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfoB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x1a\xaf\x02\n\x0e\x43\x61rouselSelect\x12R\n\x05items\x18\x01 \x03(\x0b\x32>.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.ItemB\x03\xe0\x41\x02\x1a\xc8\x01\n\x04Item\x12L\n\x04info\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfoB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x1a\x39\n\x0eSelectItemInfo\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08synonyms\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1a\x8e\x04\n\x0cMediaContent\x12\x62\n\nmedia_type\x18\x01 \x01(\x0e\x32I.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaTypeB\x03\xe0\x41\x01\x12\x62\n\rmedia_objects\x18\x02 \x03(\x0b\x32K.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject\x1a\xf0\x01\n\x13ResponseMediaObject\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12L\n\x0blarge_image\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01H\x00\x12\x45\n\x04icon\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01H\x00\x12\x13\n\x0b\x63ontent_url\x18\x05 \x01(\tB\x07\n\x05image\"C\n\x11ResponseMediaType\x12#\n\x1fRESPONSE_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x1a\xff\x06\n\x12\x42rowseCarouselCard\x12\x63\n\x05items\x18\x01 \x03(\x0b\x32T.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem\x12u\n\x15image_display_options\x18\x02 \x01(\x0e\x32Q.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptionsB\x03\xe0\x41\x01\x1a\x94\x04\n\x16\x42rowseCarouselCardItem\x12{\n\x0fopen_uri_action\x18\x01 \x01(\x0b\x32\x62.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction\x12\r\n\x05title\x18\x02 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x12\x13\n\x06\x66ooter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\xf8\x01\n\rOpenUrlAction\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x8a\x01\n\rurl_type_hint\x18\x03 \x01(\x0e\x32n.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHintB\x03\xe0\x41\x01\"M\n\x0bUrlTypeHint\x12\x1d\n\x19URL_TYPE_HINT_UNSPECIFIED\x10\x00\x12\x0e\n\nAMP_ACTION\x10\x01\x12\x0f\n\x0b\x41MP_CONTENT\x10\x02\"v\n\x13ImageDisplayOptions\x12%\n!IMAGE_DISPLAY_OPTIONS_UNSPECIFIED\x10\x00\x12\x08\n\x04GRAY\x10\x01\x12\t\n\x05WHITE\x10\x02\x12\x0b\n\x07\x43ROPPED\x10\x03\x12\x16\n\x12\x42LURRED_BACKGROUND\x10\x04\x1a\xf3\x02\n\tTableCard\x12\r\n\x05title\x18\x01 \x01(\t\x12\x15\n\x08subtitle\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x05image\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x12[\n\x11\x63olumn_properties\x18\x04 \x03(\x0b\x32;.google.cloud.dialogflow.v2.Intent.Message.ColumnPropertiesB\x03\xe0\x41\x01\x12J\n\x04rows\x18\x05 \x03(\x0b\x32\x37.google.cloud.dialogflow.v2.Intent.Message.TableCardRowB\x03\xe0\x41\x01\x12Q\n\x07\x62uttons\x18\x06 \x03(\x0b\x32;.google.cloud.dialogflow.v2.Intent.Message.BasicCard.ButtonB\x03\xe0\x41\x01\x1a\xfa\x01\n\x10\x43olumnProperties\x12\x0e\n\x06header\x18\x01 \x01(\t\x12r\n\x14horizontal_alignment\x18\x02 \x01(\x0e\x32O.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignmentB\x03\xe0\x41\x01\"b\n\x13HorizontalAlignment\x12$\n HORIZONTAL_ALIGNMENT_UNSPECIFIED\x10\x00\x12\x0b\n\x07LEADING\x10\x01\x12\n\n\x06\x43\x45NTER\x10\x02\x12\x0c\n\x08TRAILING\x10\x03\x1ax\n\x0cTableCardRow\x12L\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32\x38.google.cloud.dialogflow.v2.Intent.Message.TableCardCellB\x03\xe0\x41\x01\x12\x1a\n\rdivider_after\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x1d\n\rTableCardCell\x12\x0c\n\x04text\x18\x01 \x01(\t\"\xa0\x01\n\x08Platform\x12\x18\n\x14PLATFORM_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x46\x41\x43\x45\x42OOK\x10\x01\x12\t\n\x05SLACK\x10\x02\x12\x0c\n\x08TELEGRAM\x10\x03\x12\x07\n\x03KIK\x10\x04\x12\t\n\x05SKYPE\x10\x05\x12\x08\n\x04LINE\x10\x06\x12\t\n\x05VIBER\x10\x07\x12\x15\n\x11\x41\x43TIONS_ON_GOOGLE\x10\x08\x12\x13\n\x0fGOOGLE_HANGOUTS\x10\x0b\x42\t\n\x07message\x1aW\n\x12\x46ollowupIntentInfo\x12\x1c\n\x14\x66ollowup_intent_name\x18\x01 \x01(\t\x12#\n\x1bparent_followup_intent_name\x18\x02 \x01(\t\"t\n\x0cWebhookState\x12\x1d\n\x19WEBHOOK_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15WEBHOOK_STATE_ENABLED\x10\x01\x12*\n&WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING\x10\x02:\x91\x01\xea\x41\x8d\x01\n dialogflow.googleapis.com/Intent\x12)projects/{project}/agent/intents/{intent}\x12>projects/{project}/locations/{location}/agent/intents/{intent}\"\xdd\x01\n\x12ListIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x03 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x05 \x01(\tB\x03\xe0\x41\x01\"c\n\x13ListIntentsResponse\x12\x33\n\x07intents\x18\x01 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x10GetIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x03 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\"\xe6\x01\n\x13\x43reateIntentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x37\n\x06intent\x18\x02 \x01(\x0b\x32\".google.cloud.dialogflow.v2.IntentB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x04 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\"\xe2\x01\n\x13UpdateIntentRequest\x12\x37\n\x06intent\x18\x01 \x01(\x0b\x32\".google.cloud.dialogflow.v2.IntentB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x04 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\"M\n\x13\x44\x65leteIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\"\xdd\x02\n\x19\x42\x61tchUpdateIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x1a\n\x10intent_batch_uri\x18\x02 \x01(\tH\x00\x12\x46\n\x13intent_batch_inline\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.IntentBatchH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x06 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\x42\x0e\n\x0cintent_batch\"Q\n\x1a\x42\x61tchUpdateIntentsResponse\x12\x33\n\x07intents\x18\x01 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent\"\x8f\x01\n\x19\x42\x61tchDeleteIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x38\n\x07intents\x18\x02 \x03(\x0b\x32\".google.cloud.dialogflow.v2.IntentB\x03\xe0\x41\x02\"B\n\x0bIntentBatch\x12\x33\n\x07intents\x18\x01 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent*?\n\nIntentView\x12\x1b\n\x17INTENT_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10INTENT_VIEW_FULL\x10\x01\x32\xf3\x10\n\x07Intents\x12\xf0\x02\n\x0bListIntents\x12..google.cloud.dialogflow.v2.ListIntentsRequest\x1a/.google.cloud.dialogflow.v2.ListIntentsResponse\"\xff\x01\xda\x41\x06parent\xda\x41\x14parent,language_code\x82\xd3\xe4\x93\x02\xd8\x01\x12%/v2/{parent=projects/*/agent}/intentsZ3\x12\x31/v2/{parent=projects/*/locations/*/agent}/intentsZ6\x12\x34/v2/{parent=projects/*/agent/environments/*}/intentsZB\x12@/v2/{parent=projects/*/locations/*/agent/environments/*}/intents\x12\xdd\x01\n\tGetIntent\x12,.google.cloud.dialogflow.v2.GetIntentRequest\x1a\".google.cloud.dialogflow.v2.Intent\"~\xda\x41\x04name\xda\x41\x12name,language_code\x82\xd3\xe4\x93\x02\\\x12%/v2/{name=projects/*/agent/intents/*}Z3\x12\x31/v2/{name=projects/*/locations/*/agent/intents/*}\x12\x86\x02\n\x0c\x43reateIntent\x12/.google.cloud.dialogflow.v2.CreateIntentRequest\x1a\".google.cloud.dialogflow.v2.Intent\"\xa0\x01\xda\x41\rparent,intent\xda\x41\x1bparent,intent,language_code\x82\xd3\xe4\x93\x02l\"%/v2/{parent=projects/*/agent}/intents:\x06intentZ;\"1/v2/{parent=projects/*/locations/*/agent}/intents:\x06intent\x12\xa0\x02\n\x0cUpdateIntent\x12/.google.cloud.dialogflow.v2.UpdateIntentRequest\x1a\".google.cloud.dialogflow.v2.Intent\"\xba\x01\xda\x41\x14intent,language_code\xda\x41 intent,language_code,update_mask\x82\xd3\xe4\x93\x02z2,/v2/{intent.name=projects/*/agent/intents/*}:\x06intentZB28/v2/{intent.name=projects/*/locations/*/agent/intents/*}:\x06intent\x12\xc2\x01\n\x0c\x44\x65leteIntent\x12/.google.cloud.dialogflow.v2.DeleteIntentRequest\x1a\x16.google.protobuf.Empty\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\*%/v2/{name=projects/*/agent/intents/*}Z3*1/v2/{name=projects/*/locations/*/agent/intents/*}\x12\xf6\x02\n\x12\x42\x61tchUpdateIntents\x12\x35.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest\x1a\x1d.google.longrunning.Operation\"\x89\x02\xca\x41O\n5google.cloud.dialogflow.v2.BatchUpdateIntentsResponse\x12\x16google.protobuf.Struct\xda\x41\x17parent,intent_batch_uri\xda\x41\x1aparent,intent_batch_inline\x82\xd3\xe4\x93\x02z\"1/v2/{parent=projects/*/agent}/intents:batchUpdate:\x01*ZB\"=/v2/{parent=projects/*/locations/*/agent}/intents:batchUpdate:\x01*\x12\xb0\x02\n\x12\x42\x61tchDeleteIntents\x12\x35.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest\x1a\x1d.google.longrunning.Operation\"\xc3\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x0eparent,intents\x82\xd3\xe4\x93\x02z\"1/v2/{parent=projects/*/agent}/intents:batchDelete:\x01*ZB\"=/v2/{parent=projects/*/locations/*/agent}/intents:batchDelete:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x91\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0bIntentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + Intent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent").msgclass + Intent::TrainingPhrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.TrainingPhrase").msgclass + Intent::TrainingPhrase::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part").msgclass + Intent::TrainingPhrase::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type").enummodule + Intent::Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Parameter").msgclass + Intent::Message = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message").msgclass + Intent::Message::Text = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Text").msgclass + Intent::Message::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Image").msgclass + Intent::Message::QuickReplies = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.QuickReplies").msgclass + Intent::Message::Card = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Card").msgclass + Intent::Message::Card::Button = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Card.Button").msgclass + Intent::Message::SimpleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.SimpleResponse").msgclass + Intent::Message::SimpleResponses = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.SimpleResponses").msgclass + Intent::Message::BasicCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BasicCard").msgclass + Intent::Message::BasicCard::Button = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button").msgclass + Intent::Message::BasicCard::Button::OpenUriAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction").msgclass + Intent::Message::Suggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Suggestion").msgclass + Intent::Message::Suggestions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Suggestions").msgclass + Intent::Message::LinkOutSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion").msgclass + Intent::Message::ListSelect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.ListSelect").msgclass + Intent::Message::ListSelect::Item = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item").msgclass + Intent::Message::CarouselSelect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.CarouselSelect").msgclass + Intent::Message::CarouselSelect::Item = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item").msgclass + Intent::Message::SelectItemInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo").msgclass + Intent::Message::MediaContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.MediaContent").msgclass + Intent::Message::MediaContent::ResponseMediaObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject").msgclass + Intent::Message::MediaContent::ResponseMediaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType").enummodule + Intent::Message::BrowseCarouselCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard").msgclass + Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem").msgclass + Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem::OpenUrlAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction").msgclass + Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem::OpenUrlAction::UrlTypeHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint").enummodule + Intent::Message::BrowseCarouselCard::ImageDisplayOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions").enummodule + Intent::Message::TableCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.TableCard").msgclass + Intent::Message::ColumnProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.ColumnProperties").msgclass + Intent::Message::ColumnProperties::HorizontalAlignment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment").enummodule + Intent::Message::TableCardRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.TableCardRow").msgclass + Intent::Message::TableCardCell = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.TableCardCell").msgclass + Intent::Message::Platform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Platform").enummodule + Intent::FollowupIntentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.FollowupIntentInfo").msgclass + Intent::WebhookState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.WebhookState").enummodule + ListIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListIntentsRequest").msgclass + ListIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListIntentsResponse").msgclass + GetIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetIntentRequest").msgclass + CreateIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateIntentRequest").msgclass + UpdateIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateIntentRequest").msgclass + DeleteIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteIntentRequest").msgclass + BatchUpdateIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateIntentsRequest").msgclass + BatchUpdateIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateIntentsResponse").msgclass + BatchDeleteIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteIntentsRequest").msgclass + IntentBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IntentBatch").msgclass + IntentView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IntentView").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_services_pb.rb new file mode 100644 index 000000000000..04143003bd3a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_services_pb.rb @@ -0,0 +1,95 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/intent.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/intent_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Intents + # Service for managing [Intents][google.cloud.dialogflow.v2.Intent]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Intents' + + # Returns the list of all intents in the specified agent. + rpc :ListIntents, ::Google::Cloud::Dialogflow::V2::ListIntentsRequest, ::Google::Cloud::Dialogflow::V2::ListIntentsResponse + # Retrieves the specified intent. + rpc :GetIntent, ::Google::Cloud::Dialogflow::V2::GetIntentRequest, ::Google::Cloud::Dialogflow::V2::Intent + # Creates an intent in the specified agent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :CreateIntent, ::Google::Cloud::Dialogflow::V2::CreateIntentRequest, ::Google::Cloud::Dialogflow::V2::Intent + # Updates the specified intent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :UpdateIntent, ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest, ::Google::Cloud::Dialogflow::V2::Intent + # Deletes the specified intent and its direct or indirect followup intents. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :DeleteIntent, ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest, ::Google::Protobuf::Empty + # Updates/Creates multiple intents in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse] + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :BatchUpdateIntents, ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest, ::Google::Longrunning::Operation + # Deletes intents in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + rpc :BatchDeleteIntents, ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents.rb new file mode 100644 index 000000000000..b69d2a8c2cb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/intents/credentials" +require "google/cloud/dialogflow/v2/intents/paths" +require "google/cloud/dialogflow/v2/intents/operations" +require "google/cloud/dialogflow/v2/intents/client" +require "google/cloud/dialogflow/v2/intents/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Intent Intents}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/intents" + # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/intents/rest" + # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + module Intents + end + end + end + end +end + +helper_path = ::File.join __dir__, "intents", "helpers.rb" +require "google/cloud/dialogflow/v2/intents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb new file mode 100644 index 000000000000..5101b9406785 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb @@ -0,0 +1,1204 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/intent_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Intents + ## + # Client for the Intents service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Intent Intents}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :intents_stub + + ## + # Configure the Intents Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Intents::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Intents clients + # ::Google::Cloud::Dialogflow::V2::Intents::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Intents 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::Dialogflow::V2::Intents::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 + @intents_stub.universe_domain + end + + ## + # Create a new Intents client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Intents 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/dialogflow/v2/intent_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 + + @intents_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Intents::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 + ) + + @intents_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 = @intents_stub.endpoint + config.universe_domain = @intents_stub.universe_domain + config.logger = @intents_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::Intents::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 + @intents_stub.logger + end + + # Service calls + + ## + # Returns the list of all intents in the specified agent. + # + # @overload list_intents(request, options = nil) + # Pass arguments to `list_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intents(parent: nil, language_code: nil, intent_view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_intents` via keyword arguments. Note that at + # least one keyword argument is 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 agent to list all intents from. + # Format: `projects//agent` or `projects//locations//agent`. + # + # Alternatively, you can specify the environment to list intents for. + # Format: `projects//agent/environments/` + # or `projects//locations//agent/environments/`. + # Note: training phrases of the intents will not be returned for non-draft + # environment. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Intent>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Intent>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new + # + # # Call the list_intents method. + # result = client.list_intents 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::Dialogflow::V2::Intent. + # p item + # end + # + def list_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListIntentsRequest + + # Converts hash and nil to 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_intents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_intents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.call_rpc :list_intents, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @intents_stub, :list_intents, 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 + + ## + # Retrieves the specified intent. + # + # @overload get_intent(request, options = nil) + # Pass arguments to `get_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intent(name: nil, language_code: nil, intent_view: nil) + # Pass arguments to `get_intent` via keyword arguments. Note that at + # least one keyword argument is required. To 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 intent. + # Format: `projects//agent/intents/`. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Intent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new + # + # # Call the get_intent method. + # result = client.get_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + # p result + # + def get_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetIntentRequest + + # Converts hash and nil to 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_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_intent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.call_rpc :get_intent, 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 an intent in the specified agent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload create_intent(request, options = nil) + # Pass arguments to `create_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intent(parent: nil, intent: nil, language_code: nil, intent_view: nil) + # Pass arguments to `create_intent` via keyword arguments. Note that at + # least one keyword argument is 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 agent to create a intent for. + # Format: `projects//agent`. + # @param intent [::Google::Cloud::Dialogflow::V2::Intent, ::Hash] + # Required. The intent to create. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Intent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new + # + # # Call the create_intent method. + # result = client.create_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + # p result + # + def create_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateIntentRequest + + # Converts hash and nil to 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_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_intent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.call_rpc :create_intent, 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 the specified intent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload update_intent(request, options = nil) + # Pass arguments to `update_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intent(intent: nil, language_code: nil, update_mask: nil, intent_view: nil) + # Pass arguments to `update_intent` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param intent [::Google::Cloud::Dialogflow::V2::Intent, ::Hash] + # Required. The intent to update. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Intent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new + # + # # Call the update_intent method. + # result = client.update_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + # p result + # + def update_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest + + # Converts hash and nil to 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_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.intent&.name + header_params["intent.name"] = request.intent.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_intent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.call_rpc :update_intent, 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 specified intent and its direct or indirect followup intents. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload delete_intent(request, options = nil) + # Pass arguments to `delete_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intent(name: nil) + # Pass arguments to `delete_intent` via keyword arguments. Note that at + # least one keyword argument is required. To 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 intent to delete. If this intent has direct or + # indirect followup intents, we also delete them. + # Format: `projects//agent/intents/`. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new + # + # # Call the delete_intent method. + # result = client.delete_intent request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest + + # Converts hash and nil to 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_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_intent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.call_rpc :delete_intent, 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/Creates multiple intents in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsResponse BatchUpdateIntentsResponse} + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_update_intents(request, options = nil) + # Pass arguments to `batch_update_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intents(parent: nil, intent_batch_uri: nil, intent_batch_inline: nil, language_code: nil, update_mask: nil, intent_view: nil) + # Pass arguments to `batch_update_intents` via keyword arguments. Note that at + # least one keyword argument is 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 name of the agent to update or create intents in. + # Format: `projects//agent`. + # @param intent_batch_uri [::String] + # The URI to a Google Cloud Storage file containing intents to update or + # create. The file format can either be a serialized proto (of IntentBatch + # type) or JSON object. Note: The URI must start with "gs://". + # + # Note: The following parameters are mutually exclusive: `intent_batch_uri`, `intent_batch_inline`. 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 intent_batch_inline [::Google::Cloud::Dialogflow::V2::IntentBatch, ::Hash] + # The collection of intents to update or create. + # + # Note: The following parameters are mutually exclusive: `intent_batch_inline`, `intent_batch_uri`. 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 language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new + # + # # Call the batch_update_intents method. + # result = client.batch_update_intents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest + + # Converts hash and nil to 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_intents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_intents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_update_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.call_rpc :batch_update_intents, 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 intents in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_delete_intents(request, options = nil) + # Pass arguments to `batch_delete_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_delete_intents(parent: nil, intents: nil) + # Pass arguments to `batch_delete_intents` via keyword arguments. Note that at + # least one keyword argument is 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 name of the agent to delete all entities types for. Format: + # `projects//agent`. + # @param intents [::Array<::Google::Cloud::Dialogflow::V2::Intent, ::Hash>] + # Required. The collection of intents to delete. Only intent `name` must be + # filled in. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new + # + # # Call the batch_delete_intents method. + # result = client.batch_delete_intents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_delete_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest + + # Converts hash and nil to 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_delete_intents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_delete_intents.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_delete_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.call_rpc :batch_delete_intents, 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 Intents API. + # + # This class represents the configuration for Intents, + # 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::Dialogflow::V2::Intents::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_intents to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Intents::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_intents.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_intents.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::Dialogflow::V2::Intents::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Intents 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_intents + ## + # RPC-specific configuration for `get_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :get_intent + ## + # RPC-specific configuration for `create_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :create_intent + ## + # RPC-specific configuration for `update_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :update_intent + ## + # RPC-specific configuration for `delete_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_intent + ## + # RPC-specific configuration for `batch_update_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_intents + ## + # RPC-specific configuration for `batch_delete_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_intents + + # @private + def initialize parent_rpcs = nil + list_intents_config = parent_rpcs.list_intents if parent_rpcs.respond_to? :list_intents + @list_intents = ::Gapic::Config::Method.new list_intents_config + get_intent_config = parent_rpcs.get_intent if parent_rpcs.respond_to? :get_intent + @get_intent = ::Gapic::Config::Method.new get_intent_config + create_intent_config = parent_rpcs.create_intent if parent_rpcs.respond_to? :create_intent + @create_intent = ::Gapic::Config::Method.new create_intent_config + update_intent_config = parent_rpcs.update_intent if parent_rpcs.respond_to? :update_intent + @update_intent = ::Gapic::Config::Method.new update_intent_config + delete_intent_config = parent_rpcs.delete_intent if parent_rpcs.respond_to? :delete_intent + @delete_intent = ::Gapic::Config::Method.new delete_intent_config + batch_update_intents_config = parent_rpcs.batch_update_intents if parent_rpcs.respond_to? :batch_update_intents + @batch_update_intents = ::Gapic::Config::Method.new batch_update_intents_config + batch_delete_intents_config = parent_rpcs.batch_delete_intents if parent_rpcs.respond_to? :batch_delete_intents + @batch_delete_intents = ::Gapic::Config::Method.new batch_delete_intents_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/credentials.rb new file mode 100644 index 000000000000..a03b95f9dcb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Intents + # Credentials for the Intents API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb new file mode 100644 index 000000000000..47c984e3fb35 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module Intents + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Intents 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 Intents 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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::VERSION + metadata[:"x-goog-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::Dialogflow::V2::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/paths.rb new file mode 100644 index 000000000000..1ec1908f59fd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/paths.rb @@ -0,0 +1,195 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module Intents + # Path helper methods for the Intents API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # @overload agent_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/agent` + # + # @param project [String] + # + # @overload agent_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def agent_path **args + resources = { + "project" => (proc do |project:| + "projects/#{project}/agent" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent" + 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 Context resource string. + # + # @overload context_path(project:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @return [::String] + def context_path **args + resources = { + "context:project:session" => (proc do |project:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + end), + "context:location:project:session" => (proc do |project:, location:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + 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 Intent resource string. + # + # @overload intent_path(project:, intent:) + # The resource will be in the following format: + # + # `projects/{project}/agent/intents/{intent}` + # + # @param project [String] + # @param intent [String] + # + # @overload intent_path(project:, location:, intent:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/intents/{intent}` + # + # @param project [String] + # @param location [String] + # @param intent [String] + # + # @return [::String] + def intent_path **args + resources = { + "intent:project" => (proc do |project:, intent:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/agent/intents/#{intent}" + end), + "intent:location:project" => (proc do |project:, location:, intent:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/intents/#{intent}" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest.rb new file mode 100644 index 000000000000..5d0467a41f69 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/intents/credentials" +require "google/cloud/dialogflow/v2/intents/paths" +require "google/cloud/dialogflow/v2/intents/rest/operations" +require "google/cloud/dialogflow/v2/intents/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Intent Intents}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/intents/rest" + # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + module Intents + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/intents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb new file mode 100644 index 000000000000..2afea87d4eb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb @@ -0,0 +1,1120 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/intent_pb" +require "google/cloud/dialogflow/v2/intents/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Intents + module Rest + ## + # REST client for the Intents service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Intent Intents}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :intents_stub + + ## + # Configure the Intents Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Intents::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Intents clients + # ::Google::Cloud::Dialogflow::V2::Intents::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Intents 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::Dialogflow::V2::Intents::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 + @intents_stub.universe_domain + end + + ## + # Create a new Intents REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Intents 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::Dialogflow::V2::Intents::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 + + @intents_stub = ::Google::Cloud::Dialogflow::V2::Intents::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @intents_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 = @intents_stub.endpoint + config.universe_domain = @intents_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @intents_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Dialogflow::V2::Intents::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 + @intents_stub.logger + end + + # Service calls + + ## + # Returns the list of all intents in the specified agent. + # + # @overload list_intents(request, options = nil) + # Pass arguments to `list_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intents(parent: nil, language_code: nil, intent_view: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_intents` via keyword arguments. Note that at + # least one keyword argument is 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 agent to list all intents from. + # Format: `projects//agent` or `projects//locations//agent`. + # + # Alternatively, you can specify the environment to list intents for. + # Format: `projects//agent/environments/` + # or `projects//locations//agent/environments/`. + # Note: training phrases of the intents will not be returned for non-draft + # environment. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Intent>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Intent>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new + # + # # Call the list_intents method. + # result = client.list_intents 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::Dialogflow::V2::Intent. + # p item + # end + # + def list_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListIntentsRequest + + # Converts hash and nil to an 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_intents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_intents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.list_intents request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @intents_stub, :list_intents, "intents", 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 + + ## + # Retrieves the specified intent. + # + # @overload get_intent(request, options = nil) + # Pass arguments to `get_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intent(name: nil, language_code: nil, intent_view: nil) + # Pass arguments to `get_intent` via keyword arguments. Note that at + # least one keyword argument is required. To 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 intent. + # Format: `projects//agent/intents/`. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new + # + # # Call the get_intent method. + # result = client.get_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + # p result + # + def get_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetIntentRequest + + # Converts hash and nil to an 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_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_intent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.get_intent 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 an intent in the specified agent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload create_intent(request, options = nil) + # Pass arguments to `create_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intent(parent: nil, intent: nil, language_code: nil, intent_view: nil) + # Pass arguments to `create_intent` via keyword arguments. Note that at + # least one keyword argument is 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 agent to create a intent for. + # Format: `projects//agent`. + # @param intent [::Google::Cloud::Dialogflow::V2::Intent, ::Hash] + # Required. The intent to create. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new + # + # # Call the create_intent method. + # result = client.create_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + # p result + # + def create_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateIntentRequest + + # Converts hash and nil to an 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_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_intent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.create_intent 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 the specified intent. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload update_intent(request, options = nil) + # Pass arguments to `update_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intent(intent: nil, language_code: nil, update_mask: nil, intent_view: nil) + # Pass arguments to `update_intent` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param intent [::Google::Cloud::Dialogflow::V2::Intent, ::Hash] + # Required. The intent to update. + # @param language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new + # + # # Call the update_intent method. + # result = client.update_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + # p result + # + def update_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest + + # Converts hash and nil to an 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_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_intent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.update_intent 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 specified intent and its direct or indirect followup intents. + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload delete_intent(request, options = nil) + # Pass arguments to `delete_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intent(name: nil) + # Pass arguments to `delete_intent` via keyword arguments. Note that at + # least one keyword argument is required. To 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 intent to delete. If this intent has direct or + # indirect followup intents, we also delete them. + # Format: `projects//agent/intents/`. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new + # + # # Call the delete_intent method. + # result = client.delete_intent request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest + + # Converts hash and nil to an 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_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_intent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.delete_intent 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/Creates multiple intents in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: + # {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsResponse BatchUpdateIntentsResponse} + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_update_intents(request, options = nil) + # Pass arguments to `batch_update_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_intents(parent: nil, intent_batch_uri: nil, intent_batch_inline: nil, language_code: nil, update_mask: nil, intent_view: nil) + # Pass arguments to `batch_update_intents` via keyword arguments. Note that at + # least one keyword argument is 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 name of the agent to update or create intents in. + # Format: `projects//agent`. + # @param intent_batch_uri [::String] + # The URI to a Google Cloud Storage file containing intents to update or + # create. The file format can either be a serialized proto (of IntentBatch + # type) or JSON object. Note: The URI must start with "gs://". + # + # Note: The following parameters are mutually exclusive: `intent_batch_uri`, `intent_batch_inline`. 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 intent_batch_inline [::Google::Cloud::Dialogflow::V2::IntentBatch, ::Hash] + # The collection of intents to update or create. + # + # Note: The following parameters are mutually exclusive: `intent_batch_inline`, `intent_batch_uri`. 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 language_code [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new + # + # # Call the batch_update_intents method. + # result = client.batch_update_intents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest + + # Converts hash and nil to an 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_intents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_intents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_update_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.batch_update_intents 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 intents in the specified agent. + # + # This method is a [long-running + # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + # The returned `Operation` type has the following method-specific fields: + # + # - `metadata`: An empty [Struct + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + # - `response`: An [Empty + # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + # + # Note: You should always train an agent prior to sending it queries. See the + # [training + # documentation](https://cloud.google.com/dialogflow/es/docs/training). + # + # @overload batch_delete_intents(request, options = nil) + # Pass arguments to `batch_delete_intents` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_delete_intents(parent: nil, intents: nil) + # Pass arguments to `batch_delete_intents` via keyword arguments. Note that at + # least one keyword argument is 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 name of the agent to delete all entities types for. Format: + # `projects//agent`. + # @param intents [::Array<::Google::Cloud::Dialogflow::V2::Intent, ::Hash>] + # Required. The collection of intents to delete. Only intent `name` must be + # filled in. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new + # + # # Call the batch_delete_intents method. + # result = client.batch_delete_intents request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is 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_delete_intents request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest + + # Converts hash and nil to an 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_delete_intents.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_delete_intents.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_delete_intents.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @intents_stub.batch_delete_intents 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 Intents REST API. + # + # This class represents the configuration for Intents 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::Dialogflow::V2::Intents::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_intents to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_intents.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_intents.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Intents 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :list_intents + ## + # RPC-specific configuration for `get_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :get_intent + ## + # RPC-specific configuration for `create_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :create_intent + ## + # RPC-specific configuration for `update_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :update_intent + ## + # RPC-specific configuration for `delete_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_intent + ## + # RPC-specific configuration for `batch_update_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_update_intents + ## + # RPC-specific configuration for `batch_delete_intents` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_delete_intents + + # @private + def initialize parent_rpcs = nil + list_intents_config = parent_rpcs.list_intents if parent_rpcs.respond_to? :list_intents + @list_intents = ::Gapic::Config::Method.new list_intents_config + get_intent_config = parent_rpcs.get_intent if parent_rpcs.respond_to? :get_intent + @get_intent = ::Gapic::Config::Method.new get_intent_config + create_intent_config = parent_rpcs.create_intent if parent_rpcs.respond_to? :create_intent + @create_intent = ::Gapic::Config::Method.new create_intent_config + update_intent_config = parent_rpcs.update_intent if parent_rpcs.respond_to? :update_intent + @update_intent = ::Gapic::Config::Method.new update_intent_config + delete_intent_config = parent_rpcs.delete_intent if parent_rpcs.respond_to? :delete_intent + @delete_intent = ::Gapic::Config::Method.new delete_intent_config + batch_update_intents_config = parent_rpcs.batch_update_intents if parent_rpcs.respond_to? :batch_update_intents + @batch_update_intents = ::Gapic::Config::Method.new batch_update_intents_config + batch_delete_intents_config = parent_rpcs.batch_delete_intents if parent_rpcs.respond_to? :batch_delete_intents + @batch_delete_intents = ::Gapic::Config::Method.new batch_delete_intents_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb new file mode 100644 index 000000000000..c341fa77a9ec --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb @@ -0,0 +1,947 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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 Dialogflow + module V2 + module Intents + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Intents 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 Intents 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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{name}:cancel", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb new file mode 100644 index 000000000000..a7257b474942 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb @@ -0,0 +1,579 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/intent_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Intents + module Rest + ## + # REST service stub for the Intents 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_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListIntentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListIntentsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListIntentsResponse] + # A result object deserialized from the server's reply + def list_intents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_intents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_intents", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListIntentsResponse.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_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetIntentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # A result object deserialized from the server's reply + def get_intent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_intent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_intent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Intent.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_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateIntentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # A result object deserialized from the server's reply + def create_intent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_intent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_intent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Intent.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_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateIntentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Intent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # A result object deserialized from the server's reply + def update_intent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_intent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_intent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Intent.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_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteIntentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_intent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_intent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_intent", + 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 batch_update_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_intents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_intents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_intents", + 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_delete_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_delete_intents request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_intents_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_delete_intents", + 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_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListIntentsRequest] + # 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_intents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/intents", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/intents", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/intents", + matches: [ + ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/intents", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetIntentRequest] + # 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_intent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/intents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/intents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateIntentRequest] + # 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_intent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/intents", + body: "intent", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/intents", + body: "intent", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateIntentRequest] + # 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_intent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{intent.name}", + body: "intent", + matches: [ + ["intent.name", %r{^projects/[^/]+/agent/intents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{intent.name}", + body: "intent", + matches: [ + ["intent.name", %r{^projects/[^/]+/locations/[^/]+/agent/intents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteIntentRequest] + # 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_intent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/intents/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/intents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_update_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest] + # 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_intents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/intents:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/intents:batchUpdate", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_delete_intents REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest] + # 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_delete_intents_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/intents:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/intents:batchDelete", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb new file mode 100644 index 000000000000..1eda21b199e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/knowledge_base.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/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n/google/cloud/dialogflow/v2/knowledge_base.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xfc\x01\n\rKnowledgeBase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x04 \x01(\t:\xaa\x01\xea\x41\xa6\x01\n\'dialogflow.googleapis.com/KnowledgeBase\x12\x32projects/{project}/knowledgeBases/{knowledge_base}\x12Gprojects/{project}/locations/{location}/knowledgeBases/{knowledge_base}\"\x93\x01\n\x19ListKnowledgeBasesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'dialogflow.googleapis.com/KnowledgeBase\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\"y\n\x1aListKnowledgeBasesResponse\x12\x42\n\x0fknowledge_bases\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.v2.KnowledgeBase\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x17GetKnowledgeBaseRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'dialogflow.googleapis.com/KnowledgeBase\"\xa5\x01\n\x1a\x43reateKnowledgeBaseRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'dialogflow.googleapis.com/KnowledgeBase\x12\x46\n\x0eknowledge_base\x18\x02 \x01(\x0b\x32).google.cloud.dialogflow.v2.KnowledgeBaseB\x03\xe0\x41\x02\"o\n\x1a\x44\x65leteKnowledgeBaseRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'dialogflow.googleapis.com/KnowledgeBase\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x9a\x01\n\x1aUpdateKnowledgeBaseRequest\x12\x46\n\x0eknowledge_base\x18\x01 \x01(\x0b\x32).google.cloud.dialogflow.v2.KnowledgeBaseB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x32\xb4\r\n\x0eKnowledgeBases\x12\xa4\x02\n\x12ListKnowledgeBases\x12\x35.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest\x1a\x36.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse\"\x9e\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x8e\x01\x12&/v2/{parent=projects/*}/knowledgeBasesZ4\x12\x32/v2/{parent=projects/*/locations/*}/knowledgeBasesZ.\x12,/v2/{parent=projects/*/agent}/knowledgeBases\x12\x91\x02\n\x10GetKnowledgeBase\x12\x33.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest\x1a).google.cloud.dialogflow.v2.KnowledgeBase\"\x9c\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8e\x01\x12&/v2/{name=projects/*/knowledgeBases/*}Z4\x12\x32/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.\x12,/v2/{name=projects/*/agent/knowledgeBases/*}\x12\xd8\x02\n\x13\x43reateKnowledgeBase\x12\x36.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest\x1a).google.cloud.dialogflow.v2.KnowledgeBase\"\xdd\x01\xda\x41\x15parent,knowledge_base\x82\xd3\xe4\x93\x02\xbe\x01\"&/v2/{parent=projects/*}/knowledgeBases:\x0eknowledge_baseZD\"2/v2/{parent=projects/*/locations/*}/knowledgeBases:\x0eknowledge_baseZ>\",/v2/{parent=projects/*/agent}/knowledgeBases:\x0eknowledge_base\x12\x84\x02\n\x13\x44\x65leteKnowledgeBase\x12\x36.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest\x1a\x16.google.protobuf.Empty\"\x9c\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8e\x01*&/v2/{name=projects/*/knowledgeBases/*}Z4*2/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.*,/v2/{name=projects/*/agent/knowledgeBases/*}\x12\x8a\x03\n\x13UpdateKnowledgeBase\x12\x36.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest\x1a).google.cloud.dialogflow.v2.KnowledgeBase\"\x8f\x02\xda\x41\x1aknowledge_base,update_mask\x82\xd3\xe4\x93\x02\xeb\x01\x32\x35/v2/{knowledge_base.name=projects/*/knowledgeBases/*}:\x0eknowledge_baseZS2A/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}:\x0eknowledge_baseZM2;/v2/{knowledge_base.name=projects/*/agent/knowledgeBases/*}:\x0eknowledge_base\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x98\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x12KnowledgeBaseProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + KnowledgeBase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeBase").msgclass + ListKnowledgeBasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListKnowledgeBasesRequest").msgclass + ListKnowledgeBasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListKnowledgeBasesResponse").msgclass + GetKnowledgeBaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetKnowledgeBaseRequest").msgclass + CreateKnowledgeBaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest").msgclass + DeleteKnowledgeBaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest").msgclass + UpdateKnowledgeBaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb new file mode 100644 index 000000000000..8831f7a3fafa --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb @@ -0,0 +1,54 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/knowledge_base.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/knowledge_base_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module KnowledgeBases + # Service for managing + # [KnowledgeBases][google.cloud.dialogflow.v2.KnowledgeBase]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.KnowledgeBases' + + # Returns the list of all knowledge bases of the specified agent. + rpc :ListKnowledgeBases, ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest, ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse + # Retrieves the specified knowledge base. + rpc :GetKnowledgeBase, ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest, ::Google::Cloud::Dialogflow::V2::KnowledgeBase + # Creates a knowledge base. + rpc :CreateKnowledgeBase, ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest, ::Google::Cloud::Dialogflow::V2::KnowledgeBase + # Deletes the specified knowledge base. + rpc :DeleteKnowledgeBase, ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest, ::Google::Protobuf::Empty + # Updates the specified knowledge base. + rpc :UpdateKnowledgeBase, ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest, ::Google::Cloud::Dialogflow::V2::KnowledgeBase + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases.rb new file mode 100644 index 000000000000..71bbb77be3f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/knowledge_bases/credentials" +require "google/cloud/dialogflow/v2/knowledge_bases/paths" +require "google/cloud/dialogflow/v2/knowledge_bases/client" +require "google/cloud/dialogflow/v2/knowledge_bases/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBases}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/knowledge_bases" + # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/knowledge_bases/rest" + # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + module KnowledgeBases + end + end + end + end +end + +helper_path = ::File.join __dir__, "knowledge_bases", "helpers.rb" +require "google/cloud/dialogflow/v2/knowledge_bases/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb new file mode 100644 index 000000000000..6c17f1be5967 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.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 "google/cloud/errors" +require "google/cloud/dialogflow/v2/knowledge_base_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module KnowledgeBases + ## + # Client for the KnowledgeBases service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBases}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :knowledge_bases_stub + + ## + # Configure the KnowledgeBases Client class. + # + # See {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KnowledgeBases clients + # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::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 + @knowledge_bases_stub.universe_domain + end + + ## + # Create a new KnowledgeBases client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KnowledgeBases 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/dialogflow/v2/knowledge_base_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 + + @knowledge_bases_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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 + ) + + @knowledge_bases_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 = @knowledge_bases_stub.endpoint + config.universe_domain = @knowledge_bases_stub.universe_domain + config.logger = @knowledge_bases_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 + @knowledge_bases_stub.logger + end + + # Service calls + + ## + # Returns the list of all knowledge bases of the specified agent. + # + # @overload list_knowledge_bases(request, options = nil) + # Pass arguments to `list_knowledge_bases` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_bases(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_knowledge_bases` via keyword arguments. Note that at + # least one keyword argument is 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 project to list of knowledge bases for. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By + # default 10 and at most 100. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # @param filter [::String] + # The filter expression used to filter knowledge bases returned by the list + # method. The expression has the following syntax: + # + # [AND ] ... + # + # The following fields and operators are supported: + # + # * display_name with has(:) operator + # * language_code with equals(=) operator + # + # Examples: + # + # * 'language_code=en-us' matches knowledge bases with en-us language code. + # * 'display_name:articles' matches knowledge bases whose display name + # contains "articles". + # * 'display_name:"Best Articles"' matches knowledge bases whose display + # name contains "Best Articles". + # * 'language_code=en-gb AND display_name=articles' matches all knowledge + # bases whose display name contains "articles" and whose language code is + # "en-gb". + # + # Note: An empty filter string (i.e. "") is a no-op and will result in no + # filtering. + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.new + # + # # Call the list_knowledge_bases method. + # result = client.list_knowledge_bases 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::Dialogflow::V2::KnowledgeBase. + # p item + # end + # + def list_knowledge_bases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest + + # Converts hash and nil to 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_knowledge_bases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_knowledge_bases.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_knowledge_bases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.call_rpc :list_knowledge_bases, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @knowledge_bases_stub, :list_knowledge_bases, 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 + + ## + # Retrieves the specified knowledge base. + # + # @overload get_knowledge_base(request, options = nil) + # Pass arguments to `get_knowledge_base` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_base(name: nil) + # Pass arguments to `get_knowledge_base` via keyword arguments. Note that at + # least one keyword argument is required. To 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 knowledge base to retrieve. + # Format `projects//locations//knowledgeBases/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new + # + # # Call the get_knowledge_base method. + # result = client.get_knowledge_base request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p result + # + def get_knowledge_base request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest + + # Converts hash and nil to 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_knowledge_base.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_knowledge_base.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_knowledge_base.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.call_rpc :get_knowledge_base, 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 knowledge base. + # + # @overload create_knowledge_base(request, options = nil) + # Pass arguments to `create_knowledge_base` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_base(parent: nil, knowledge_base: nil) + # Pass arguments to `create_knowledge_base` via keyword arguments. Note that at + # least one keyword argument is 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 project to create a knowledge base for. + # Format: `projects//locations/`. + # @param knowledge_base [::Google::Cloud::Dialogflow::V2::KnowledgeBase, ::Hash] + # Required. The knowledge base to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new + # + # # Call the create_knowledge_base method. + # result = client.create_knowledge_base request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p result + # + def create_knowledge_base request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest + + # Converts hash and nil to 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_knowledge_base.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_knowledge_base.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_knowledge_base.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.call_rpc :create_knowledge_base, 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 specified knowledge base. + # + # @overload delete_knowledge_base(request, options = nil) + # Pass arguments to `delete_knowledge_base` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_base(name: nil, force: nil) + # Pass arguments to `delete_knowledge_base` via keyword arguments. Note that at + # least one keyword argument is required. To 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 knowledge base to delete. + # Format: `projects//locations//knowledgeBases/`. + # @param force [::Boolean] + # Optional. Force deletes the knowledge base. When set to true, any documents + # in the knowledge base are also 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/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new + # + # # Call the delete_knowledge_base method. + # result = client.delete_knowledge_base request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_knowledge_base request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest + + # Converts hash and nil to 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_knowledge_base.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_knowledge_base.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_knowledge_base.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.call_rpc :delete_knowledge_base, 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 the specified knowledge base. + # + # @overload update_knowledge_base(request, options = nil) + # Pass arguments to `update_knowledge_base` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_base(knowledge_base: nil, update_mask: nil) + # Pass arguments to `update_knowledge_base` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param knowledge_base [::Google::Cloud::Dialogflow::V2::KnowledgeBase, ::Hash] + # Required. The knowledge base to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Not specified means `update all`. + # Currently, only `display_name` can be updated, an InvalidArgument will be + # returned for attempting to update other fields. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new + # + # # Call the update_knowledge_base method. + # result = client.update_knowledge_base request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p result + # + def update_knowledge_base request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest + + # Converts hash and nil to 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_knowledge_base.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.knowledge_base&.name + header_params["knowledge_base.name"] = request.knowledge_base.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_knowledge_base.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_knowledge_base.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.call_rpc :update_knowledge_base, 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 KnowledgeBases API. + # + # This class represents the configuration for KnowledgeBases, + # 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::Dialogflow::V2::KnowledgeBases::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_knowledge_bases to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_knowledge_bases.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_knowledge_bases.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::Dialogflow::V2::KnowledgeBases::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 KnowledgeBases 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_knowledge_bases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_knowledge_bases + ## + # RPC-specific configuration for `get_knowledge_base` + # @return [::Gapic::Config::Method] + # + attr_reader :get_knowledge_base + ## + # RPC-specific configuration for `create_knowledge_base` + # @return [::Gapic::Config::Method] + # + attr_reader :create_knowledge_base + ## + # RPC-specific configuration for `delete_knowledge_base` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_knowledge_base + ## + # RPC-specific configuration for `update_knowledge_base` + # @return [::Gapic::Config::Method] + # + attr_reader :update_knowledge_base + + # @private + def initialize parent_rpcs = nil + list_knowledge_bases_config = parent_rpcs.list_knowledge_bases if parent_rpcs.respond_to? :list_knowledge_bases + @list_knowledge_bases = ::Gapic::Config::Method.new list_knowledge_bases_config + get_knowledge_base_config = parent_rpcs.get_knowledge_base if parent_rpcs.respond_to? :get_knowledge_base + @get_knowledge_base = ::Gapic::Config::Method.new get_knowledge_base_config + create_knowledge_base_config = parent_rpcs.create_knowledge_base if parent_rpcs.respond_to? :create_knowledge_base + @create_knowledge_base = ::Gapic::Config::Method.new create_knowledge_base_config + delete_knowledge_base_config = parent_rpcs.delete_knowledge_base if parent_rpcs.respond_to? :delete_knowledge_base + @delete_knowledge_base = ::Gapic::Config::Method.new delete_knowledge_base_config + update_knowledge_base_config = parent_rpcs.update_knowledge_base if parent_rpcs.respond_to? :update_knowledge_base + @update_knowledge_base = ::Gapic::Config::Method.new update_knowledge_base_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb new file mode 100644 index 000000000000..7ec230c98448 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module KnowledgeBases + # Credentials for the KnowledgeBases API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb new file mode 100644 index 000000000000..eb8e676df920 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module KnowledgeBases + # Path helper methods for the KnowledgeBases API. + module Paths + ## + # Create a fully-qualified KnowledgeBase resource string. + # + # @overload knowledge_base_path(project:, knowledge_base:) + # The resource will be in the following format: + # + # `projects/{project}/knowledgeBases/{knowledge_base}` + # + # @param project [String] + # @param knowledge_base [String] + # + # @overload knowledge_base_path(project:, location:, knowledge_base:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}` + # + # @param project [String] + # @param location [String] + # @param knowledge_base [String] + # + # @return [::String] + def knowledge_base_path **args + resources = { + "knowledge_base:project" => (proc do |project:, knowledge_base:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/knowledgeBases/#{knowledge_base}" + end), + "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}" + 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 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 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest.rb new file mode 100644 index 000000000000..437182b882a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/knowledge_bases/credentials" +require "google/cloud/dialogflow/v2/knowledge_bases/paths" +require "google/cloud/dialogflow/v2/knowledge_bases/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBases}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/knowledge_bases/rest" + # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + module KnowledgeBases + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/knowledge_bases/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb new file mode 100644 index 000000000000..0f32fd6319f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb @@ -0,0 +1,849 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/knowledge_base_pb" +require "google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module KnowledgeBases + module Rest + ## + # REST client for the KnowledgeBases service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBases}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :knowledge_bases_stub + + ## + # Configure the KnowledgeBases Client class. + # + # See {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all KnowledgeBases clients + # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::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 + @knowledge_bases_stub.universe_domain + end + + ## + # Create a new KnowledgeBases REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the KnowledgeBases 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 + + @knowledge_bases_stub = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @knowledge_bases_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 = @knowledge_bases_stub.endpoint + config.universe_domain = @knowledge_bases_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @knowledge_bases_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 + @knowledge_bases_stub.logger + end + + # Service calls + + ## + # Returns the list of all knowledge bases of the specified agent. + # + # @overload list_knowledge_bases(request, options = nil) + # Pass arguments to `list_knowledge_bases` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_bases(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_knowledge_bases` via keyword arguments. Note that at + # least one keyword argument is 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 project to list of knowledge bases for. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # The maximum number of items to return in a single page. By + # default 10 and at most 100. + # @param page_token [::String] + # The next_page_token value returned from a previous list request. + # @param filter [::String] + # The filter expression used to filter knowledge bases returned by the list + # method. The expression has the following syntax: + # + # [AND ] ... + # + # The following fields and operators are supported: + # + # * display_name with has(:) operator + # * language_code with equals(=) operator + # + # Examples: + # + # * 'language_code=en-us' matches knowledge bases with en-us language code. + # * 'display_name:articles' matches knowledge bases whose display name + # contains "articles". + # * 'display_name:"Best Articles"' matches knowledge bases whose display + # name contains "Best Articles". + # * 'language_code=en-gb AND display_name=articles' matches all knowledge + # bases whose display name contains "articles" and whose language code is + # "en-gb". + # + # Note: An empty filter string (i.e. "") is a no-op and will result in no + # filtering. + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.new + # + # # Call the list_knowledge_bases method. + # result = client.list_knowledge_bases 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::Dialogflow::V2::KnowledgeBase. + # p item + # end + # + def list_knowledge_bases request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest + + # Converts hash and nil to an 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_knowledge_bases.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_knowledge_bases.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_knowledge_bases.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.list_knowledge_bases request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @knowledge_bases_stub, :list_knowledge_bases, "knowledge_bases", 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 + + ## + # Retrieves the specified knowledge base. + # + # @overload get_knowledge_base(request, options = nil) + # Pass arguments to `get_knowledge_base` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_base(name: nil) + # Pass arguments to `get_knowledge_base` via keyword arguments. Note that at + # least one keyword argument is required. To 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 knowledge base to retrieve. + # Format `projects//locations//knowledgeBases/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new + # + # # Call the get_knowledge_base method. + # result = client.get_knowledge_base request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p result + # + def get_knowledge_base request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest + + # Converts hash and nil to an 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_knowledge_base.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_knowledge_base.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_knowledge_base.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.get_knowledge_base 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 knowledge base. + # + # @overload create_knowledge_base(request, options = nil) + # Pass arguments to `create_knowledge_base` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_base(parent: nil, knowledge_base: nil) + # Pass arguments to `create_knowledge_base` via keyword arguments. Note that at + # least one keyword argument is 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 project to create a knowledge base for. + # Format: `projects//locations/`. + # @param knowledge_base [::Google::Cloud::Dialogflow::V2::KnowledgeBase, ::Hash] + # Required. The knowledge base to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new + # + # # Call the create_knowledge_base method. + # result = client.create_knowledge_base request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p result + # + def create_knowledge_base request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest + + # Converts hash and nil to an 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_knowledge_base.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_knowledge_base.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_knowledge_base.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.create_knowledge_base 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 specified knowledge base. + # + # @overload delete_knowledge_base(request, options = nil) + # Pass arguments to `delete_knowledge_base` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_base(name: nil, force: nil) + # Pass arguments to `delete_knowledge_base` via keyword arguments. Note that at + # least one keyword argument is required. To 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 knowledge base to delete. + # Format: `projects//locations//knowledgeBases/`. + # @param force [::Boolean] + # Optional. Force deletes the knowledge base. When set to true, any documents + # in the knowledge base are also 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/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new + # + # # Call the delete_knowledge_base method. + # result = client.delete_knowledge_base request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_knowledge_base request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest + + # Converts hash and nil to an 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_knowledge_base.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_knowledge_base.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_knowledge_base.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.delete_knowledge_base 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 the specified knowledge base. + # + # @overload update_knowledge_base(request, options = nil) + # Pass arguments to `update_knowledge_base` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_knowledge_base(knowledge_base: nil, update_mask: nil) + # Pass arguments to `update_knowledge_base` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param knowledge_base [::Google::Cloud::Dialogflow::V2::KnowledgeBase, ::Hash] + # Required. The knowledge base to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Not specified means `update all`. + # Currently, only `display_name` can be updated, an InvalidArgument will be + # returned for attempting to update other fields. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new + # + # # Call the update_knowledge_base method. + # result = client.update_knowledge_base request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + # p result + # + def update_knowledge_base request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest + + # Converts hash and nil to an 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_knowledge_base.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_knowledge_base.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_knowledge_base.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @knowledge_bases_stub.update_knowledge_base 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 KnowledgeBases REST API. + # + # This class represents the configuration for KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::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_knowledge_bases to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_knowledge_bases.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_knowledge_bases.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 KnowledgeBases 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_knowledge_bases` + # @return [::Gapic::Config::Method] + # + attr_reader :list_knowledge_bases + ## + # RPC-specific configuration for `get_knowledge_base` + # @return [::Gapic::Config::Method] + # + attr_reader :get_knowledge_base + ## + # RPC-specific configuration for `create_knowledge_base` + # @return [::Gapic::Config::Method] + # + attr_reader :create_knowledge_base + ## + # RPC-specific configuration for `delete_knowledge_base` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_knowledge_base + ## + # RPC-specific configuration for `update_knowledge_base` + # @return [::Gapic::Config::Method] + # + attr_reader :update_knowledge_base + + # @private + def initialize parent_rpcs = nil + list_knowledge_bases_config = parent_rpcs.list_knowledge_bases if parent_rpcs.respond_to? :list_knowledge_bases + @list_knowledge_bases = ::Gapic::Config::Method.new list_knowledge_bases_config + get_knowledge_base_config = parent_rpcs.get_knowledge_base if parent_rpcs.respond_to? :get_knowledge_base + @get_knowledge_base = ::Gapic::Config::Method.new get_knowledge_base_config + create_knowledge_base_config = parent_rpcs.create_knowledge_base if parent_rpcs.respond_to? :create_knowledge_base + @create_knowledge_base = ::Gapic::Config::Method.new create_knowledge_base_config + delete_knowledge_base_config = parent_rpcs.delete_knowledge_base if parent_rpcs.respond_to? :delete_knowledge_base + @delete_knowledge_base = ::Gapic::Config::Method.new delete_knowledge_base_config + update_knowledge_base_config = parent_rpcs.update_knowledge_base if parent_rpcs.respond_to? :update_knowledge_base + @update_knowledge_base = ::Gapic::Config::Method.new update_knowledge_base_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb new file mode 100644 index 000000000000..7b40468fbfd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/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/dialogflow/v2/knowledge_base_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module KnowledgeBases + module Rest + ## + # REST service stub for the KnowledgeBases 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_knowledge_bases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListKnowledgeBasesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse] + # A result object deserialized from the server's reply + def list_knowledge_bases request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_knowledge_bases_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_knowledge_bases", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse.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_knowledge_base REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::KnowledgeBase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # A result object deserialized from the server's reply + def get_knowledge_base request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_knowledge_base_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_knowledge_base", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.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_knowledge_base REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::KnowledgeBase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # A result object deserialized from the server's reply + def create_knowledge_base request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_knowledge_base_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_knowledge_base", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.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_knowledge_base REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_knowledge_base request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_knowledge_base_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_knowledge_base", + 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_knowledge_base REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::KnowledgeBase] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # A result object deserialized from the server's reply + def update_knowledge_base request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_knowledge_base_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_knowledge_base", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.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_knowledge_bases REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest] + # 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_knowledge_bases_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/knowledgeBases", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/knowledgeBases", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/knowledgeBases", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_knowledge_base REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest] + # 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_knowledge_base_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_knowledge_base REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest] + # 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_knowledge_base_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/knowledgeBases", + body: "knowledge_base", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/knowledgeBases", + body: "knowledge_base", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/knowledgeBases", + body: "knowledge_base", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_knowledge_base REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest] + # 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_knowledge_base_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_knowledge_base REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest] + # 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_knowledge_base_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{knowledge_base.name}", + body: "knowledge_base", + matches: [ + ["knowledge_base.name", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{knowledge_base.name}", + body: "knowledge_base", + matches: [ + ["knowledge_base.name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{knowledge_base.name}", + body: "knowledge_base", + matches: [ + ["knowledge_base.name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/operations_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/operations_pb.rb new file mode 100644 index 000000000000..79b84f1e19ab --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/operations_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/operations.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n+google/cloud/dialogflow/v2/operations.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"I\n$GeneratorEvaluationOperationMetadata\x12!\n\x14generator_evaluation\x18\x01 \x01(\tB\x03\xe0\x41\x03\x42\x95\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0fOperationsProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + GeneratorEvaluationOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationOperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb new file mode 100644 index 000000000000..87b3df01c38b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/participant.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/dialogflow/v2/audio_config_pb' +require 'google/cloud/dialogflow/v2/generator_pb' +require 'google/cloud/dialogflow/v2/session_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n,google/cloud/dialogflow/v2/participant.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf8\x06\n\x0bParticipant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12?\n\x04role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x05\x12&\n\x19sip_recording_media_label\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12(\n\x1bobfuscated_external_user_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12n\n\x1a\x64ocuments_metadata_filters\x18\x08 \x03(\x0b\x32\x45.google.cloud.dialogflow.v2.Participant.DocumentsMetadataFiltersEntryB\x03\xe0\x41\x01\x12]\n\x14\x61gent_desktop_source\x18\n \x01(\x0e\x32:.google.cloud.dialogflow.v2.Participant.AgentDesktopSourceB\x03\xe0\x41\x01\x1a?\n\x1d\x44ocumentsMetadataFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"P\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHUMAN_AGENT\x10\x01\x12\x13\n\x0f\x41UTOMATED_AGENT\x10\x02\x12\x0c\n\x08\x45ND_USER\x10\x03\"\x85\x01\n\x12\x41gentDesktopSource\x12$\n AGENT_DESKTOP_SOURCE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bLIVE_PERSON\x10\x01\x12\x11\n\rGENESYS_CLOUD\x10\x02\x12\n\n\x06TWILIO\x10\x03\x12\x0e\n\nSALESFORCE\x10\x04\x12\t\n\x05OTHER\x10\x08:\xd8\x01\xea\x41\xd4\x01\n%dialogflow.googleapis.com/Participant\x12Jprojects/{project}/conversations/{conversation}/participants/{participant}\x12_projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}\"\x8c\x05\n\x07Message\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bparticipant\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12K\n\x10participant_role\x18\x05 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x32\n\tsend_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12N\n\x12message_annotation\x18\x07 \x01(\x0b\x32-.google.cloud.dialogflow.v2.MessageAnnotationB\x03\xe0\x41\x03\x12T\n\x12sentiment_analysis\x18\x08 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SentimentAnalysisResultB\x03\xe0\x41\x03:\xc4\x01\xea\x41\xc0\x01\n!dialogflow.googleapis.com/Message\x12\x42projects/{project}/conversations/{conversation}/messages/{message}\x12Wprojects/{project}/locations/{location}/conversations/{conversation}/messages/{message}\"\x9c\x01\n\x18\x43reateParticipantRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Participant\x12\x41\n\x0bparticipant\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.ParticipantB\x03\xe0\x41\x02\"T\n\x15GetParticipantRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\"\x89\x01\n\x17ListParticipantsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Participant\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\"r\n\x18ListParticipantsResponse\x12=\n\x0cparticipants\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.v2.Participant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x93\x01\n\x18UpdateParticipantRequest\x12\x41\n\x0bparticipant\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.ParticipantB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x8a\x05\n\x15\x41nalyzeContentRequest\x12\x42\n\x0bparticipant\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12;\n\ntext_input\x18\x06 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputH\x00\x12=\n\x0b\x61udio_input\x18\x07 \x01(\x0b\x32&.google.cloud.dialogflow.v2.AudioInputH\x00\x12=\n\x0b\x65vent_input\x18\x08 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInputH\x00\x12G\n\x10suggestion_input\x18\x0c \x01(\x0b\x32+.google.cloud.dialogflow.v2.SuggestionInputH\x00\x12I\n\x12reply_audio_config\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x41\n\x0cquery_params\x18\t \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12N\n\x13\x61ssist_query_params\x18\x0e \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\n\rcx_parameters\x18\x12 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\nrequest_id\x18\x0b \x01(\tB\x07\n\x05input\",\n\x0e\x44tmfParameters\x12\x1a\n\x12\x61\x63\x63\x65pts_dtmf_input\x18\x01 \x01(\x08\"\xde\x03\n\x16\x41nalyzeContentResponse\x12\x12\n\nreply_text\x18\x01 \x01(\t\x12<\n\x0breply_audio\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.OutputAudio\x12N\n\x15\x61utomated_agent_reply\x18\x03 \x01(\x0b\x32/.google.cloud.dialogflow.v2.AutomatedAgentReply\x12\x34\n\x07message\x18\x05 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12T\n\x1ehuman_agent_suggestion_results\x18\x06 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\n\x1b\x65nd_user_suggestion_results\x18\x07 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12\x43\n\x0f\x64tmf_parameters\x18\t \x01(\x0b\x32*.google.cloud.dialogflow.v2.DtmfParameters\"\xa6\x06\n\x1eStreamingAnalyzeContentRequest\x12\x42\n\x0bparticipant\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x44\n\x0c\x61udio_config\x18\x02 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigH\x00\x12\x42\n\x0btext_config\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.v2.InputTextConfigH\x00\x12I\n\x12reply_audio_config\x18\x04 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x15\n\x0binput_audio\x18\x05 \x01(\x0cH\x01\x12\x14\n\ninput_text\x18\x06 \x01(\tH\x01\x12\x45\n\ninput_dtmf\x18\t \x01(\x0b\x32/.google.cloud.dialogflow.v2.TelephonyDtmfEventsH\x01\x12\x41\n\x0cquery_params\x18\x07 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12N\n\x13\x61ssist_query_params\x18\x08 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\n\rcx_parameters\x18\r \x01(\x0b\x32\x17.google.protobuf.Struct\x12&\n\x19\x65nable_extended_streaming\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12\x31\n$enable_partial_automated_agent_reply\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1aoutput_multiple_utterances\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x15\x65nable_debugging_info\x18\x13 \x01(\x08\x42\x08\n\x06\x63onfigB\x07\n\x05input\"\xa5\x05\n\x1fStreamingAnalyzeContentResponse\x12R\n\x12recognition_result\x18\x01 \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.StreamingRecognitionResult\x12\x12\n\nreply_text\x18\x02 \x01(\t\x12<\n\x0breply_audio\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.OutputAudio\x12N\n\x15\x61utomated_agent_reply\x18\x04 \x01(\x0b\x32/.google.cloud.dialogflow.v2.AutomatedAgentReply\x12\x34\n\x07message\x18\x06 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12T\n\x1ehuman_agent_suggestion_results\x18\x07 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\n\x1b\x65nd_user_suggestion_results\x18\x08 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12\x43\n\x0f\x64tmf_parameters\x18\n \x01(\x0b\x32*.google.cloud.dialogflow.v2.DtmfParameters\x12R\n\x0e\x64\x65\x62ugging_info\x18\x0b \x01(\x0b\x32:.google.cloud.dialogflow.v2.CloudConversationDebuggingInfo\x12\x14\n\x0cspeech_model\x18\r \x01(\t\"\x85\x02\n\x16SuggestArticlesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12N\n\x13\x61ssist_query_params\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\"\x8b\x01\n\x17SuggestArticlesResponse\x12\x42\n\x0f\x61rticle_answers\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.v2.ArticleAnswer\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\x87\x02\n\x18SuggestFaqAnswersRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12N\n\x13\x61ssist_query_params\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\"\x85\x01\n\x19SuggestFaqAnswersResponse\x12:\n\x0b\x66\x61q_answers\x18\x01 \x03(\x0b\x32%.google.cloud.dialogflow.v2.FaqAnswer\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\xa1\x03\n\x1bGenerateSuggestionsResponse\x12w\n\x1cgenerator_suggestion_answers\x18\x01 \x03(\x0b\x32Q.google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x1a\xc8\x01\n\x19GeneratorSuggestionAnswer\x12M\n\x14generator_suggestion\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestion\x12\x18\n\x10source_generator\x18\x02 \x01(\t\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\"\xf4\x01\n\x1aSuggestSmartRepliesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x12\x63urrent_text_input\x18\x04 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInput\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\xc3\x01\n\x1bSuggestSmartRepliesResponse\x12N\n\x13smart_reply_answers\x18\x01 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SmartReplyAnswerB\x03\xe0\x41\x03\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"c\n\nAudioInput\x12\x41\n\x06\x63onfig\x18\x01 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigB\x03\xe0\x41\x02\x12\x12\n\x05\x61udio\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"[\n\x0bOutputAudio\x12=\n\x06\x63onfig\x18\x01 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\r\n\x05\x61udio\x18\x02 \x01(\x0c\"\xe8\x02\n\x13\x41utomatedAgentReply\x12P\n\x16\x64\x65tect_intent_response\x18\x01 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.DetectIntentResponse\x12k\n\x1a\x61utomated_agent_reply_type\x18\x07 \x01(\x0e\x32G.google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType\x12\x1a\n\x12\x61llow_cancellation\x18\x08 \x01(\x08\x12\x17\n\x0f\x63x_current_page\x18\x0b \x01(\t\"]\n\x17\x41utomatedAgentReplyType\x12*\n&AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PARTIAL\x10\x01\x12\t\n\x05\x46INAL\x10\x02\"\xe4\x01\n\rArticleAnswer\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08snippets\x18\x03 \x03(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12I\n\x08metadata\x18\x05 \x03(\x0b\x32\x37.google.cloud.dialogflow.v2.ArticleAnswer.MetadataEntry\x12\x15\n\ranswer_record\x18\x06 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe0\x01\n\tFaqAnswer\x12\x0e\n\x06\x61nswer\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x10\n\x08question\x18\x03 \x01(\t\x12\x0e\n\x06source\x18\x04 \x01(\t\x12\x45\n\x08metadata\x18\x05 \x03(\x0b\x32\x33.google.cloud.dialogflow.v2.FaqAnswer.MetadataEntry\x12\x15\n\ranswer_record\x18\x06 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x10SmartReplyAnswer\x12\r\n\x05reply\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\"\\\n\x10IntentSuggestion\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\tintent_v2\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x08\n\x06intent\"\xc5\x01\n\x16\x44ialogflowAssistAnswer\x12?\n\x0cquery_result\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResultH\x00\x12I\n\x11intent_suggestion\x18\x05 \x01(\x0b\x32,.google.cloud.dialogflow.v2.IntentSuggestionH\x00\x12\x15\n\ranswer_record\x18\x02 \x01(\tB\x08\n\x06result\"\xb5\x04\n\x10SuggestionResult\x12#\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x12X\n\x19suggest_articles_response\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SuggestArticlesResponseH\x00\x12g\n!suggest_knowledge_assist_response\x18\x08 \x01(\x0b\x32:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponseH\x00\x12]\n\x1csuggest_faq_answers_response\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.SuggestFaqAnswersResponseH\x00\x12\x61\n\x1esuggest_smart_replies_response\x18\x04 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.SuggestSmartRepliesResponseH\x00\x12`\n\x1dgenerate_suggestions_response\x18\t \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.GenerateSuggestionsResponseH\x00\x42\x15\n\x13suggestion_response\"-\n\x0fInputTextConfig\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\"j\n\x14\x41nnotatedMessagePart\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x13\n\x0b\x65ntity_type\x18\x02 \x01(\t\x12/\n\x0f\x66ormatted_value\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\"n\n\x11MessageAnnotation\x12?\n\x05parts\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.v2.AnnotatedMessagePart\x12\x18\n\x10\x63ontain_entities\x18\x02 \x01(\x08\"\xa3\x02\n\x0fSuggestionInput\x12\x1a\n\ranswer_record\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x30\n\nparameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12G\n\x06\x61\x63tion\x18\x05 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionInput.ActionB\x03\xe0\x41\x01\x12\x32\n\tsend_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"E\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\n\n\x06\x43\x41NCEL\x10\x01\x12\n\n\x06REVISE\x10\x02\x12\x0b\n\x07\x43ONFIRM\x10\x03\"\xcd\x01\n\x15\x41ssistQueryParameters\x12s\n\x1a\x64ocuments_metadata_filters\x18\x01 \x03(\x0b\x32O.google.cloud.dialogflow.v2.AssistQueryParameters.DocumentsMetadataFiltersEntry\x1a?\n\x1d\x44ocumentsMetadataFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe3\x01\n\x1dSuggestKnowledgeAssistRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12%\n\x18previous_suggested_query\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xab\x02\n\x1eSuggestKnowledgeAssistResponse\x12W\n\x17knowledge_assist_answer\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.KnowledgeAssistAnswerB\x03\xe0\x41\x03\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x12\x81\x01\n\"additional_suggested_query_results\x18\x04 \x03(\x0b\x32P.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResultB\x03\xe0\x41\x01\"\xb9\x05\n!IngestedContextReferenceDebugInfo\x12\x1f\n\x17project_not_allowlisted\x18\x01 \x01(\x08\x12#\n\x1b\x63ontext_reference_retrieved\x18\x02 \x01(\x08\x12\x80\x01\n\x1eingested_parameters_debug_info\x18\x03 \x03(\x0b\x32X.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo\x1a\xca\x03\n\x1aIngestedParameterDebugInfo\x12\x11\n\tparameter\x18\x01 \x01(\t\x12\x82\x01\n\x10ingestion_status\x18\x02 \x01(\x0e\x32h.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus\"\x93\x02\n\x0fIngestionStatus\x12 \n\x1cINGESTION_STATUS_UNSPECIFIED\x10\x00\x12\x1e\n\x1aINGESTION_STATUS_SUCCEEDED\x10\x01\x12*\n&INGESTION_STATUS_CONTEXT_NOT_AVAILABLE\x10\x02\x12!\n\x1dINGESTION_STATUS_PARSE_FAILED\x10\x03\x12\"\n\x1eINGESTION_STATUS_INVALID_ENTRY\x10\x04\x12#\n\x1fINGESTION_STATUS_INVALID_FORMAT\x10\x05\x12&\n\"INGESTION_STATUS_LANGUAGE_MISMATCH\x10\x06\"\x97\x02\n\x0eServiceLatency\x12\x65\n\x1ainternal_service_latencies\x18\x01 \x03(\x0b\x32\x41.google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency\x1a\x9d\x01\n\x16InternalServiceLatency\x12\x0c\n\x04step\x18\x01 \x01(\t\x12\x12\n\nlatency_ms\x18\x02 \x01(\x02\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rcomplete_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8c\x12\n\x18KnowledgeAssistDebugInfo\x12z\n\x1fquery_generation_failure_reason\x18\x01 \x01(\x0e\x32Q.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason\x12\x82\x01\n#query_categorization_failure_reason\x18\x02 \x01(\x0e\x32U.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason\x12V\n\x19\x64\x61tastore_response_reason\x18\x03 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\n\x19knowledge_assist_behavior\x18\x04 \x01(\x0b\x32L.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior\x12l\n%ingested_context_reference_debug_info\x18\x05 \x01(\x0b\x32=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12\x43\n\x0fservice_latency\x18\x06 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ServiceLatency\x12r\n\x1bquery_generation_debug_info\x18\x07 \x01(\x0b\x32M.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo\x12/\n\x0e\x63\x65s_debug_info\x18\x08 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\xb9\x05\n\x17KnowledgeAssistBehavior\x12%\n\x1d\x61nswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\n\x1a\x65nd_user_metadata_included\x18\x02 \x01(\x08\x12\x19\n\x11return_query_only\x18\x04 \x01(\x08\x12\x1b\n\x13use_pubsub_delivery\x18\x05 \x01(\x08\x12\x1d\n\x15\x64isable_sync_delivery\x18\x06 \x01(\x08\x12!\n\x19previous_queries_included\x18\x07 \x01(\x08\x12\x1e\n\x16use_translated_message\x18\x08 \x01(\x08\x12&\n\x1euse_custom_safety_filter_level\x18\t \x01(\x08\x12\x33\n+conversation_transcript_has_mixed_languages\x18\n \x01(\x08\x12\x30\n(query_generation_agent_language_mismatch\x18\x0b \x01(\x08\x12\x33\n+query_generation_end_user_language_mismatch\x18\x0c \x01(\x08\x12%\n\x1dthird_party_connector_allowed\x18\r \x01(\x08\x12\"\n\x1amultiple_queries_generated\x18\x0e \x01(\x08\x12&\n\x1equery_contained_search_context\x18\x0f \x01(\x08\x12.\n&invalid_items_query_suggestion_skipped\x18\x10 \x01(\x08\x12+\n#primary_query_redacted_and_replaced\x18\x11 \x01(\x08\x12%\n\x1d\x61ppended_search_context_count\x18\x12 \x01(\x05\x1aq\n\x18QueryGenerationDebugInfo\x12\x1a\n\x12prompt_token_count\x18\x01 \x01(\x05\x12\x1e\n\x16\x63\x61ndidates_token_count\x18\x02 \x01(\x05\x12\x19\n\x11total_token_count\x18\x03 \x01(\x05\"\xcf\x03\n\x1cQueryGenerationFailureReason\x12/\n+QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12!\n\x1dQUERY_GENERATION_OUT_OF_QUOTA\x10\x01\x12\x1b\n\x17QUERY_GENERATION_FAILED\x10\x02\x12\'\n#QUERY_GENERATION_NO_QUERY_GENERATED\x10\x03\x12\x1f\n\x1bQUERY_GENERATION_RAI_FAILED\x10\x04\x12\x14\n\x10NOT_IN_ALLOWLIST\x10\x05\x12#\n\x1fQUERY_GENERATION_QUERY_REDACTED\x10\x06\x12.\n*QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED\x10\n\x12\'\n#QUERY_GENERATION_EMPTY_CONVERSATION\x10\x0b\x12\'\n#QUERY_GENERATION_EMPTY_LAST_MESSAGE\x10\x0c\x12\x37\n3QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET\x10\r\"\xcc\x01\n QueryCategorizationFailureReason\x12\x33\n/QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12\'\n#QUERY_CATEGORIZATION_INVALID_CONFIG\x10\x01\x12)\n%QUERY_CATEGORIZATION_RESULT_NOT_FOUND\x10\x02\x12\x1f\n\x1bQUERY_CATEGORIZATION_FAILED\x10\x03\"\xc1\x0c\n\x15KnowledgeAssistAnswer\x12Y\n\x0fsuggested_query\x18\x01 \x01(\x0b\x32@.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery\x12\x61\n\x16suggested_query_answer\x18\x02 \x01(\x0b\x32\x41.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer\x12\x15\n\ranswer_record\x18\x03 \x01(\t\x12Y\n\x1bknowledge_assist_debug_info\x18\x07 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo\x1a\xc9\x01\n\x0eSuggestedQuery\x12\x12\n\nquery_text\x18\x01 \x01(\t\x12l\n\x0fsearch_contexts\x18\x04 \x03(\x0b\x32N.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContextB\x03\xe0\x41\x01\x1a\x35\n\rSearchContext\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\xc7\x01\n\x1e\x41\x64\x64itionalSuggestedQueryResult\x12^\n\x0fsuggested_query\x18\x01 \x01(\x0b\x32@.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryB\x03\xe0\x41\x03\x12\x45\n\ranswer_record\x18\x05 \x01(\tB.\xe0\x41\x03\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x1a\xe1\x06\n\x0fKnowledgeAnswer\x12\x13\n\x0b\x61nswer_text\x18\x01 \x01(\t\x12\x61\n\nfaq_source\x18\x03 \x01(\x0b\x32K.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceH\x00\x12o\n\x11generative_source\x18\x04 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\x00\x12m\n\x0fplaybook_source\x18\x07 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\x00\x12\x65\n\x0c\x65vent_source\x18\x08 \x01(\x0b\x32M.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSourceH\x00\x1a\x1d\n\tFaqSource\x12\x10\n\x08question\x18\x02 \x01(\t\x1a\xe0\x01\n\x10GenerativeSource\x12l\n\x08snippets\x18\x01 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet\x1a^\n\x07Snippet\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\r\n\x05title\x18\x04 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x82\x01\n\x0b\x45ventSource\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x64\n\x08snippets\x18\x02 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceB\x08\n\x06source*\xd6\x02\n\x17\x44\x61tastoreResponseReason\x12)\n%DATASTORE_RESPONSE_REASON_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x17\n\x13SEARCH_OUT_OF_QUOTA\x10\x02\x12\x18\n\x14SEARCH_EMPTY_RESULTS\x10\x03\x12%\n!ANSWER_GENERATION_GEN_AI_DISABLED\x10\x04\x12\"\n\x1e\x41NSWER_GENERATION_OUT_OF_QUOTA\x10\x05\x12\x1b\n\x17\x41NSWER_GENERATION_ERROR\x10\x06\x12%\n!ANSWER_GENERATION_NOT_ENOUGH_INFO\x10\x07\x12 \n\x1c\x41NSWER_GENERATION_RAI_FAILED\x10\x08\x12\"\n\x1e\x41NSWER_GENERATION_NOT_GROUNDED\x10\t2\xfa\x18\n\x0cParticipants\x12\xa5\x02\n\x11\x43reateParticipant\x12\x34.google.cloud.dialogflow.v2.CreateParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\xb0\x01\xda\x41\x12parent,participant\x82\xd3\xe4\x93\x02\x94\x01\"4/v2/{parent=projects/*/conversations/*}/participants:\x0bparticipantZO\"@/v2/{parent=projects/*/locations/*/conversations/*}/participants:\x0bparticipant\x12\xf6\x01\n\x0eGetParticipant\x12\x31.google.cloud.dialogflow.v2.GetParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\x12\x34/v2/{name=projects/*/conversations/*/participants/*}ZB\x12@/v2/{name=projects/*/locations/*/conversations/*/participants/*}\x12\x89\x02\n\x10ListParticipants\x12\x33.google.cloud.dialogflow.v2.ListParticipantsRequest\x1a\x34.google.cloud.dialogflow.v2.ListParticipantsResponse\"\x89\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02z\x12\x34/v2/{parent=projects/*/conversations/*}/participantsZB\x12@/v2/{parent=projects/*/locations/*/conversations/*}/participants\x12\xc2\x02\n\x11UpdateParticipant\x12\x34.google.cloud.dialogflow.v2.UpdateParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\xcd\x01\xda\x41\x17participant,update_mask\x82\xd3\xe4\x93\x02\xac\x01\x32@/v2/{participant.name=projects/*/conversations/*/participants/*}:\x0bparticipantZ[2L/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}:\x0bparticipant\x12\xfa\x02\n\x0e\x41nalyzeContent\x12\x31.google.cloud.dialogflow.v2.AnalyzeContentRequest\x1a\x32.google.cloud.dialogflow.v2.AnalyzeContentResponse\"\x80\x02\xda\x41\x16participant,text_input\xda\x41\x17participant,event_input\xda\x41\x17participant,audio_input\x82\xd3\xe4\x93\x02\xac\x01\"J/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent:\x01*Z[\"V/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent:\x01*\x12\x98\x01\n\x17StreamingAnalyzeContent\x12:.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest\x1a;.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse\"\x00(\x01\x30\x01\x12\xc9\x02\n\x0fSuggestArticles\x12\x32.google.cloud.dialogflow.v2.SuggestArticlesRequest\x1a\x33.google.cloud.dialogflow.v2.SuggestArticlesResponse\"\xcc\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xbc\x01\"R/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*Zc\"^/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*\x12\xd3\x02\n\x11SuggestFaqAnswers\x12\x34.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest\x1a\x35.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse\"\xd0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xc0\x01\"T/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*Ze\"`/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*\x12\xdd\x02\n\x13SuggestSmartReplies\x12\x36.google.cloud.dialogflow.v2.SuggestSmartRepliesRequest\x1a\x37.google.cloud.dialogflow.v2.SuggestSmartRepliesResponse\"\xd4\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xc4\x01\"V/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*Zg\"b/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*\x12\xe3\x02\n\x16SuggestKnowledgeAssist\x12\x39.google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest\x1a:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse\"\xd1\x01\x82\xd3\xe4\x93\x02\xca\x01\"Y/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*Zj\"e/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x10ParticipantProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + Participant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Participant").msgclass + Participant::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Participant.Role").enummodule + Participant::AgentDesktopSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Participant.AgentDesktopSource").enummodule + Message = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Message").msgclass + CreateParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateParticipantRequest").msgclass + GetParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetParticipantRequest").msgclass + ListParticipantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListParticipantsRequest").msgclass + ListParticipantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListParticipantsResponse").msgclass + UpdateParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateParticipantRequest").msgclass + AnalyzeContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentRequest").msgclass + DtmfParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DtmfParameters").msgclass + AnalyzeContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentResponse").msgclass + StreamingAnalyzeContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest").msgclass + StreamingAnalyzeContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse").msgclass + SuggestArticlesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesRequest").msgclass + SuggestArticlesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesResponse").msgclass + SuggestFaqAnswersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestFaqAnswersRequest").msgclass + SuggestFaqAnswersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestFaqAnswersResponse").msgclass + GenerateSuggestionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateSuggestionsResponse").msgclass + GenerateSuggestionsResponse::GeneratorSuggestionAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer").msgclass + SuggestSmartRepliesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestSmartRepliesRequest").msgclass + SuggestSmartRepliesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestSmartRepliesResponse").msgclass + AudioInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AudioInput").msgclass + OutputAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudio").msgclass + AutomatedAgentReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AutomatedAgentReply").msgclass + AutomatedAgentReply::AutomatedAgentReplyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType").enummodule + ArticleAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ArticleAnswer").msgclass + FaqAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FaqAnswer").msgclass + SmartReplyAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyAnswer").msgclass + IntentSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IntentSuggestion").msgclass + DialogflowAssistAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DialogflowAssistAnswer").msgclass + SuggestionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionResult").msgclass + InputTextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputTextConfig").msgclass + AnnotatedMessagePart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnnotatedMessagePart").msgclass + MessageAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.MessageAnnotation").msgclass + SuggestionInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionInput").msgclass + SuggestionInput::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionInput.Action").enummodule + AssistQueryParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AssistQueryParameters").msgclass + SuggestKnowledgeAssistRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest").msgclass + SuggestKnowledgeAssistResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse").msgclass + IngestedContextReferenceDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo").msgclass + IngestedContextReferenceDebugInfo::IngestedParameterDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo").msgclass + IngestedContextReferenceDebugInfo::IngestedParameterDebugInfo::IngestionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus").enummodule + ServiceLatency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ServiceLatency").msgclass + ServiceLatency::InternalServiceLatency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency").msgclass + KnowledgeAssistDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo").msgclass + KnowledgeAssistDebugInfo::KnowledgeAssistBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior").msgclass + KnowledgeAssistDebugInfo::QueryGenerationDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo").msgclass + KnowledgeAssistDebugInfo::QueryGenerationFailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason").enummodule + KnowledgeAssistDebugInfo::QueryCategorizationFailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason").enummodule + KnowledgeAssistAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer").msgclass + KnowledgeAssistAnswer::SuggestedQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery").msgclass + KnowledgeAssistAnswer::SuggestedQuery::SearchContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContext").msgclass + KnowledgeAssistAnswer::AdditionalSuggestedQueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResult").msgclass + KnowledgeAssistAnswer::KnowledgeAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer").msgclass + KnowledgeAssistAnswer::KnowledgeAnswer::FaqSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource").msgclass + KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource").msgclass + KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource::Snippet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet").msgclass + KnowledgeAssistAnswer::KnowledgeAnswer::EventSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSource").msgclass + DatastoreResponseReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DatastoreResponseReason").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb new file mode 100644 index 000000000000..267aafd6ef5a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb @@ -0,0 +1,85 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/participant.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/participant_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Participants + # Service for managing [Participants][google.cloud.dialogflow.v2.Participant]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Participants' + + # Creates a new participant in a conversation. + rpc :CreateParticipant, ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, ::Google::Cloud::Dialogflow::V2::Participant + # Retrieves a conversation participant. + rpc :GetParticipant, ::Google::Cloud::Dialogflow::V2::GetParticipantRequest, ::Google::Cloud::Dialogflow::V2::Participant + # Returns the list of all participants in the specified conversation. + rpc :ListParticipants, ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, ::Google::Cloud::Dialogflow::V2::ListParticipantsResponse + # Updates the specified participant. + rpc :UpdateParticipant, ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, ::Google::Cloud::Dialogflow::V2::Participant + # Adds a text (chat, for example), or audio (phone recording, for example) + # message from a participant into the conversation. + # + # Note: Always use agent versions for production traffic + # sent to virtual agents. See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + rpc :AnalyzeContent, ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse + # Adds a text (chat, for example), or audio (phone recording, for example) + # message from a participant into the conversation. + # Note: This method is only available through the gRPC API (not REST). + # + # The top-level message sent to the client by the server is + # `StreamingAnalyzeContentResponse`. Multiple response messages can be + # returned in order. The first one or more messages contain the + # `recognition_result` field. Each result represents a more complete + # transcript of what the user said. The next message contains the + # `reply_text` field and potentially the `reply_audio` field. The message can + # also contain the `automated_agent_reply` field. + # + # Note: Always use agent versions for production traffic + # sent to virtual agents. See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + rpc :StreamingAnalyzeContent, stream(::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest), stream(::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse) + # Gets suggested articles for a participant based on specific historical + # messages. + rpc :SuggestArticles, ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse + # Gets suggested faq answers for a participant based on specific historical + # messages. + rpc :SuggestFaqAnswers, ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse + # Gets smart replies for a participant based on specific historical + # messages. + rpc :SuggestSmartReplies, ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest, ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse + # Gets knowledge assist suggestions based on historical messages. + rpc :SuggestKnowledgeAssist, ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest, ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants.rb new file mode 100644 index 000000000000..b5cdfcd2f82e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/participants/credentials" +require "google/cloud/dialogflow/v2/participants/paths" +require "google/cloud/dialogflow/v2/participants/client" +require "google/cloud/dialogflow/v2/participants/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/participants" + # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/participants/rest" + # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + module Participants + end + end + end + end +end + +helper_path = ::File.join __dir__, "participants", "helpers.rb" +require "google/cloud/dialogflow/v2/participants/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb new file mode 100644 index 000000000000..2921f33bb8c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb @@ -0,0 +1,1469 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/participant_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Participants + ## + # Client for the Participants service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :participants_stub + + ## + # Configure the Participants Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Participants::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Participants clients + # ::Google::Cloud::Dialogflow::V2::Participants::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.analyze_content.timeout = 220.0 + default_config.rpcs.analyze_content.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.streaming_analyze_content.timeout = 220.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Participants 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::Dialogflow::V2::Participants::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 + @participants_stub.universe_domain + end + + ## + # Create a new Participants client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Participants 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/dialogflow/v2/participant_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 + + @participants_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Participants::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 + ) + + @participants_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 = @participants_stub.endpoint + config.universe_domain = @participants_stub.universe_domain + config.logger = @participants_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 + @participants_stub.logger + end + + # Service calls + + ## + # Creates a new participant in a conversation. + # + # @overload create_participant(request, options = nil) + # Pass arguments to `create_participant` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_participant(parent: nil, participant: nil) + # Pass arguments to `create_participant` via keyword arguments. Note that at + # least one keyword argument is 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. Resource identifier of the conversation adding the participant. + # Format: `projects//locations//conversations/`. + # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash] + # Required. The participant to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new + # + # # Call the create_participant method. + # result = client.create_participant request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + # p result + # + def create_participant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest + + # Converts hash and nil to 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_participant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_participant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_participant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :create_participant, 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 + + ## + # Retrieves a conversation participant. + # + # @overload get_participant(request, options = nil) + # Pass arguments to `get_participant` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetParticipantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetParticipantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_participant(name: nil) + # Pass arguments to `get_participant` via keyword arguments. Note that at + # least one keyword argument is required. To 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 participant. Format: + # `projects//locations//conversations//participants/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new + # + # # Call the get_participant method. + # result = client.get_participant request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + # p result + # + def get_participant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetParticipantRequest + + # Converts hash and nil to 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_participant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_participant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_participant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :get_participant, 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 + + ## + # Returns the list of all participants in the specified conversation. + # + # @overload list_participants(request, options = nil) + # Pass arguments to `list_participants` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListParticipantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_participants(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_participants` via keyword arguments. Note that at + # least one keyword argument is 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 conversation to list all participants from. + # Format: `projects//locations//conversations/`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new + # + # # Call the list_participants method. + # result = client.list_participants 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::Dialogflow::V2::Participant. + # p item + # end + # + def list_participants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest + + # Converts hash and nil to 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_participants.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_participants.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_participants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :list_participants, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @participants_stub, :list_participants, 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 specified participant. + # + # @overload update_participant(request, options = nil) + # Pass arguments to `update_participant` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_participant(participant: nil, update_mask: nil) + # Pass arguments to `update_participant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash] + # Required. The participant to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to specify which fields to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new + # + # # Call the update_participant method. + # result = client.update_participant request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + # p result + # + def update_participant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest + + # Converts hash and nil to 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_participant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.participant&.name + header_params["participant.name"] = request.participant.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_participant.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_participant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :update_participant, 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 + + ## + # Adds a text (chat, for example), or audio (phone recording, for example) + # message from a participant into the conversation. + # + # Note: Always use agent versions for production traffic + # sent to virtual agents. See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # + # @overload analyze_content(request, options = nil) + # Pass arguments to `analyze_content` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload analyze_content(participant: nil, text_input: nil, audio_input: nil, event_input: nil, suggestion_input: nil, reply_audio_config: nil, query_params: nil, assist_query_params: nil, cx_parameters: nil, request_id: nil) + # Pass arguments to `analyze_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 participant [::String] + # Required. The name of the participant this text comes from. + # Format: `projects//locations//conversations//participants/`. + # @param text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] + # The natural language text to be processed. + # + # Note: The following parameters are mutually exclusive: `text_input`, `audio_input`, `event_input`, `suggestion_input`. 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 audio_input [::Google::Cloud::Dialogflow::V2::AudioInput, ::Hash] + # The natural language speech audio to be processed. + # + # Note: The following parameters are mutually exclusive: `audio_input`, `text_input`, `event_input`, `suggestion_input`. 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 event_input [::Google::Cloud::Dialogflow::V2::EventInput, ::Hash] + # An input event to send to Dialogflow. + # + # Note: The following parameters are mutually exclusive: `event_input`, `text_input`, `audio_input`, `suggestion_input`. 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 suggestion_input [::Google::Cloud::Dialogflow::V2::SuggestionInput, ::Hash] + # An input representing the selection of a suggestion. + # + # Note: The following parameters are mutually exclusive: `suggestion_input`, `text_input`, `audio_input`, `event_input`. 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 reply_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash] + # Speech synthesis configuration. + # The speech synthesis settings for a virtual agent that may be configured + # for the associated conversation profile are not used when calling + # AnalyzeContent. If this configuration is not supplied, speech synthesis + # is disabled. + # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash] + # Parameters for a Dialogflow virtual-agent query. + # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] + # Parameters for a human assist query. + # @param cx_parameters [::Google::Protobuf::Struct, ::Hash] + # Additional parameters to be put into Dialogflow CX session parameters. To + # remove a parameter from the session, clients should explicitly set the + # parameter value to null. + # + # Note: this field should only be used if you are connecting to a Dialogflow + # CX agent. + # @param request_id [::String] + # A unique identifier for this request. Restricted to 36 ASCII characters. + # A random UUID is recommended. + # This request is only idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new + # + # # Call the analyze_content method. + # result = client.analyze_content request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse. + # p result + # + def analyze_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.analyze_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::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.participant + header_params["participant"] = request.participant + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.analyze_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.analyze_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :analyze_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 + + ## + # Adds a text (chat, for example), or audio (phone recording, for example) + # message from a participant into the conversation. + # Note: This method is only available through the gRPC API (not REST). + # + # The top-level message sent to the client by the server is + # `StreamingAnalyzeContentResponse`. Multiple response messages can be + # returned in order. The first one or more messages contain the + # `recognition_result` field. Each result represents a more complete + # transcript of what the user said. The next message contains the + # `reply_text` field and potentially the `reply_audio` field. The message can + # also contain the `automated_agent_reply` field. + # + # Note: Always use agent versions for production traffic + # sent to virtual agents. See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest} 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::Dialogflow::V2::StreamingAnalyzeContentResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_analyze_content method to start streaming. + # output = client.streaming_analyze_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::Dialogflow::V2::StreamingAnalyzeContentRequest.new + # input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_analyze_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::Dialogflow::V2::StreamingAnalyzeContentRequest + 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.streaming_analyze_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::Dialogflow::V2::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.streaming_analyze_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_analyze_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :streaming_analyze_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 + + ## + # Gets suggested articles for a participant based on specific historical + # messages. + # + # @overload suggest_articles(request, options = nil) + # Pass arguments to `suggest_articles` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_articles(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil) + # Pass arguments to `suggest_articles` via keyword arguments. Note that at + # least one keyword argument is 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 name of the participant to fetch suggestion for. + # Format: `projects//locations//conversations//participants/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message to compile suggestion + # for. If empty, it will be the latest message of the conversation. + # + # Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Optional. Max number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#latest_message latest_message} + # to use as context when compiling the suggestion. By default 20 and at + # most 50. + # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] + # Parameters for a human assist query. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new + # + # # Call the suggest_articles method. + # result = client.suggest_articles request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse. + # p result + # + def suggest_articles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_articles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.suggest_articles.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_articles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :suggest_articles, 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 suggested faq answers for a participant based on specific historical + # messages. + # + # @overload suggest_faq_answers(request, options = nil) + # Pass arguments to `suggest_faq_answers` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_faq_answers(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil) + # Pass arguments to `suggest_faq_answers` via keyword arguments. Note that at + # least one keyword argument is 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 name of the participant to fetch suggestion for. + # Format: `projects//locations//conversations//participants/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message to compile suggestion + # for. If empty, it will be the latest message of the conversation. + # + # Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Optional. Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 20 and at most 50. + # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] + # Parameters for a human assist query. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new + # + # # Call the suggest_faq_answers method. + # result = client.suggest_faq_answers request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse. + # p result + # + def suggest_faq_answers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_faq_answers.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.suggest_faq_answers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_faq_answers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :suggest_faq_answers, 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 smart replies for a participant based on specific historical + # messages. + # + # @overload suggest_smart_replies(request, options = nil) + # Pass arguments to `suggest_smart_replies` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_smart_replies(parent: nil, current_text_input: nil, latest_message: nil, context_size: nil) + # Pass arguments to `suggest_smart_replies` via keyword arguments. Note that at + # least one keyword argument is 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 name of the participant to fetch suggestion for. + # Format: `projects//locations//conversations//participants/`. + # @param current_text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] + # The current natural language text segment to compile suggestion + # for. This provides a way for user to get follow up smart reply suggestion + # after a smart reply selection, without sending a text message. + # @param latest_message [::String] + # The name of the latest conversation message to compile suggestion + # for. If empty, it will be the latest message of the conversation. + # + # Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 20 and at most 50. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new + # + # # Call the suggest_smart_replies method. + # result = client.suggest_smart_replies request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse. + # p result + # + def suggest_smart_replies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_smart_replies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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.suggest_smart_replies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_smart_replies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :suggest_smart_replies, 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 knowledge assist suggestions based on historical messages. + # + # @overload suggest_knowledge_assist(request, options = nil) + # Pass arguments to `suggest_knowledge_assist` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload suggest_knowledge_assist(parent: nil, latest_message: nil, context_size: nil, previous_suggested_query: nil) + # Pass arguments to `suggest_knowledge_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 parent [::String] + # Required. The name of the participant to fetch suggestions for. + # Format: `projects//locations//conversations//participants/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message to compile + # suggestions for. If empty, it will be the latest message of the + # conversation. Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Optional. Max number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest#latest_message latest_message} + # to use as context when compiling the suggestion. The context size is by + # default 100 and at most 100. + # @param previous_suggested_query [::String] + # Optional. The previously suggested query for the given conversation. This + # helps identify whether the next suggestion we generate is reasonably + # different from the previous one. This is useful to avoid similar + # suggestions within the conversation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new + # + # # Call the suggest_knowledge_assist method. + # result = client.suggest_knowledge_assist request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse. + # p result + # + def suggest_knowledge_assist request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.suggest_knowledge_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::Dialogflow::V2::VERSION + metadata[:"x-goog-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.suggest_knowledge_assist.timeout, + metadata: metadata, + retry_policy: @config.rpcs.suggest_knowledge_assist.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :suggest_knowledge_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 Participants API. + # + # This class represents the configuration for Participants, + # 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::Dialogflow::V2::Participants::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_participant to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Participants::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_participant.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_participant.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::Dialogflow::V2::Participants::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Participants 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_participant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_participant + ## + # RPC-specific configuration for `get_participant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_participant + ## + # RPC-specific configuration for `list_participants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_participants + ## + # RPC-specific configuration for `update_participant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_participant + ## + # RPC-specific configuration for `analyze_content` + # @return [::Gapic::Config::Method] + # + attr_reader :analyze_content + ## + # RPC-specific configuration for `streaming_analyze_content` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_analyze_content + ## + # RPC-specific configuration for `suggest_articles` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_articles + ## + # RPC-specific configuration for `suggest_faq_answers` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_faq_answers + ## + # RPC-specific configuration for `suggest_smart_replies` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_smart_replies + ## + # RPC-specific configuration for `suggest_knowledge_assist` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_knowledge_assist + + # @private + def initialize parent_rpcs = nil + create_participant_config = parent_rpcs.create_participant if parent_rpcs.respond_to? :create_participant + @create_participant = ::Gapic::Config::Method.new create_participant_config + get_participant_config = parent_rpcs.get_participant if parent_rpcs.respond_to? :get_participant + @get_participant = ::Gapic::Config::Method.new get_participant_config + list_participants_config = parent_rpcs.list_participants if parent_rpcs.respond_to? :list_participants + @list_participants = ::Gapic::Config::Method.new list_participants_config + update_participant_config = parent_rpcs.update_participant if parent_rpcs.respond_to? :update_participant + @update_participant = ::Gapic::Config::Method.new update_participant_config + analyze_content_config = parent_rpcs.analyze_content if parent_rpcs.respond_to? :analyze_content + @analyze_content = ::Gapic::Config::Method.new analyze_content_config + streaming_analyze_content_config = parent_rpcs.streaming_analyze_content if parent_rpcs.respond_to? :streaming_analyze_content + @streaming_analyze_content = ::Gapic::Config::Method.new streaming_analyze_content_config + suggest_articles_config = parent_rpcs.suggest_articles if parent_rpcs.respond_to? :suggest_articles + @suggest_articles = ::Gapic::Config::Method.new suggest_articles_config + suggest_faq_answers_config = parent_rpcs.suggest_faq_answers if parent_rpcs.respond_to? :suggest_faq_answers + @suggest_faq_answers = ::Gapic::Config::Method.new suggest_faq_answers_config + suggest_smart_replies_config = parent_rpcs.suggest_smart_replies if parent_rpcs.respond_to? :suggest_smart_replies + @suggest_smart_replies = ::Gapic::Config::Method.new suggest_smart_replies_config + suggest_knowledge_assist_config = parent_rpcs.suggest_knowledge_assist if parent_rpcs.respond_to? :suggest_knowledge_assist + @suggest_knowledge_assist = ::Gapic::Config::Method.new suggest_knowledge_assist_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/credentials.rb new file mode 100644 index 000000000000..1d703fb329b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Participants + # Credentials for the Participants API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/paths.rb new file mode 100644 index 000000000000..f10924438fbf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/paths.rb @@ -0,0 +1,353 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module Participants + # Path helper methods for the Participants API. + module Paths + ## + # Create a fully-qualified Context resource string. + # + # @overload context_path(project:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @return [::String] + def context_path **args + resources = { + "context:project:session" => (proc do |project:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + end), + "context:location:project:session" => (proc do |project:, location:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + 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:, conversation:) + # The resource will be in the following format: + # + # `projects/{project}/conversations/{conversation}` + # + # @param project [String] + # @param conversation [String] + # + # @overload conversation_path(project:, location:, conversation:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversations/{conversation}` + # + # @param project [String] + # @param location [String] + # @param conversation [String] + # + # @return [::String] + def conversation_path **args + resources = { + "conversation:project" => (proc do |project:, conversation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/conversations/#{conversation}" + end), + "conversation:location:project" => (proc do |project:, location:, conversation:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/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 Message resource string. + # + # @overload message_path(project:, conversation:, message:) + # The resource will be in the following format: + # + # `projects/{project}/conversations/{conversation}/messages/{message}` + # + # @param project [String] + # @param conversation [String] + # @param message [String] + # + # @overload message_path(project:, location:, conversation:, message:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}` + # + # @param project [String] + # @param location [String] + # @param conversation [String] + # @param message [String] + # + # @return [::String] + def message_path **args + resources = { + "conversation:message:project" => (proc do |project:, conversation:, message:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" + + "projects/#{project}/conversations/#{conversation}/messages/#{message}" + end), + "conversation:location:message:project" => (proc do |project:, location:, conversation:, message:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversations/#{conversation}/messages/#{message}" + 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 Participant resource string. + # + # @overload participant_path(project:, conversation:, participant:) + # The resource will be in the following format: + # + # `projects/{project}/conversations/{conversation}/participants/{participant}` + # + # @param project [String] + # @param conversation [String] + # @param participant [String] + # + # @overload participant_path(project:, location:, conversation:, participant:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}` + # + # @param project [String] + # @param location [String] + # @param conversation [String] + # @param participant [String] + # + # @return [::String] + def participant_path **args + resources = { + "conversation:participant:project" => (proc do |project:, conversation:, participant:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" + + "projects/#{project}/conversations/#{conversation}/participants/#{participant}" + end), + "conversation:location:participant:project" => (proc do |project:, location:, conversation:, participant:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" + + "projects/#{project}/locations/#{location}/conversations/#{conversation}/participants/#{participant}" + 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 PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + ## + # Create a fully-qualified SessionEntityType resource string. + # + # @overload session_entity_type_path(project:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, environment:, user:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, location:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, location:, environment:, user:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param entity_type [String] + # + # @return [::String] + def session_entity_type_path **args + resources = { + "entity_type:project:session" => (proc do |project:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}/entityTypes/#{entity_type}" + end), + "entity_type:environment:project:session:user" => (proc do |project:, environment:, user:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" + end), + "entity_type:location:project:session" => (proc do |project:, location:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}/entityTypes/#{entity_type}" + end), + "entity_type:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest.rb new file mode 100644 index 000000000000..1f43879e56b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/participants/credentials" +require "google/cloud/dialogflow/v2/participants/paths" +require "google/cloud/dialogflow/v2/participants/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/participants/rest" + # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + module Participants + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/participants/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb new file mode 100644 index 000000000000..332db1c00cc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb @@ -0,0 +1,1270 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/participant_pb" +require "google/cloud/dialogflow/v2/participants/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Participants + module Rest + ## + # REST client for the Participants service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :participants_stub + + ## + # Configure the Participants Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Participants::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Participants clients + # ::Google::Cloud::Dialogflow::V2::Participants::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.analyze_content.timeout = 220.0 + default_config.rpcs.analyze_content.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Participants 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::Dialogflow::V2::Participants::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 + @participants_stub.universe_domain + end + + ## + # Create a new Participants REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Participants 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 + + @participants_stub = ::Google::Cloud::Dialogflow::V2::Participants::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @participants_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 = @participants_stub.endpoint + config.universe_domain = @participants_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @participants_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 + @participants_stub.logger + end + + # Service calls + + ## + # Creates a new participant in a conversation. + # + # @overload create_participant(request, options = nil) + # Pass arguments to `create_participant` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_participant(parent: nil, participant: nil) + # Pass arguments to `create_participant` via keyword arguments. Note that at + # least one keyword argument is 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. Resource identifier of the conversation adding the participant. + # Format: `projects//locations//conversations/`. + # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash] + # Required. The participant to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Participant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new + # + # # Call the create_participant method. + # result = client.create_participant request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + # p result + # + def create_participant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest + + # Converts hash and nil to an 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_participant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_participant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_participant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.create_participant 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 + + ## + # Retrieves a conversation participant. + # + # @overload get_participant(request, options = nil) + # Pass arguments to `get_participant` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetParticipantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetParticipantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_participant(name: nil) + # Pass arguments to `get_participant` via keyword arguments. Note that at + # least one keyword argument is required. To 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 participant. Format: + # `projects//locations//conversations//participants/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Participant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new + # + # # Call the get_participant method. + # result = client.get_participant request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + # p result + # + def get_participant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetParticipantRequest + + # Converts hash and nil to an 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_participant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_participant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_participant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.get_participant 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 + + ## + # Returns the list of all participants in the specified conversation. + # + # @overload list_participants(request, options = nil) + # Pass arguments to `list_participants` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListParticipantsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_participants(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_participants` via keyword arguments. Note that at + # least one keyword argument is 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 conversation to list all participants from. + # Format: `projects//locations//conversations/`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new + # + # # Call the list_participants method. + # result = client.list_participants 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::Dialogflow::V2::Participant. + # p item + # end + # + def list_participants request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest + + # Converts hash and nil to an 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_participants.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_participants.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_participants.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.list_participants request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @participants_stub, :list_participants, "participants", 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 specified participant. + # + # @overload update_participant(request, options = nil) + # Pass arguments to `update_participant` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_participant(participant: nil, update_mask: nil) + # Pass arguments to `update_participant` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash] + # Required. The participant to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to specify which fields to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Participant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new + # + # # Call the update_participant method. + # result = client.update_participant request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + # p result + # + def update_participant request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest + + # Converts hash and nil to an 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_participant.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_participant.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_participant.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.update_participant 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 + + ## + # Adds a text (chat, for example), or audio (phone recording, for example) + # message from a participant into the conversation. + # + # Note: Always use agent versions for production traffic + # sent to virtual agents. See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # + # @overload analyze_content(request, options = nil) + # Pass arguments to `analyze_content` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload analyze_content(participant: nil, text_input: nil, audio_input: nil, event_input: nil, suggestion_input: nil, reply_audio_config: nil, query_params: nil, assist_query_params: nil, cx_parameters: nil, request_id: nil) + # Pass arguments to `analyze_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 participant [::String] + # Required. The name of the participant this text comes from. + # Format: `projects//locations//conversations//participants/`. + # @param text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] + # The natural language text to be processed. + # + # Note: The following parameters are mutually exclusive: `text_input`, `audio_input`, `event_input`, `suggestion_input`. 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 audio_input [::Google::Cloud::Dialogflow::V2::AudioInput, ::Hash] + # The natural language speech audio to be processed. + # + # Note: The following parameters are mutually exclusive: `audio_input`, `text_input`, `event_input`, `suggestion_input`. 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 event_input [::Google::Cloud::Dialogflow::V2::EventInput, ::Hash] + # An input event to send to Dialogflow. + # + # Note: The following parameters are mutually exclusive: `event_input`, `text_input`, `audio_input`, `suggestion_input`. 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 suggestion_input [::Google::Cloud::Dialogflow::V2::SuggestionInput, ::Hash] + # An input representing the selection of a suggestion. + # + # Note: The following parameters are mutually exclusive: `suggestion_input`, `text_input`, `audio_input`, `event_input`. 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 reply_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash] + # Speech synthesis configuration. + # The speech synthesis settings for a virtual agent that may be configured + # for the associated conversation profile are not used when calling + # AnalyzeContent. If this configuration is not supplied, speech synthesis + # is disabled. + # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash] + # Parameters for a Dialogflow virtual-agent query. + # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] + # Parameters for a human assist query. + # @param cx_parameters [::Google::Protobuf::Struct, ::Hash] + # Additional parameters to be put into Dialogflow CX session parameters. To + # remove a parameter from the session, clients should explicitly set the + # parameter value to null. + # + # Note: this field should only be used if you are connecting to a Dialogflow + # CX agent. + # @param request_id [::String] + # A unique identifier for this request. Restricted to 36 ASCII characters. + # A random UUID is recommended. + # This request is only idempotent if a `request_id` is provided. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new + # + # # Call the analyze_content method. + # result = client.analyze_content request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse. + # p result + # + def analyze_content request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.analyze_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.analyze_content.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.analyze_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.analyze_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 + + ## + # Gets suggested articles for a participant based on specific historical + # messages. + # + # @overload suggest_articles(request, options = nil) + # Pass arguments to `suggest_articles` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload suggest_articles(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil) + # Pass arguments to `suggest_articles` via keyword arguments. Note that at + # least one keyword argument is 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 name of the participant to fetch suggestion for. + # Format: `projects//locations//conversations//participants/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message to compile suggestion + # for. If empty, it will be the latest message of the conversation. + # + # Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Optional. Max number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#latest_message latest_message} + # to use as context when compiling the suggestion. By default 20 and at + # most 50. + # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] + # Parameters for a human assist query. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new + # + # # Call the suggest_articles method. + # result = client.suggest_articles request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse. + # p result + # + def suggest_articles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.suggest_articles.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.suggest_articles.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.suggest_articles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.suggest_articles 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 suggested faq answers for a participant based on specific historical + # messages. + # + # @overload suggest_faq_answers(request, options = nil) + # Pass arguments to `suggest_faq_answers` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload suggest_faq_answers(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil) + # Pass arguments to `suggest_faq_answers` via keyword arguments. Note that at + # least one keyword argument is 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 name of the participant to fetch suggestion for. + # Format: `projects//locations//conversations//participants/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message to compile suggestion + # for. If empty, it will be the latest message of the conversation. + # + # Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Optional. Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 20 and at most 50. + # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] + # Parameters for a human assist query. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new + # + # # Call the suggest_faq_answers method. + # result = client.suggest_faq_answers request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse. + # p result + # + def suggest_faq_answers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.suggest_faq_answers.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.suggest_faq_answers.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.suggest_faq_answers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.suggest_faq_answers 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 smart replies for a participant based on specific historical + # messages. + # + # @overload suggest_smart_replies(request, options = nil) + # Pass arguments to `suggest_smart_replies` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload suggest_smart_replies(parent: nil, current_text_input: nil, latest_message: nil, context_size: nil) + # Pass arguments to `suggest_smart_replies` via keyword arguments. Note that at + # least one keyword argument is 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 name of the participant to fetch suggestion for. + # Format: `projects//locations//conversations//participants/`. + # @param current_text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] + # The current natural language text segment to compile suggestion + # for. This provides a way for user to get follow up smart reply suggestion + # after a smart reply selection, without sending a text message. + # @param latest_message [::String] + # The name of the latest conversation message to compile suggestion + # for. If empty, it will be the latest message of the conversation. + # + # Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 20 and at most 50. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new + # + # # Call the suggest_smart_replies method. + # result = client.suggest_smart_replies request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse. + # p result + # + def suggest_smart_replies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.suggest_smart_replies.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.suggest_smart_replies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.suggest_smart_replies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.suggest_smart_replies 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 knowledge assist suggestions based on historical messages. + # + # @overload suggest_knowledge_assist(request, options = nil) + # Pass arguments to `suggest_knowledge_assist` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload suggest_knowledge_assist(parent: nil, latest_message: nil, context_size: nil, previous_suggested_query: nil) + # Pass arguments to `suggest_knowledge_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 parent [::String] + # Required. The name of the participant to fetch suggestions for. + # Format: `projects//locations//conversations//participants/`. + # @param latest_message [::String] + # Optional. The name of the latest conversation message to compile + # suggestions for. If empty, it will be the latest message of the + # conversation. Format: `projects//locations//conversations//messages/`. + # @param context_size [::Integer] + # Optional. Max number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest#latest_message latest_message} + # to use as context when compiling the suggestion. The context size is by + # default 100 and at most 100. + # @param previous_suggested_query [::String] + # Optional. The previously suggested query for the given conversation. This + # helps identify whether the next suggestion we generate is reasonably + # different from the previous one. This is useful to avoid similar + # suggestions within the conversation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new + # + # # Call the suggest_knowledge_assist method. + # result = client.suggest_knowledge_assist request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse. + # p result + # + def suggest_knowledge_assist request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.suggest_knowledge_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::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.suggest_knowledge_assist.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.suggest_knowledge_assist.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.suggest_knowledge_assist 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 Participants REST API. + # + # This class represents the configuration for Participants 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::Dialogflow::V2::Participants::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_participant to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_participant.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_participant.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Participants 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_participant` + # @return [::Gapic::Config::Method] + # + attr_reader :create_participant + ## + # RPC-specific configuration for `get_participant` + # @return [::Gapic::Config::Method] + # + attr_reader :get_participant + ## + # RPC-specific configuration for `list_participants` + # @return [::Gapic::Config::Method] + # + attr_reader :list_participants + ## + # RPC-specific configuration for `update_participant` + # @return [::Gapic::Config::Method] + # + attr_reader :update_participant + ## + # RPC-specific configuration for `analyze_content` + # @return [::Gapic::Config::Method] + # + attr_reader :analyze_content + ## + # RPC-specific configuration for `suggest_articles` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_articles + ## + # RPC-specific configuration for `suggest_faq_answers` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_faq_answers + ## + # RPC-specific configuration for `suggest_smart_replies` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_smart_replies + ## + # RPC-specific configuration for `suggest_knowledge_assist` + # @return [::Gapic::Config::Method] + # + attr_reader :suggest_knowledge_assist + + # @private + def initialize parent_rpcs = nil + create_participant_config = parent_rpcs.create_participant if parent_rpcs.respond_to? :create_participant + @create_participant = ::Gapic::Config::Method.new create_participant_config + get_participant_config = parent_rpcs.get_participant if parent_rpcs.respond_to? :get_participant + @get_participant = ::Gapic::Config::Method.new get_participant_config + list_participants_config = parent_rpcs.list_participants if parent_rpcs.respond_to? :list_participants + @list_participants = ::Gapic::Config::Method.new list_participants_config + update_participant_config = parent_rpcs.update_participant if parent_rpcs.respond_to? :update_participant + @update_participant = ::Gapic::Config::Method.new update_participant_config + analyze_content_config = parent_rpcs.analyze_content if parent_rpcs.respond_to? :analyze_content + @analyze_content = ::Gapic::Config::Method.new analyze_content_config + suggest_articles_config = parent_rpcs.suggest_articles if parent_rpcs.respond_to? :suggest_articles + @suggest_articles = ::Gapic::Config::Method.new suggest_articles_config + suggest_faq_answers_config = parent_rpcs.suggest_faq_answers if parent_rpcs.respond_to? :suggest_faq_answers + @suggest_faq_answers = ::Gapic::Config::Method.new suggest_faq_answers_config + suggest_smart_replies_config = parent_rpcs.suggest_smart_replies if parent_rpcs.respond_to? :suggest_smart_replies + @suggest_smart_replies = ::Gapic::Config::Method.new suggest_smart_replies_config + suggest_knowledge_assist_config = parent_rpcs.suggest_knowledge_assist if parent_rpcs.respond_to? :suggest_knowledge_assist + @suggest_knowledge_assist = ::Gapic::Config::Method.new suggest_knowledge_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-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb new file mode 100644 index 000000000000..8dc67dca237c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb @@ -0,0 +1,707 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/participant_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Participants + module Rest + ## + # REST service stub for the Participants 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_participant REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Participant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # A result object deserialized from the server's reply + def create_participant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_participant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_participant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Participant.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_participant REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetParticipantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Participant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # A result object deserialized from the server's reply + def get_participant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_participant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_participant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Participant.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_participants REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListParticipantsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListParticipantsResponse] + # A result object deserialized from the server's reply + def list_participants request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_participants_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_participants", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListParticipantsResponse.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_participant REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Participant] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # A result object deserialized from the server's reply + def update_participant request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_participant_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_participant", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Participant.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the analyze_content REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::AnalyzeContentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] + # A result object deserialized from the server's reply + def analyze_content request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_analyze_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: "analyze_content", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the suggest_articles REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SuggestArticlesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] + # A result object deserialized from the server's reply + def suggest_articles request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_suggest_articles_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "suggest_articles", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the suggest_faq_answers REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SuggestFaqAnswersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] + # A result object deserialized from the server's reply + def suggest_faq_answers request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_suggest_faq_answers_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "suggest_faq_answers", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the suggest_smart_replies REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SuggestSmartRepliesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] + # A result object deserialized from the server's reply + def suggest_smart_replies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_suggest_smart_replies_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "suggest_smart_replies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the suggest_knowledge_assist REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SuggestKnowledgeAssistResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] + # A result object deserialized from the server's reply + def suggest_knowledge_assist request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_suggest_knowledge_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: "suggest_knowledge_assist", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse.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_participant REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest] + # 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_participant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/participants", + body: "participant", + matches: [ + ["parent", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/participants", + body: "participant", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_participant REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetParticipantRequest] + # 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_participant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_participants REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest] + # 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_participants_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/participants", + matches: [ + ["parent", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/participants", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_participant REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest] + # 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_participant_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{participant.name}", + body: "participant", + matches: [ + ["participant.name", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{participant.name}", + body: "participant", + matches: [ + ["participant.name", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the analyze_content REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_analyze_content_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{participant}:analyzeContent", + body: "*", + matches: [ + ["participant", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{participant}:analyzeContent", + body: "*", + matches: [ + ["participant", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the suggest_articles REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_suggest_articles_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:suggestArticles", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:suggestArticles", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the suggest_faq_answers REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_suggest_faq_answers_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:suggestFaqAnswers", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:suggestFaqAnswers", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the suggest_smart_replies REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_suggest_smart_replies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:suggestSmartReplies", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:suggestSmartReplies", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the suggest_knowledge_assist REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_suggest_knowledge_assist_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:suggestKnowledgeAssist", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/suggestions:suggestKnowledgeAssist", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/rest.rb new file mode 100644 index 000000000000..436b9c384fef --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/rest.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/agents/rest" +require "google/cloud/dialogflow/v2/tools/rest" +require "google/cloud/dialogflow/v2/generators/rest" +require "google/cloud/dialogflow/v2/contexts/rest" +require "google/cloud/dialogflow/v2/intents/rest" +require "google/cloud/dialogflow/v2/entity_types/rest" +require "google/cloud/dialogflow/v2/session_entity_types/rest" +require "google/cloud/dialogflow/v2/sessions/rest" +require "google/cloud/dialogflow/v2/participants/rest" +require "google/cloud/dialogflow/v2/answer_records/rest" +require "google/cloud/dialogflow/v2/conversation_profiles/rest" +require "google/cloud/dialogflow/v2/conversations/rest" +require "google/cloud/dialogflow/v2/conversation_datasets/rest" +require "google/cloud/dialogflow/v2/conversation_models/rest" +require "google/cloud/dialogflow/v2/documents/rest" +require "google/cloud/dialogflow/v2/encryption_spec_service/rest" +require "google/cloud/dialogflow/v2/fulfillments/rest" +require "google/cloud/dialogflow/v2/environments/rest" +require "google/cloud/dialogflow/v2/generator_evaluations/rest" +require "google/cloud/dialogflow/v2/knowledge_bases/rest" +require "google/cloud/dialogflow/v2/sip_trunks/rest" +require "google/cloud/dialogflow/v2/versions/rest" +require "google/cloud/dialogflow/v2/bindings_override" +require "google/cloud/dialogflow/v2/version" + +module Google + module Cloud + module Dialogflow + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/dialogflow/v2/rest" + # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new + # + module V2 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb new file mode 100644 index 000000000000..14e32d97a1ef --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/session_entity_type.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/dialogflow/v2/entity_type_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n4google/cloud/dialogflow/v2/session_entity_type.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/dialogflow/v2/entity_type.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa1\x06\n\x11SessionEntityType\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x63\n\x14\x65ntity_override_mode\x18\x02 \x01(\x0e\x32@.google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideModeB\x03\xe0\x41\x02\x12\x44\n\x08\x65ntities\x18\x03 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xe0\x41\x02\"\x82\x01\n\x12\x45ntityOverrideMode\x12$\n ENTITY_OVERRIDE_MODE_UNSPECIFIED\x10\x00\x12!\n\x1d\x45NTITY_OVERRIDE_MODE_OVERRIDE\x10\x01\x12#\n\x1f\x45NTITY_OVERRIDE_MODE_SUPPLEMENT\x10\x02:\xc8\x03\xea\x41\xc4\x03\n+dialogflow.googleapis.com/SessionEntityType\x12\x45projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}\x12mprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}\x12Zprojects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}\x12\x82\x01projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}\"\x95\x01\n\x1dListSessionEntityTypesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+dialogflow.googleapis.com/SessionEntityType\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\"\x86\x01\n\x1eListSessionEntityTypesResponse\x12K\n\x14session_entity_types\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"`\n\x1bGetSessionEntityTypeRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+dialogflow.googleapis.com/SessionEntityType\"\xb6\x01\n\x1e\x43reateSessionEntityTypeRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+dialogflow.googleapis.com/SessionEntityType\x12O\n\x13session_entity_type\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityTypeB\x03\xe0\x41\x02\"\xa7\x01\n\x1eUpdateSessionEntityTypeRequest\x12O\n\x13session_entity_type\x18\x01 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityTypeB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"c\n\x1e\x44\x65leteSessionEntityTypeRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+dialogflow.googleapis.com/SessionEntityType2\xea\x14\n\x12SessionEntityTypes\x12\xc6\x03\n\x16ListSessionEntityTypes\x12\x39.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest\x1a:.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse\"\xb4\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xa4\x02\x12\x34/v2/{parent=projects/*/agent/sessions/*}/entityTypesZM\x12K/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypesZB\x12@/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypesZY\x12W/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes\x12\xb3\x03\n\x14GetSessionEntityType\x12\x37.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest\x1a-.google.cloud.dialogflow.v2.SessionEntityType\"\xb2\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xa4\x02\x12\x34/v2/{name=projects/*/agent/sessions/*/entityTypes/*}ZM\x12K/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}ZB\x12@/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}ZY\x12W/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}\x12\xa3\x04\n\x17\x43reateSessionEntityType\x12:.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest\x1a-.google.cloud.dialogflow.v2.SessionEntityType\"\x9c\x03\xda\x41\x1aparent,session_entity_type\x82\xd3\xe4\x93\x02\xf8\x02\"4/v2/{parent=projects/*/agent/sessions/*}/entityTypes:\x13session_entity_typeZb\"K/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes:\x13session_entity_typeZW\"@/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes:\x13session_entity_typeZn\"W/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes:\x13session_entity_type\x12\x8f\x05\n\x17UpdateSessionEntityType\x12:.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest\x1a-.google.cloud.dialogflow.v2.SessionEntityType\"\x88\x04\xda\x41\x13session_entity_type\xda\x41\x1fsession_entity_type,update_mask\x82\xd3\xe4\x93\x02\xc9\x03\x32H/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}:\x13session_entity_typeZv2_/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}:\x13session_entity_typeZk2T/v2/{session_entity_type.name=projects/*/locations/*/agent/sessions/*/entityTypes/*}:\x13session_entity_typeZ\x82\x01\x32k/v2/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}:\x13session_entity_type\x12\xa2\x03\n\x17\x44\x65leteSessionEntityType\x12:.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest\x1a\x16.google.protobuf.Empty\"\xb2\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xa4\x02*4/v2/{name=projects/*/agent/sessions/*/entityTypes/*}ZM*K/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}ZB*@/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}ZY*W/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9c\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x16SessionEntityTypeProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + SessionEntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SessionEntityType").msgclass + SessionEntityType::EntityOverrideMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode").enummodule + ListSessionEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListSessionEntityTypesRequest").msgclass + ListSessionEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListSessionEntityTypesResponse").msgclass + GetSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetSessionEntityTypeRequest").msgclass + CreateSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest").msgclass + UpdateSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest").msgclass + DeleteSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb new file mode 100644 index 000000000000..41a9ea6ba7fc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb @@ -0,0 +1,77 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/session_entity_type.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/session_entity_type_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module SessionEntityTypes + # Service for managing + # [SessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityType]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.SessionEntityTypes' + + # Returns the list of all session entity types in the specified session. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + rpc :ListSessionEntityTypes, ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse + # Retrieves the specified session entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + rpc :GetSessionEntityType, ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::SessionEntityType + # Creates a session entity type. + # + # If the specified session entity type already exists, overrides the session + # entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + rpc :CreateSessionEntityType, ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::SessionEntityType + # Updates the specified session entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + rpc :UpdateSessionEntityType, ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::SessionEntityType + # Deletes the specified session entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + rpc :DeleteSessionEntityType, ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types.rb new file mode 100644 index 000000000000..58adf508a177 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/session_entity_types/credentials" +require "google/cloud/dialogflow/v2/session_entity_types/paths" +require "google/cloud/dialogflow/v2/session_entity_types/client" +require "google/cloud/dialogflow/v2/session_entity_types/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/session_entity_types" + # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/session_entity_types/rest" + # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + module SessionEntityTypes + end + end + end + end +end + +helper_path = ::File.join __dir__, "session_entity_types", "helpers.rb" +require "google/cloud/dialogflow/v2/session_entity_types/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb new file mode 100644 index 000000000000..38325689aa25 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb @@ -0,0 +1,926 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/session_entity_type_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module SessionEntityTypes + ## + # Client for the SessionEntityTypes service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_entity_types_stub + + ## + # Configure the SessionEntityTypes Client class. + # + # See {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionEntityTypes clients + # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::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_entity_types_stub.universe_domain + end + + ## + # Create a new SessionEntityTypes client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionEntityTypes 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/dialogflow/v2/session_entity_type_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_entity_types_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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_entity_types_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_entity_types_stub.endpoint + config.universe_domain = @session_entity_types_stub.universe_domain + config.logger = @session_entity_types_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_entity_types_stub.logger + end + + # Service calls + + ## + # Returns the list of all session entity types in the specified session. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload list_session_entity_types(request, options = nil) + # Pass arguments to `list_session_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_session_entity_types(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_session_entity_types` via keyword arguments. Note that at + # least one keyword argument is 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 session to list all session entity types from. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users// + # sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new + # + # # Call the list_session_entity_types method. + # result = client.list_session_entity_types 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::Dialogflow::V2::SessionEntityType. + # p item + # end + # + def list_session_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest + + # Converts hash and nil to 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_session_entity_types.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_session_entity_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_session_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.call_rpc :list_session_entity_types, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @session_entity_types_stub, :list_session_entity_types, 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 + + ## + # Retrieves the specified session entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload get_session_entity_type(request, options = nil) + # Pass arguments to `get_session_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(name: nil) + # Pass arguments to `get_session_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To 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 session entity type. Format: + # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new + # + # # Call the get_session_entity_type method. + # result = client.get_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + # p result + # + def get_session_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest + + # Converts hash and nil to 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_session_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.call_rpc :get_session_entity_type, 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 entity type. + # + # If the specified session entity type already exists, overrides the session + # entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload create_session_entity_type(request, options = nil) + # Pass arguments to `create_session_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(parent: nil, session_entity_type: nil) + # Pass arguments to `create_session_entity_type` via keyword arguments. Note that at + # least one keyword argument is 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 session to create a session entity type for. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users// + # sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @param session_entity_type [::Google::Cloud::Dialogflow::V2::SessionEntityType, ::Hash] + # Required. The session entity type to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new + # + # # Call the create_session_entity_type method. + # result = client.create_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + # p result + # + def create_session_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest + + # Converts hash and nil to 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_session_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.call_rpc :create_session_entity_type, 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 the specified session entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload update_session_entity_type(request, options = nil) + # Pass arguments to `update_session_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(session_entity_type: nil, update_mask: nil) + # Pass arguments to `update_session_entity_type` via keyword arguments. Note that at + # least one keyword argument is 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_entity_type [::Google::Cloud::Dialogflow::V2::SessionEntityType, ::Hash] + # Required. The session entity type to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new + # + # # Call the update_session_entity_type method. + # result = client.update_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + # p result + # + def update_session_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest + + # Converts hash and nil to 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entity_type&.name + header_params["session_entity_type.name"] = request.session_entity_type.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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_session_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.call_rpc :update_session_entity_type, 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 specified session entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload delete_session_entity_type(request, options = nil) + # Pass arguments to `delete_session_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(name: nil) + # Pass arguments to `delete_session_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To 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 entity type to delete. Format: + # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new + # + # # Call the delete_session_entity_type method. + # result = client.delete_session_entity_type request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest + + # Converts hash and nil to 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_entity_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_session_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.call_rpc :delete_session_entity_type, 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 SessionEntityTypes API. + # + # This class represents the configuration for SessionEntityTypes, + # 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::Dialogflow::V2::SessionEntityTypes::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_session_entity_types to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_session_entity_types.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_session_entity_types.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::Dialogflow::V2::SessionEntityTypes::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 SessionEntityTypes 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_session_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_session_entity_types + ## + # RPC-specific configuration for `get_session_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session_entity_type + ## + # RPC-specific configuration for `create_session_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session_entity_type + ## + # RPC-specific configuration for `update_session_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session_entity_type + ## + # RPC-specific configuration for `delete_session_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session_entity_type + + # @private + def initialize parent_rpcs = nil + list_session_entity_types_config = parent_rpcs.list_session_entity_types if parent_rpcs.respond_to? :list_session_entity_types + @list_session_entity_types = ::Gapic::Config::Method.new list_session_entity_types_config + get_session_entity_type_config = parent_rpcs.get_session_entity_type if parent_rpcs.respond_to? :get_session_entity_type + @get_session_entity_type = ::Gapic::Config::Method.new get_session_entity_type_config + create_session_entity_type_config = parent_rpcs.create_session_entity_type if parent_rpcs.respond_to? :create_session_entity_type + @create_session_entity_type = ::Gapic::Config::Method.new create_session_entity_type_config + update_session_entity_type_config = parent_rpcs.update_session_entity_type if parent_rpcs.respond_to? :update_session_entity_type + @update_session_entity_type = ::Gapic::Config::Method.new update_session_entity_type_config + delete_session_entity_type_config = parent_rpcs.delete_session_entity_type if parent_rpcs.respond_to? :delete_session_entity_type + @delete_session_entity_type = ::Gapic::Config::Method.new delete_session_entity_type_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.rb new file mode 100644 index 000000000000..04cd06ceeddc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module SessionEntityTypes + # Credentials for the SessionEntityTypes API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb new file mode 100644 index 000000000000..21432a061adf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb @@ -0,0 +1,195 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module SessionEntityTypes + # Path helper methods for the SessionEntityTypes API. + module Paths + ## + # Create a fully-qualified Session resource string. + # + # @overload session_path(project:, session:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}` + # + # @param project [String] + # @param session [String] + # + # @overload session_path(project:, environment:, user:, session:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # + # @overload session_path(project:, location:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # + # @overload session_path(project:, location:, environment:, user:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # + # @return [::String] + def session_path **args + resources = { + "project:session" => (proc do |project:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}" + end), + "environment:project:session:user" => (proc do |project:, environment:, user:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}" + end), + "location:project:session" => (proc do |project:, location:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}" + end), + "environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/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 + + ## + # Create a fully-qualified SessionEntityType resource string. + # + # @overload session_entity_type_path(project:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, environment:, user:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, location:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, location:, environment:, user:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param entity_type [String] + # + # @return [::String] + def session_entity_type_path **args + resources = { + "entity_type:project:session" => (proc do |project:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}/entityTypes/#{entity_type}" + end), + "entity_type:environment:project:session:user" => (proc do |project:, environment:, user:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" + end), + "entity_type:location:project:session" => (proc do |project:, location:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}/entityTypes/#{entity_type}" + end), + "entity_type:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest.rb new file mode 100644 index 000000000000..90b414377df2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/session_entity_types/credentials" +require "google/cloud/dialogflow/v2/session_entity_types/paths" +require "google/cloud/dialogflow/v2/session_entity_types/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing + # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/session_entity_types/rest" + # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + module SessionEntityTypes + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/session_entity_types/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb new file mode 100644 index 000000000000..37386c595066 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb @@ -0,0 +1,856 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/session_entity_type_pb" +require "google/cloud/dialogflow/v2/session_entity_types/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module SessionEntityTypes + module Rest + ## + # REST client for the SessionEntityTypes service. + # + # Service for managing + # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :session_entity_types_stub + + ## + # Configure the SessionEntityTypes Client class. + # + # See {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SessionEntityTypes clients + # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::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_entity_types_stub.universe_domain + end + + ## + # Create a new SessionEntityTypes REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SessionEntityTypes 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_entity_types_stub = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @session_entity_types_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_entity_types_stub.endpoint + config.universe_domain = @session_entity_types_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @session_entity_types_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_entity_types_stub.logger + end + + # Service calls + + ## + # Returns the list of all session entity types in the specified session. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload list_session_entity_types(request, options = nil) + # Pass arguments to `list_session_entity_types` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_session_entity_types(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_session_entity_types` via keyword arguments. Note that at + # least one keyword argument is 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 session to list all session entity types from. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users// + # sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new + # + # # Call the list_session_entity_types method. + # result = client.list_session_entity_types 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::Dialogflow::V2::SessionEntityType. + # p item + # end + # + def list_session_entity_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest + + # Converts hash and nil to an 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_session_entity_types.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_session_entity_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_session_entity_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.list_session_entity_types request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @session_entity_types_stub, :list_session_entity_types, "session_entity_types", 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 + + ## + # Retrieves the specified session entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload get_session_entity_type(request, options = nil) + # Pass arguments to `get_session_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(name: nil) + # Pass arguments to `get_session_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To 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 session entity type. Format: + # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new + # + # # Call the get_session_entity_type method. + # result = client.get_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + # p result + # + def get_session_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest + + # Converts hash and nil to an 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_session_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.get_session_entity_type 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 entity type. + # + # If the specified session entity type already exists, overrides the session + # entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload create_session_entity_type(request, options = nil) + # Pass arguments to `create_session_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(parent: nil, session_entity_type: nil) + # Pass arguments to `create_session_entity_type` via keyword arguments. Note that at + # least one keyword argument is 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 session to create a session entity type for. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users// + # sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @param session_entity_type [::Google::Cloud::Dialogflow::V2::SessionEntityType, ::Hash] + # Required. The session entity type to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new + # + # # Call the create_session_entity_type method. + # result = client.create_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + # p result + # + def create_session_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest + + # Converts hash and nil to an 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_session_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.create_session_entity_type 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 the specified session entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload update_session_entity_type(request, options = nil) + # Pass arguments to `update_session_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(session_entity_type: nil, update_mask: nil) + # Pass arguments to `update_session_entity_type` via keyword arguments. Note that at + # least one keyword argument is 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_entity_type [::Google::Cloud::Dialogflow::V2::SessionEntityType, ::Hash] + # Required. The session entity type to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new + # + # # Call the update_session_entity_type method. + # result = client.update_session_entity_type request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + # p result + # + def update_session_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest + + # Converts hash and nil to an 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_session_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.update_session_entity_type 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 specified session entity type. + # + # This method doesn't work with Google Assistant integration. + # Contact Dialogflow support if you need to use session entities + # with Google Assistant integration. + # + # @overload delete_session_entity_type(request, options = nil) + # Pass arguments to `delete_session_entity_type` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_entity_type(name: nil) + # Pass arguments to `delete_session_entity_type` via keyword arguments. Note that at + # least one keyword argument is required. To 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 entity type to delete. Format: + # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new + # + # # Call the delete_session_entity_type method. + # result = client.delete_session_entity_type request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_session_entity_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest + + # Converts hash and nil to an 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_entity_type.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_session_entity_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @session_entity_types_stub.delete_session_entity_type 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 SessionEntityTypes REST API. + # + # This class represents the configuration for SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::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_session_entity_types to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_session_entity_types.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_session_entity_types.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 SessionEntityTypes 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_session_entity_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_session_entity_types + ## + # RPC-specific configuration for `get_session_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_session_entity_type + ## + # RPC-specific configuration for `create_session_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :create_session_entity_type + ## + # RPC-specific configuration for `update_session_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :update_session_entity_type + ## + # RPC-specific configuration for `delete_session_entity_type` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_session_entity_type + + # @private + def initialize parent_rpcs = nil + list_session_entity_types_config = parent_rpcs.list_session_entity_types if parent_rpcs.respond_to? :list_session_entity_types + @list_session_entity_types = ::Gapic::Config::Method.new list_session_entity_types_config + get_session_entity_type_config = parent_rpcs.get_session_entity_type if parent_rpcs.respond_to? :get_session_entity_type + @get_session_entity_type = ::Gapic::Config::Method.new get_session_entity_type_config + create_session_entity_type_config = parent_rpcs.create_session_entity_type if parent_rpcs.respond_to? :create_session_entity_type + @create_session_entity_type = ::Gapic::Config::Method.new create_session_entity_type_config + update_session_entity_type_config = parent_rpcs.update_session_entity_type if parent_rpcs.respond_to? :update_session_entity_type + @update_session_entity_type = ::Gapic::Config::Method.new update_session_entity_type_config + delete_session_entity_type_config = parent_rpcs.delete_session_entity_type if parent_rpcs.respond_to? :delete_session_entity_type + @delete_session_entity_type = ::Gapic::Config::Method.new delete_session_entity_type_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb new file mode 100644 index 000000000000..45160c65d7f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb @@ -0,0 +1,499 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/session_entity_type_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module SessionEntityTypes + module Rest + ## + # REST service stub for the SessionEntityTypes 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_session_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListSessionEntityTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse] + # A result object deserialized from the server's reply + def list_session_entity_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_session_entity_types_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_session_entity_types", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # A result object deserialized from the server's reply + def get_session_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_session_entity_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # A result object deserialized from the server's reply + def create_session_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_session_entity_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SessionEntityType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # A result object deserialized from the server's reply + def update_session_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_session_entity_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.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_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_entity_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_entity_type_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_entity_type", + 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_session_entity_types REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest] + # 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_session_entity_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/entityTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_session_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_session_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes", + body: "session_entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes", + body: "session_entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes", + body: "session_entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/entityTypes", + body: "session_entity_type", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_session_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{session_entity_type.name}", + body: "session_entity_type", + matches: [ + ["session_entity_type.name", %r{^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{session_entity_type.name}", + body: "session_entity_type", + matches: [ + ["session_entity_type.name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{session_entity_type.name}", + body: "session_entity_type", + matches: [ + ["session_entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{session_entity_type.name}", + body: "session_entity_type", + matches: [ + ["session_entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_session_entity_type REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest] + # 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_entity_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_pb.rb new file mode 100644 index 000000000000..58b3f3fd3a57 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_pb.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/session.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/dialogflow/v2/audio_config_pb' +require 'google/cloud/dialogflow/v2/context_pb' +require 'google/cloud/dialogflow/v2/intent_pb' +require 'google/cloud/dialogflow/v2/session_entity_type_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' +require 'google/rpc/status_pb' +require 'google/type/latlng_pb' + + +descriptor_data = "\n(google/cloud/dialogflow/v2/session.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a(google/cloud/dialogflow/v2/context.proto\x1a\'google/cloud/dialogflow/v2/intent.proto\x1a\x34google/cloud/dialogflow/v2/session_entity_type.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17google/rpc/status.proto\x1a\x18google/type/latlng.proto\"\xf5\x02\n\x13\x44\x65tectIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x41\n\x0cquery_params\x18\x02 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12@\n\x0bquery_input\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.v2.QueryInputB\x03\xe0\x41\x02\x12J\n\x13output_audio_config\x18\x04 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12<\n\x18output_audio_config_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x13\n\x0binput_audio\x18\x05 \x01(\x0c\"\xf8\x01\n\x14\x44\x65tectIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12=\n\x0cquery_result\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResult\x12*\n\x0ewebhook_status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0coutput_audio\x18\x04 \x01(\x0c\x12J\n\x13output_audio_config\x18\x06 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\"\x9f\x04\n\x0fQueryParameters\x12\x11\n\ttime_zone\x18\x01 \x01(\t\x12)\n\x0cgeo_location\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\x12\x35\n\x08\x63ontexts\x18\x03 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x16\n\x0ereset_contexts\x18\x04 \x01(\x08\x12K\n\x14session_entity_types\x18\x05 \x03(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\x12(\n\x07payload\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x65\n!sentiment_analysis_request_config\x18\n \x01(\x0b\x32:.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig\x12X\n\x0fwebhook_headers\x18\x0e \x03(\x0b\x32?.google.cloud.dialogflow.v2.QueryParameters.WebhookHeadersEntry\x12\x10\n\x08platform\x18\x12 \x01(\t\x1a\x35\n\x13WebhookHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcb\x01\n\nQueryInput\x12\x44\n\x0c\x61udio_config\x18\x01 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigH\x00\x12\x35\n\x04text\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputH\x00\x12\x37\n\x05\x65vent\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInputH\x00\x42\x07\n\x05input\"\xae\x05\n\x0bQueryResult\x12\x12\n\nquery_text\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12%\n\x1dspeech_recognition_confidence\x18\x02 \x01(\x02\x12\x0e\n\x06\x61\x63tion\x18\x03 \x01(\t\x12+\n\nparameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12#\n\x1b\x61ll_required_params_present\x18\x05 \x01(\x08\x12\x1c\n\x14\x63\x61ncels_slot_filling\x18\x15 \x01(\x08\x12\x18\n\x10\x66ulfillment_text\x18\x06 \x01(\t\x12H\n\x14\x66ulfillment_messages\x18\x07 \x03(\x0b\x32*.google.cloud.dialogflow.v2.Intent.Message\x12\x16\n\x0ewebhook_source\x18\x08 \x01(\t\x12\x30\n\x0fwebhook_payload\x18\t \x01(\x0b\x32\x17.google.protobuf.Struct\x12<\n\x0foutput_contexts\x18\n \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x32\n\x06intent\x18\x0b \x01(\x0b\x32\".google.cloud.dialogflow.v2.Intent\x12#\n\x1bintent_detection_confidence\x18\x0c \x01(\x02\x12\x30\n\x0f\x64iagnostic_info\x18\x0e \x01(\x0b\x32\x17.google.protobuf.Struct\x12V\n\x19sentiment_analysis_result\x18\x11 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SentimentAnalysisResult\"\xbb\x03\n\x1cStreamingDetectIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x41\n\x0cquery_params\x18\x02 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12@\n\x0bquery_input\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.v2.QueryInputB\x03\xe0\x41\x02\x12\x1c\n\x10single_utterance\x18\x04 \x01(\x08\x42\x02\x18\x01\x12J\n\x13output_audio_config\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12<\n\x18output_audio_config_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x13\n\x0binput_audio\x18\x06 \x01(\x0c\x12\x1d\n\x15\x65nable_debugging_info\x18\x08 \x01(\x08\"\xb0\x07\n\x1e\x43loudConversationDebuggingInfo\x12\x19\n\x11\x61udio_data_chunks\x18\x01 \x01(\x05\x12\x39\n\x16result_end_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14\x66irst_audio_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10single_utterance\x18\x05 \x01(\x08\x12\x43\n speech_partial_results_end_times\x18\x06 \x03(\x0b\x32\x19.google.protobuf.Duration\x12\x41\n\x1espeech_final_results_end_times\x18\x07 \x03(\x0b\x32\x19.google.protobuf.Duration\x12\x19\n\x11partial_responses\x18\x08 \x01(\x05\x12,\n$speaker_id_passive_latency_ms_offset\x18\t \x01(\x05\x12\x1f\n\x17\x62\x61rgein_event_triggered\x18\n \x01(\x08\x12\x1f\n\x17speech_single_utterance\x18\x0b \x01(\x08\x12=\n\x1a\x64tmf_partial_results_times\x18\x0c \x03(\x0b\x32\x19.google.protobuf.Duration\x12;\n\x18\x64tmf_final_results_times\x18\r \x03(\x0b\x32\x19.google.protobuf.Duration\x12\x43\n single_utterance_end_time_offset\x18\x0e \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x11no_speech_timeout\x18\x0f \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x36\n\x13\x65ndpointing_timeout\x18\x13 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\ris_input_text\x18\x10 \x01(\x08\x12@\n\x1d\x63lient_half_close_time_offset\x18\x11 \x01(\x0b\x32\x19.google.protobuf.Duration\x12J\n\'client_half_close_streaming_time_offset\x18\x12 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xa9\x03\n\x1dStreamingDetectIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12R\n\x12recognition_result\x18\x02 \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.StreamingRecognitionResult\x12=\n\x0cquery_result\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResult\x12*\n\x0ewebhook_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0coutput_audio\x18\x05 \x01(\x0c\x12J\n\x13output_audio_config\x18\x06 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12R\n\x0e\x64\x65\x62ugging_info\x18\x08 \x01(\x0b\x32:.google.cloud.dialogflow.v2.CloudConversationDebuggingInfo\"\x9d\x03\n\x1aStreamingRecognitionResult\x12X\n\x0cmessage_type\x18\x01 \x01(\x0e\x32\x42.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType\x12\x12\n\ntranscript\x18\x02 \x01(\t\x12\x10\n\x08is_final\x18\x03 \x01(\x08\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x44\n\x10speech_word_info\x18\x07 \x03(\x0b\x32*.google.cloud.dialogflow.v2.SpeechWordInfo\x12\x34\n\x11speech_end_offset\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rlanguage_code\x18\n \x01(\t\"X\n\x0bMessageType\x12\x1c\n\x18MESSAGE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nTRANSCRIPT\x10\x01\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x02\":\n\tTextInput\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\"h\n\nEventInput\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12+\n\nparameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\"F\n\x1eSentimentAnalysisRequestConfig\x12$\n\x1c\x61nalyze_query_text_sentiment\x18\x01 \x01(\x08\"^\n\x17SentimentAnalysisResult\x12\x43\n\x14query_text_sentiment\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.v2.Sentiment\"-\n\tSentiment\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02\x32\xe5\x05\n\x08Sessions\x12\xc9\x03\n\x0c\x44\x65tectIntent\x12/.google.cloud.dialogflow.v2.DetectIntentRequest\x1a\x30.google.cloud.dialogflow.v2.DetectIntentResponse\"\xd5\x02\xda\x41\x13session,query_input\x82\xd3\xe4\x93\x02\xb8\x02\"6/v2/{session=projects/*/agent/sessions/*}:detectIntent:\x01*ZR\"M/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent:\x01*ZG\"B/v2/{session=projects/*/locations/*/agent/sessions/*}:detectIntent:\x01*Z^\"Y/v2/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent:\x01*\x12\x92\x01\n\x15StreamingDetectIntent\x12\x38.google.cloud.dialogflow.v2.StreamingDetectIntentRequest\x1a\x39.google.cloud.dialogflow.v2.StreamingDetectIntentResponse\"\x00(\x01\x30\x01\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xe7\x03\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cSessionProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\xd1\x02\n!dialogflow.googleapis.com/Session\x12+projects/{project}/agent/sessions/{session}\x12Sprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}\x12@projects/{project}/locations/{location}/agent/sessions/{session}\x12hprojects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + DetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DetectIntentRequest").msgclass + DetectIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DetectIntentResponse").msgclass + QueryParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.QueryParameters").msgclass + QueryInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.QueryInput").msgclass + QueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.QueryResult").msgclass + StreamingDetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingDetectIntentRequest").msgclass + CloudConversationDebuggingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CloudConversationDebuggingInfo").msgclass + StreamingDetectIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingDetectIntentResponse").msgclass + StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingRecognitionResult").msgclass + StreamingRecognitionResult::MessageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType").enummodule + TextInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TextInput").msgclass + EventInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EventInput").msgclass + SentimentAnalysisRequestConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig").msgclass + SentimentAnalysisResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SentimentAnalysisResult").msgclass + Sentiment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Sentiment").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_services_pb.rb new file mode 100644 index 000000000000..bb5ba0443bf7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_services_pb.rb @@ -0,0 +1,77 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/session.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/session_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Sessions + # A service used for session interactions. + # + # For more information, see the [API interactions + # guide](https://cloud.google.com/dialogflow/docs/api-overview). + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Sessions' + + # Processes a natural language query and returns structured, actionable data + # as a result. This method is not idempotent, because it may cause contexts + # and session entity types to be updated, which in turn might affect + # results of future queries. + # + # If you might use + # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + # or other CCAI products now or in the future, consider using + # [AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + # instead of `DetectIntent`. `AnalyzeContent` has additional + # functionality for Agent Assist and other CCAI products. + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + rpc :DetectIntent, ::Google::Cloud::Dialogflow::V2::DetectIntentRequest, ::Google::Cloud::Dialogflow::V2::DetectIntentResponse + # Processes a natural language query in audio format in a streaming fashion + # and returns structured, actionable data as a result. This method is only + # available via the gRPC API (not REST). + # + # If you might use + # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + # or other CCAI products now or in the future, consider using + # [StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + # instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has + # additional functionality for Agent Assist and other CCAI products. + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + rpc :StreamingDetectIntent, stream(::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest), stream(::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse) + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions.rb new file mode 100644 index 000000000000..e7878c3ba995 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/sessions/credentials" +require "google/cloud/dialogflow/v2/sessions/paths" +require "google/cloud/dialogflow/v2/sessions/client" +require "google/cloud/dialogflow/v2/sessions/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # A service used for session interactions. + # + # For more information, see the [API interactions + # guide](https://cloud.google.com/dialogflow/docs/api-overview). + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/sessions" + # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/sessions/rest" + # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new + # + module Sessions + end + end + end + end +end + +helper_path = ::File.join __dir__, "sessions", "helpers.rb" +require "google/cloud/dialogflow/v2/sessions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb new file mode 100644 index 000000000000..d8473dfc5199 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb @@ -0,0 +1,663 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/session_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Sessions + ## + # Client for the Sessions service. + # + # A service used for session interactions. + # + # For more information, see the [API interactions + # guide](https://cloud.google.com/dialogflow/docs/api-overview). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :sessions_stub + + ## + # Configure the Sessions Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Sessions::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Sessions clients + # ::Google::Cloud::Dialogflow::V2::Sessions::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.detect_intent.timeout = 220.0 + default_config.rpcs.detect_intent.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.streaming_detect_intent.timeout = 220.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Sessions 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::Dialogflow::V2::Sessions::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 + @sessions_stub.universe_domain + end + + ## + # Create a new Sessions client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Sessions 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/dialogflow/v2/session_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 + + @sessions_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Sessions::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 + ) + + @sessions_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 = @sessions_stub.endpoint + config.universe_domain = @sessions_stub.universe_domain + config.logger = @sessions_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 + @sessions_stub.logger + end + + # Service calls + + ## + # Processes a natural language query and returns structured, actionable data + # as a result. This method is not idempotent, because it may cause contexts + # and session entity types to be updated, which in turn might affect + # results of future queries. + # + # If you might use + # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + # or other CCAI products now or in the future, consider using + # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content AnalyzeContent} + # instead of `DetectIntent`. `AnalyzeContent` has additional + # functionality for Agent Assist and other CCAI products. + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # + # @overload detect_intent(request, options = nil) + # Pass arguments to `detect_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DetectIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, output_audio_config_mask: nil, input_audio: nil) + # Pass arguments to `detect_intent` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The name of the session this query is sent to. Format: + # `projects//agent/sessions/`, or + # `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + # default 'draft' environment (`Environment ID` might be referred to as + # environment name at some places). If `User ID` is not specified, we are + # using "-". It's up to the API caller to choose an appropriate `Session ID` + # and `User Id`. They can be a random number or some type of user and session + # identifiers (preferably hashed). The length of the `Session ID` and + # `User ID` must not exceed 36 characters. + # + # For more information, see the [API interactions + # guide](https://cloud.google.com/dialogflow/docs/api-overview). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash] + # The parameters of this query. + # @param query_input [::Google::Cloud::Dialogflow::V2::QueryInput, ::Hash] + # Required. The input specification. It can be set to: + # + # 1. an audio config which instructs the speech recognizer how to process + # the speech audio, + # + # 2. a conversational query in the form of text, or + # + # 3. an event that specifies which intent to trigger. + # @param output_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash] + # Instructs the speech synthesizer how to generate the output + # audio. If this field is not set and agent-level speech synthesizer is not + # configured, no output audio is generated. + # @param output_audio_config_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask for + # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} + # indicating which settings in this request-level config should override + # speech synthesizer settings defined at agent-level. + # + # If unspecified or empty, + # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} + # replaces the agent-level config in its entirety. + # @param input_audio [::String] + # The natural language speech audio to be processed. This field + # should be populated iff `query_input` is set to an input audio config. + # A single request can contain up to 1 minute of speech audio data. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Sessions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DetectIntentRequest.new + # + # # Call the detect_intent method. + # result = client.detect_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::DetectIntentResponse. + # p result + # + def detect_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DetectIntentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.detect_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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 + header_params["session"] = request.session + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.detect_intent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.detect_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.call_rpc :detect_intent, 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 + + ## + # Processes a natural language query in audio format in a streaming fashion + # and returns structured, actionable data as a result. This method is only + # available via the gRPC API (not REST). + # + # If you might use + # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + # or other CCAI products now or in the future, consider using + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content StreamingAnalyzeContent} + # instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has + # additional functionality for Agent Assist and other CCAI products. + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest} 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::Dialogflow::V2::StreamingDetectIntentResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Sessions::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the streaming_detect_intent method to start streaming. + # output = client.streaming_detect_intent 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::Dialogflow::V2::StreamingDetectIntentRequest.new + # input << Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse + # output.each do |current_response| + # p current_response + # end + # + def streaming_detect_intent 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::Dialogflow::V2::StreamingDetectIntentRequest + 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.streaming_detect_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::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.streaming_detect_intent.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_detect_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.call_rpc :streaming_detect_intent, 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 Sessions API. + # + # This class represents the configuration for Sessions, + # 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::Dialogflow::V2::Sessions::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 + # # detect_intent to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Sessions::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.detect_intent.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.detect_intent.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::Dialogflow::V2::Sessions::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Sessions 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `detect_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :detect_intent + ## + # RPC-specific configuration for `streaming_detect_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_detect_intent + + # @private + def initialize parent_rpcs = nil + detect_intent_config = parent_rpcs.detect_intent if parent_rpcs.respond_to? :detect_intent + @detect_intent = ::Gapic::Config::Method.new detect_intent_config + streaming_detect_intent_config = parent_rpcs.streaming_detect_intent if parent_rpcs.respond_to? :streaming_detect_intent + @streaming_detect_intent = ::Gapic::Config::Method.new streaming_detect_intent_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/credentials.rb new file mode 100644 index 000000000000..719484c5b734 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Sessions + # Credentials for the Sessions API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/paths.rb new file mode 100644 index 000000000000..39fd39c82662 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/paths.rb @@ -0,0 +1,299 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module Sessions + # Path helper methods for the Sessions API. + module Paths + ## + # Create a fully-qualified Context resource string. + # + # @overload context_path(project:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # @param context [String] + # + # @overload context_path(project:, location:, environment:, user:, session:, context:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param context [String] + # + # @return [::String] + def context_path **args + resources = { + "context:project:session" => (proc do |project:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + end), + "context:location:project:session" => (proc do |project:, location:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" + end), + "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" + 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 PhraseSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + # + # @param project [String] + # @param location [String] + # @param phrase_set [String] + # + # @return [::String] + def phrase_set_path project:, location:, phrase_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" + end + + ## + # Create a fully-qualified Session resource string. + # + # @overload session_path(project:, session:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}` + # + # @param project [String] + # @param session [String] + # + # @overload session_path(project:, environment:, user:, session:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # + # @overload session_path(project:, location:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # + # @overload session_path(project:, location:, environment:, user:, session:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # + # @return [::String] + def session_path **args + resources = { + "project:session" => (proc do |project:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}" + end), + "environment:project:session:user" => (proc do |project:, environment:, user:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}" + end), + "location:project:session" => (proc do |project:, location:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}" + end), + "environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/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 + + ## + # Create a fully-qualified SessionEntityType resource string. + # + # @overload session_entity_type_path(project:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, environment:, user:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, location:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param session [String] + # @param entity_type [String] + # + # @overload session_entity_type_path(project:, location:, environment:, user:, session:, entity_type:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` + # + # @param project [String] + # @param location [String] + # @param environment [String] + # @param user [String] + # @param session [String] + # @param entity_type [String] + # + # @return [::String] + def session_entity_type_path **args + resources = { + "entity_type:project:session" => (proc do |project:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/sessions/#{session}/entityTypes/#{entity_type}" + end), + "entity_type:environment:project:session:user" => (proc do |project:, environment:, user:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" + end), + "entity_type:location:project:session" => (proc do |project:, location:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/sessions/#{session}/entityTypes/#{entity_type}" + end), + "entity_type:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, entity_type:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest.rb new file mode 100644 index 000000000000..a54dfd0aa54d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest.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/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/sessions/credentials" +require "google/cloud/dialogflow/v2/sessions/paths" +require "google/cloud/dialogflow/v2/sessions/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # A service used for session interactions. + # + # For more information, see the [API interactions + # guide](https://cloud.google.com/dialogflow/docs/api-overview). + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/sessions/rest" + # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new + # + module Sessions + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/sessions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb new file mode 100644 index 000000000000..9eecf6c3ffb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb @@ -0,0 +1,521 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/session_pb" +require "google/cloud/dialogflow/v2/sessions/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Sessions + module Rest + ## + # REST client for the Sessions service. + # + # A service used for session interactions. + # + # For more information, see the [API interactions + # guide](https://cloud.google.com/dialogflow/docs/api-overview). + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :sessions_stub + + ## + # Configure the Sessions Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Sessions clients + # ::Google::Cloud::Dialogflow::V2::Sessions::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.detect_intent.timeout = 220.0 + default_config.rpcs.detect_intent.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Sessions 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::Dialogflow::V2::Sessions::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 + @sessions_stub.universe_domain + end + + ## + # Create a new Sessions REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Sessions 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 + + @sessions_stub = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @sessions_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 = @sessions_stub.endpoint + config.universe_domain = @sessions_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @sessions_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 + @sessions_stub.logger + end + + # Service calls + + ## + # Processes a natural language query and returns structured, actionable data + # as a result. This method is not idempotent, because it may cause contexts + # and session entity types to be updated, which in turn might affect + # results of future queries. + # + # If you might use + # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) + # or other CCAI products now or in the future, consider using + # {::Google::Cloud::Dialogflow::V2::Participants::Rest::Client#analyze_content AnalyzeContent} + # instead of `DetectIntent`. `AnalyzeContent` has additional + # functionality for Agent Assist and other CCAI products. + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # + # @overload detect_intent(request, options = nil) + # Pass arguments to `detect_intent` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DetectIntentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, output_audio_config_mask: nil, input_audio: nil) + # Pass arguments to `detect_intent` via keyword arguments. Note that at + # least one keyword argument is 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 [::String] + # Required. The name of the session this query is sent to. Format: + # `projects//agent/sessions/`, or + # `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + # default 'draft' environment (`Environment ID` might be referred to as + # environment name at some places). If `User ID` is not specified, we are + # using "-". It's up to the API caller to choose an appropriate `Session ID` + # and `User Id`. They can be a random number or some type of user and session + # identifiers (preferably hashed). The length of the `Session ID` and + # `User ID` must not exceed 36 characters. + # + # For more information, see the [API interactions + # guide](https://cloud.google.com/dialogflow/docs/api-overview). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash] + # The parameters of this query. + # @param query_input [::Google::Cloud::Dialogflow::V2::QueryInput, ::Hash] + # Required. The input specification. It can be set to: + # + # 1. an audio config which instructs the speech recognizer how to process + # the speech audio, + # + # 2. a conversational query in the form of text, or + # + # 3. an event that specifies which intent to trigger. + # @param output_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash] + # Instructs the speech synthesizer how to generate the output + # audio. If this field is not set and agent-level speech synthesizer is not + # configured, no output audio is generated. + # @param output_audio_config_mask [::Google::Protobuf::FieldMask, ::Hash] + # Mask for + # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} + # indicating which settings in this request-level config should override + # speech synthesizer settings defined at agent-level. + # + # If unspecified or empty, + # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} + # replaces the agent-level config in its entirety. + # @param input_audio [::String] + # The natural language speech audio to be processed. This field + # should be populated iff `query_input` is set to an input audio config. + # A single request can contain up to 1 minute of speech audio data. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DetectIntentRequest.new + # + # # Call the detect_intent method. + # result = client.detect_intent request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::DetectIntentResponse. + # p result + # + def detect_intent request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DetectIntentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.detect_intent.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.detect_intent.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.detect_intent.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sessions_stub.detect_intent 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 Sessions REST API. + # + # This class represents the configuration for Sessions 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::Dialogflow::V2::Sessions::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 + # # detect_intent to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.detect_intent.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.detect_intent.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Sessions 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `detect_intent` + # @return [::Gapic::Config::Method] + # + attr_reader :detect_intent + + # @private + def initialize parent_rpcs = nil + detect_intent_config = parent_rpcs.detect_intent if parent_rpcs.respond_to? :detect_intent + @detect_intent = ::Gapic::Config::Method.new detect_intent_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb new file mode 100644 index 000000000000..57eddd51008a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb @@ -0,0 +1,167 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/session_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Sessions + module Rest + ## + # REST service stub for the Sessions 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 detect_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DetectIntentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::DetectIntentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] + # A result object deserialized from the server's reply + def detect_intent request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_detect_intent_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "detect_intent", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::DetectIntentResponse.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 detect_intent REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DetectIntentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_detect_intent_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{session}:detectIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{session}:detectIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{session}:detectIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{session}:detectIntent", + body: "*", + matches: [ + ["session", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_pb.rb new file mode 100644 index 000000000000..86c669511b75 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_pb.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/sip_trunk.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/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/cloud/dialogflow/v2/sip_trunk.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x91\x01\n\x15\x43reateSipTrunkRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/SipTrunk\x12<\n\tsip_trunk\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.v2.SipTrunkB\x03\xe0\x41\x02\"Q\n\x15\x44\x65leteSipTrunkRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/SipTrunk\"\x83\x01\n\x14ListSipTrunksRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/SipTrunk\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\"j\n\x15ListSipTrunksResponse\x12\x38\n\nsip_trunks\x18\x01 \x03(\x0b\x32$.google.cloud.dialogflow.v2.SipTrunk\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x12GetSipTrunkRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/SipTrunk\"\x8b\x01\n\x15UpdateSipTrunkRequest\x12<\n\tsip_trunk\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.v2.SipTrunkB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x96\x02\n\x08SipTrunk\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1e\n\x11\x65xpected_hostname\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12@\n\x0b\x63onnections\x18\x03 \x03(\x0b\x32&.google.cloud.dialogflow.v2.ConnectionB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01:z\xea\x41w\n\"dialogflow.googleapis.com/SipTrunk\x12\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v2/{parent=projects/*/locations/*}/sipTrunks\x12\xa1\x01\n\x0bGetSipTrunk\x12..google.cloud.dialogflow.v2.GetSipTrunkRequest\x1a$.google.cloud.dialogflow.v2.SipTrunk\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v2/{name=projects/*/locations/*/sipTrunks/*}\x12\xcd\x01\n\x0eUpdateSipTrunk\x12\x31.google.cloud.dialogflow.v2.UpdateSipTrunkRequest\x1a$.google.cloud.dialogflow.v2.SipTrunk\"b\xda\x41\x15sip_trunk,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x37/v2/{sip_trunk.name=projects/*/locations/*/sipTrunks/*}:\tsip_trunk\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x93\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\rSipTrunkProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + CreateSipTrunkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateSipTrunkRequest").msgclass + DeleteSipTrunkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteSipTrunkRequest").msgclass + ListSipTrunksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListSipTrunksRequest").msgclass + ListSipTrunksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListSipTrunksResponse").msgclass + GetSipTrunkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetSipTrunkRequest").msgclass + UpdateSipTrunkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateSipTrunkRequest").msgclass + SipTrunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SipTrunk").msgclass + Connection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Connection").msgclass + Connection::ErrorDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Connection.ErrorDetails").msgclass + Connection::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Connection.State").enummodule + Connection::CertificateState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Connection.CertificateState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_services_pb.rb new file mode 100644 index 000000000000..1ae92b63af91 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_services_pb.rb @@ -0,0 +1,53 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/sip_trunk.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/sip_trunk_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module SipTrunks + # Service for managing [SipTrunks][google.cloud.dialogflow.v2.SipTrunk]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.SipTrunks' + + # Creates a SipTrunk for a specified location. + rpc :CreateSipTrunk, ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest, ::Google::Cloud::Dialogflow::V2::SipTrunk + # Deletes a specified SipTrunk. + rpc :DeleteSipTrunk, ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest, ::Google::Protobuf::Empty + # Returns a list of SipTrunks in the specified location. + rpc :ListSipTrunks, ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest, ::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse + # Retrieves the specified SipTrunk. + rpc :GetSipTrunk, ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest, ::Google::Cloud::Dialogflow::V2::SipTrunk + # Updates the specified SipTrunk. + rpc :UpdateSipTrunk, ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest, ::Google::Cloud::Dialogflow::V2::SipTrunk + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks.rb new file mode 100644 index 000000000000..cf2b2e46636c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/sip_trunks/credentials" +require "google/cloud/dialogflow/v2/sip_trunks/paths" +require "google/cloud/dialogflow/v2/sip_trunks/client" +require "google/cloud/dialogflow/v2/sip_trunks/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::SipTrunk SipTrunks}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/sip_trunks" + # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/sip_trunks/rest" + # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new + # + module SipTrunks + end + end + end + end +end + +helper_path = ::File.join __dir__, "sip_trunks", "helpers.rb" +require "google/cloud/dialogflow/v2/sip_trunks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/client.rb new file mode 100644 index 000000000000..c4085a591b93 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/client.rb @@ -0,0 +1,887 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/sip_trunk_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module SipTrunks + ## + # Client for the SipTrunks service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::SipTrunk SipTrunks}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :sip_trunks_stub + + ## + # Configure the SipTrunks Client class. + # + # See {::Google::Cloud::Dialogflow::V2::SipTrunks::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SipTrunks clients + # ::Google::Cloud::Dialogflow::V2::SipTrunks::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SipTrunks 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::Dialogflow::V2::SipTrunks::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 + @sip_trunks_stub.universe_domain + end + + ## + # Create a new SipTrunks client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SipTrunks 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/dialogflow/v2/sip_trunk_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 + + @sip_trunks_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::SipTrunks::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 + ) + + @sip_trunks_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 = @sip_trunks_stub.endpoint + config.universe_domain = @sip_trunks_stub.universe_domain + config.logger = @sip_trunks_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 + @sip_trunks_stub.logger + end + + # Service calls + + ## + # Creates a SipTrunk for a specified location. + # + # @overload create_sip_trunk(request, options = nil) + # Pass arguments to `create_sip_trunk` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunk(parent: nil, sip_trunk: nil) + # Pass arguments to `create_sip_trunk` via keyword arguments. Note that at + # least one keyword argument is 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 location to create a SIP trunk for. + # Format: `projects//locations/`. + # @param sip_trunk [::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash] + # Required. The SIP trunk to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SipTrunk] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new + # + # # Call the create_sip_trunk method. + # result = client.create_sip_trunk request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. + # p result + # + def create_sip_trunk request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest + + # Converts hash and nil to 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_sip_trunk.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_sip_trunk.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_sip_trunk.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.call_rpc :create_sip_trunk, 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 specified SipTrunk. + # + # @overload delete_sip_trunk(request, options = nil) + # Pass arguments to `delete_sip_trunk` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunk(name: nil) + # Pass arguments to `delete_sip_trunk` via keyword arguments. Note that at + # least one keyword argument is required. To 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 SIP trunk to delete. + # Format: `projects//locations//sipTrunks/`. + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new + # + # # Call the delete_sip_trunk method. + # result = client.delete_sip_trunk request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_sip_trunk request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest + + # Converts hash and nil to 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_sip_trunk.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_sip_trunk.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_sip_trunk.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.call_rpc :delete_sip_trunk, 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 + + ## + # Returns a list of SipTrunks in the specified location. + # + # @overload list_sip_trunks(request, options = nil) + # Pass arguments to `list_sip_trunks` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunks(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_sip_trunks` via keyword arguments. Note that at + # least one keyword argument is 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 location to list SIP trunks from. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.new + # + # # Call the list_sip_trunks method. + # result = client.list_sip_trunks 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::Dialogflow::V2::SipTrunk. + # p item + # end + # + def list_sip_trunks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest + + # Converts hash and nil to 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_sip_trunks.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_sip_trunks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sip_trunks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.call_rpc :list_sip_trunks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @sip_trunks_stub, :list_sip_trunks, 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 + + ## + # Retrieves the specified SipTrunk. + # + # @overload get_sip_trunk(request, options = nil) + # Pass arguments to `get_sip_trunk` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunk(name: nil) + # Pass arguments to `get_sip_trunk` via keyword arguments. Note that at + # least one keyword argument is required. To 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 SIP trunk to delete. + # Format: `projects//locations//sipTrunks/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SipTrunk] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new + # + # # Call the get_sip_trunk method. + # result = client.get_sip_trunk request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. + # p result + # + def get_sip_trunk request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest + + # Converts hash and nil to 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_sip_trunk.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_sip_trunk.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_sip_trunk.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.call_rpc :get_sip_trunk, 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 the specified SipTrunk. + # + # @overload update_sip_trunk(request, options = nil) + # Pass arguments to `update_sip_trunk` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunk(sip_trunk: nil, update_mask: nil) + # Pass arguments to `update_sip_trunk` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param sip_trunk [::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash] + # Required. The SipTrunk to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. If the mask is not + # present, all fields will be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::SipTrunk] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new + # + # # Call the update_sip_trunk method. + # result = client.update_sip_trunk request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. + # p result + # + def update_sip_trunk request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest + + # Converts hash and nil to 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_sip_trunk.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.sip_trunk&.name + header_params["sip_trunk.name"] = request.sip_trunk.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_sip_trunk.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_sip_trunk.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.call_rpc :update_sip_trunk, 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 SipTrunks API. + # + # This class represents the configuration for SipTrunks, + # 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::Dialogflow::V2::SipTrunks::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_sip_trunk to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_sip_trunk.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_sip_trunk.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::Dialogflow::V2::SipTrunks::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 SipTrunks 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_sip_trunk` + # @return [::Gapic::Config::Method] + # + attr_reader :create_sip_trunk + ## + # RPC-specific configuration for `delete_sip_trunk` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_sip_trunk + ## + # RPC-specific configuration for `list_sip_trunks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sip_trunks + ## + # RPC-specific configuration for `get_sip_trunk` + # @return [::Gapic::Config::Method] + # + attr_reader :get_sip_trunk + ## + # RPC-specific configuration for `update_sip_trunk` + # @return [::Gapic::Config::Method] + # + attr_reader :update_sip_trunk + + # @private + def initialize parent_rpcs = nil + create_sip_trunk_config = parent_rpcs.create_sip_trunk if parent_rpcs.respond_to? :create_sip_trunk + @create_sip_trunk = ::Gapic::Config::Method.new create_sip_trunk_config + delete_sip_trunk_config = parent_rpcs.delete_sip_trunk if parent_rpcs.respond_to? :delete_sip_trunk + @delete_sip_trunk = ::Gapic::Config::Method.new delete_sip_trunk_config + list_sip_trunks_config = parent_rpcs.list_sip_trunks if parent_rpcs.respond_to? :list_sip_trunks + @list_sip_trunks = ::Gapic::Config::Method.new list_sip_trunks_config + get_sip_trunk_config = parent_rpcs.get_sip_trunk if parent_rpcs.respond_to? :get_sip_trunk + @get_sip_trunk = ::Gapic::Config::Method.new get_sip_trunk_config + update_sip_trunk_config = parent_rpcs.update_sip_trunk if parent_rpcs.respond_to? :update_sip_trunk + @update_sip_trunk = ::Gapic::Config::Method.new update_sip_trunk_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/credentials.rb new file mode 100644 index 000000000000..2364ac38eac9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module SipTrunks + # Credentials for the SipTrunks API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/paths.rb new file mode 100644 index 000000000000..e3f7d2ffa2d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module SipTrunks + # Path helper methods for the SipTrunks API. + module Paths + ## + # 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 SipTrunk resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sipTrunks/{siptrunk}` + # + # @param project [String] + # @param location [String] + # @param siptrunk [String] + # + # @return [::String] + def sip_trunk_path project:, location:, siptrunk: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sipTrunks/#{siptrunk}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest.rb new file mode 100644 index 000000000000..7e01c1fc35b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/sip_trunks/credentials" +require "google/cloud/dialogflow/v2/sip_trunks/paths" +require "google/cloud/dialogflow/v2/sip_trunks/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::SipTrunk SipTrunks}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/sip_trunks/rest" + # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new + # + module SipTrunks + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/sip_trunks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/client.rb new file mode 100644 index 000000000000..b9188fa28bdd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/client.rb @@ -0,0 +1,817 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/sip_trunk_pb" +require "google/cloud/dialogflow/v2/sip_trunks/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module SipTrunks + module Rest + ## + # REST client for the SipTrunks service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::SipTrunk SipTrunks}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :sip_trunks_stub + + ## + # Configure the SipTrunks Client class. + # + # See {::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SipTrunks clients + # ::Google::Cloud::Dialogflow::V2::SipTrunks::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SipTrunks 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::Dialogflow::V2::SipTrunks::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 + @sip_trunks_stub.universe_domain + end + + ## + # Create a new SipTrunks REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SipTrunks 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 + + @sip_trunks_stub = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @sip_trunks_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 = @sip_trunks_stub.endpoint + config.universe_domain = @sip_trunks_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @sip_trunks_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 + @sip_trunks_stub.logger + end + + # Service calls + + ## + # Creates a SipTrunk for a specified location. + # + # @overload create_sip_trunk(request, options = nil) + # Pass arguments to `create_sip_trunk` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunk(parent: nil, sip_trunk: nil) + # Pass arguments to `create_sip_trunk` via keyword arguments. Note that at + # least one keyword argument is 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 location to create a SIP trunk for. + # Format: `projects//locations/`. + # @param sip_trunk [::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash] + # Required. The SIP trunk to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SipTrunk] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new + # + # # Call the create_sip_trunk method. + # result = client.create_sip_trunk request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. + # p result + # + def create_sip_trunk request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest + + # Converts hash and nil to an 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_sip_trunk.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_sip_trunk.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_sip_trunk.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.create_sip_trunk 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 specified SipTrunk. + # + # @overload delete_sip_trunk(request, options = nil) + # Pass arguments to `delete_sip_trunk` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunk(name: nil) + # Pass arguments to `delete_sip_trunk` via keyword arguments. Note that at + # least one keyword argument is required. To 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 SIP trunk to delete. + # Format: `projects//locations//sipTrunks/`. + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new + # + # # Call the delete_sip_trunk method. + # result = client.delete_sip_trunk request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_sip_trunk request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest + + # Converts hash and nil to an 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_sip_trunk.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_sip_trunk.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_sip_trunk.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.delete_sip_trunk 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 + + ## + # Returns a list of SipTrunks in the specified location. + # + # @overload list_sip_trunks(request, options = nil) + # Pass arguments to `list_sip_trunks` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunks(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_sip_trunks` via keyword arguments. Note that at + # least one keyword argument is 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 location to list SIP trunks from. + # Format: `projects//locations/`. + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.new + # + # # Call the list_sip_trunks method. + # result = client.list_sip_trunks 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::Dialogflow::V2::SipTrunk. + # p item + # end + # + def list_sip_trunks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest + + # Converts hash and nil to an 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_sip_trunks.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_sip_trunks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sip_trunks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.list_sip_trunks request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @sip_trunks_stub, :list_sip_trunks, "sip_trunks", 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 + + ## + # Retrieves the specified SipTrunk. + # + # @overload get_sip_trunk(request, options = nil) + # Pass arguments to `get_sip_trunk` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunk(name: nil) + # Pass arguments to `get_sip_trunk` via keyword arguments. Note that at + # least one keyword argument is required. To 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 SIP trunk to delete. + # Format: `projects//locations//sipTrunks/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SipTrunk] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new + # + # # Call the get_sip_trunk method. + # result = client.get_sip_trunk request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. + # p result + # + def get_sip_trunk request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest + + # Converts hash and nil to an 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_sip_trunk.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_sip_trunk.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_sip_trunk.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.get_sip_trunk 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 the specified SipTrunk. + # + # @overload update_sip_trunk(request, options = nil) + # Pass arguments to `update_sip_trunk` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sip_trunk(sip_trunk: nil, update_mask: nil) + # Pass arguments to `update_sip_trunk` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param sip_trunk [::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash] + # Required. The SipTrunk to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The mask to control which fields get updated. If the mask is not + # present, all fields will be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::SipTrunk] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new + # + # # Call the update_sip_trunk method. + # result = client.update_sip_trunk request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. + # p result + # + def update_sip_trunk request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest + + # Converts hash and nil to an 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_sip_trunk.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_sip_trunk.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_sip_trunk.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @sip_trunks_stub.update_sip_trunk 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 SipTrunks REST API. + # + # This class represents the configuration for SipTrunks 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::Dialogflow::V2::SipTrunks::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_sip_trunk to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_sip_trunk.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_sip_trunk.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 SipTrunks 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_sip_trunk` + # @return [::Gapic::Config::Method] + # + attr_reader :create_sip_trunk + ## + # RPC-specific configuration for `delete_sip_trunk` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_sip_trunk + ## + # RPC-specific configuration for `list_sip_trunks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sip_trunks + ## + # RPC-specific configuration for `get_sip_trunk` + # @return [::Gapic::Config::Method] + # + attr_reader :get_sip_trunk + ## + # RPC-specific configuration for `update_sip_trunk` + # @return [::Gapic::Config::Method] + # + attr_reader :update_sip_trunk + + # @private + def initialize parent_rpcs = nil + create_sip_trunk_config = parent_rpcs.create_sip_trunk if parent_rpcs.respond_to? :create_sip_trunk + @create_sip_trunk = ::Gapic::Config::Method.new create_sip_trunk_config + delete_sip_trunk_config = parent_rpcs.delete_sip_trunk if parent_rpcs.respond_to? :delete_sip_trunk + @delete_sip_trunk = ::Gapic::Config::Method.new delete_sip_trunk_config + list_sip_trunks_config = parent_rpcs.list_sip_trunks if parent_rpcs.respond_to? :list_sip_trunks + @list_sip_trunks = ::Gapic::Config::Method.new list_sip_trunks_config + get_sip_trunk_config = parent_rpcs.get_sip_trunk if parent_rpcs.respond_to? :get_sip_trunk + @get_sip_trunk = ::Gapic::Config::Method.new get_sip_trunk_config + update_sip_trunk_config = parent_rpcs.update_sip_trunk if parent_rpcs.respond_to? :update_sip_trunk + @update_sip_trunk = ::Gapic::Config::Method.new update_sip_trunk_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/service_stub.rb new file mode 100644 index 000000000000..393ddef453ab --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/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/dialogflow/v2/sip_trunk_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module SipTrunks + module Rest + ## + # REST service stub for the SipTrunks 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_sip_trunk REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SipTrunk] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # A result object deserialized from the server's reply + def create_sip_trunk request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_sip_trunk_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_sip_trunk", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SipTrunk.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_sip_trunk REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_sip_trunk request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_sip_trunk_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_sip_trunk", + 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 list_sip_trunks REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListSipTrunksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse] + # A result object deserialized from the server's reply + def list_sip_trunks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sip_trunks_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_sip_trunks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse.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_sip_trunk REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SipTrunk] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # A result object deserialized from the server's reply + def get_sip_trunk request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_sip_trunk_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_sip_trunk", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SipTrunk.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_sip_trunk REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::SipTrunk] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # A result object deserialized from the server's reply + def update_sip_trunk request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_sip_trunk_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_sip_trunk", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::SipTrunk.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_sip_trunk REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest] + # 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_sip_trunk_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/sipTrunks", + body: "sip_trunk", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_sip_trunk REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest] + # 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_sip_trunk_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sipTrunks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_sip_trunks REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest] + # 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_sip_trunks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/sipTrunks", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_sip_trunk REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest] + # 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_sip_trunk_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sipTrunks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_sip_trunk REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest] + # 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_sip_trunk_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{sip_trunk.name}", + body: "sip_trunk", + matches: [ + ["sip_trunk.name", %r{^projects/[^/]+/locations/[^/]+/sipTrunks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_call_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_call_pb.rb new file mode 100644 index 000000000000..d12d5335e9b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_call_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/tool_call.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/cloud/dialogflow/v2/tool_call.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd8\x04\n\x08ToolCall\x12\x36\n\x04tool\x18\x01 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/ToolH\x00\x12\x33\n\x08\x63\x65s_tool\x18\x0b \x01(\tB\x1f\xe0\x41\x01\xfa\x41\x19\n\x17\x63\x65s.googleapis.com/ToolH\x00\x12\x39\n\x0b\x63\x65s_toolset\x18\x0c \x01(\tB\"\xe0\x41\x01\xfa\x41\x1c\n\x1a\x63\x65s.googleapis.com/ToolsetH\x00\x12\x31\n\x07\x63\x65s_app\x18\x08 \x01(\tB\x1e\xe0\x41\x01\xfa\x41\x18\n\x16\x63\x65s.googleapis.com/AppH\x00\x12\x1e\n\x11tool_display_name\x18\t \x01(\tB\x03\xe0\x41\x01\x12!\n\x14tool_display_details\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x61\x63tion\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x36\n\x10input_parameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\ranswer_record\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12>\n\x05state\x18\x07 \x01(\x0e\x32*.google.cloud.dialogflow.v2.ToolCall.StateB\x03\xe0\x41\x03\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tTRIGGERED\x10\x01\x12\x16\n\x12NEEDS_CONFIRMATION\x10\x02\x42\x08\n\x06source\"\xf2\x03\n\x0eToolCallResult\x12\x36\n\x04tool\x18\x01 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/ToolH\x00\x12\x39\n\x0b\x63\x65s_toolset\x18\r \x01(\tB\"\xe0\x41\x01\xfa\x41\x1c\n\x1a\x63\x65s.googleapis.com/ToolsetH\x00\x12\x33\n\x08\x63\x65s_tool\x18\x0c \x01(\tB\x1f\xe0\x41\x01\xfa\x41\x19\n\x17\x63\x65s.googleapis.com/ToolH\x00\x12\x31\n\x07\x63\x65s_app\x18\x0b \x01(\tB\x1e\xe0\x41\x01\xfa\x41\x18\n\x16\x63\x65s.googleapis.com/AppH\x00\x12\x13\n\x06\x61\x63tion\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.ToolCallResult.ErrorH\x01\x12\x15\n\x0braw_content\x18\x05 \x01(\x0cH\x01\x12\x11\n\x07\x63ontent\x18\x06 \x01(\tH\x01\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\ranswer_record\x18\t \x01(\tB\x03\xe0\x41\x01\x1a\x1d\n\x05\x45rror\x12\x14\n\x07message\x18\x01 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06sourceB\x08\n\x06resultB\x93\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\rToolCallProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + ToolCall = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolCall").msgclass + ToolCall::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolCall.State").enummodule + ToolCallResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolCallResult").msgclass + ToolCallResult::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolCallResult.Error").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_pb.rb new file mode 100644 index 000000000000..03ba94b43d4b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_pb.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/tool.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/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n%google/cloud/dialogflow/v2/tool.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x96\x01\n\x11\x43reateToolRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Tool\x12\x33\n\x04tool\x18\x02 \x01(\x0b\x32 .google.cloud.dialogflow.v2.ToolB\x03\xe0\x41\x02\x12\x14\n\x07tool_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"F\n\x0eGetToolRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\"{\n\x10ListToolsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Tool\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\"]\n\x11ListToolsResponse\x12/\n\x05tools\x18\x01 \x03(\x0b\x32 .google.cloud.dialogflow.v2.Tool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"I\n\x11\x44\x65leteToolRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\"~\n\x11UpdateToolRequest\x12\x33\n\x04tool\x18\x01 \x01(\x0b\x32 .google.cloud.dialogflow.v2.ToolB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xae\x1f\n\x04Tool\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x15\n\x08tool_key\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x13 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12q\n\x1f\x61\x63tion_confirmation_requirement\x18\x11 \x03(\x0b\x32\x43.google.cloud.dialogflow.v2.Tool.ActionConfirmationRequirementEntryB\x03\xe0\x41\x01\x12L\n\x0e\x65xtension_spec\x18\x04 \x01(\x0b\x32..google.cloud.dialogflow.v2.Tool.ExtensionToolB\x02\x18\x01H\x00\x12\x46\n\rfunction_spec\x18\r \x01(\x0b\x32-.google.cloud.dialogflow.v2.Tool.FunctionToolH\x00\x12H\n\x0e\x63onnector_spec\x18\x12 \x01(\x0b\x32..google.cloud.dialogflow.v2.Tool.ConnectorToolH\x00\x12\x45\n\ropen_api_spec\x18\x14 \x01(\x0b\x32,.google.cloud.dialogflow.v2.Tool.OpenApiToolH\x00\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzs\x18\x0e \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x1a\"\n\rExtensionTool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\xbe\x01\n\x0c\x46unctionTool\x12\x32\n\x0cinput_schema\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x33\n\routput_schema\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x45\n\x0bmethod_type\x18\x04 \x01(\x0e\x32+.google.cloud.dialogflow.v2.Tool.MethodTypeB\x03\xe0\x41\x01\x1a\xa6\x02\n\x0bOpenApiTool\x12\x1a\n\x0btext_schema\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x12L\n\x0e\x61uthentication\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.Tool.AuthenticationB\x03\xe0\x41\x01\x12\x43\n\ntls_config\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.v2.Tool.TLSConfigB\x03\xe0\x41\x01\x12^\n\x18service_directory_config\x18\x04 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfigB\x03\xe0\x41\x01\x42\x08\n\x06schema\x1a\xc4\x04\n\rConnectorTool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x07\x61\x63tions\x18\x02 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.Tool.ConnectorTool.ActionB\x03\xe0\x41\x02\x1a\xd2\x03\n\x06\x41\x63tion\x12\x1e\n\x14\x63onnection_action_id\x18\x04 \x01(\tH\x00\x12\x61\n\x10\x65ntity_operation\x18\x05 \x01(\x0b\x32\x45.google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperationH\x00\x12\x19\n\x0cinput_fields\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\routput_fields\x18\x03 \x03(\tB\x03\xe0\x41\x01\x1a\xfe\x01\n\x0f\x45ntityOperation\x12\x16\n\tentity_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12k\n\toperation\x18\x02 \x01(\x0e\x32S.google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationTypeB\x03\xe0\x41\x02\"f\n\rOperationType\x12\x1e\n\x1aOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04LIST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\n\n\x06\x43REATE\x10\x03\x12\n\n\x06UPDATE\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x42\r\n\x0b\x61\x63tion_spec\x1a\xda\x0b\n\x0e\x41uthentication\x12V\n\x0e\x61pi_key_config\x18\x01 \x01(\x0b\x32<.google.cloud.dialogflow.v2.Tool.Authentication.ApiKeyConfigH\x00\x12S\n\x0coauth_config\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfigH\x00\x12k\n\x19service_agent_auth_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfigH\x00\x12`\n\x13\x62\x65\x61rer_token_config\x18\x04 \x01(\x0b\x32\x41.google.cloud.dialogflow.v2.Tool.Authentication.BearerTokenConfigH\x00\x1a\xf3\x01\n\x0c\x41piKeyConfig\x12\x15\n\x08key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x61pi_key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12V\n\x1asecret_version_for_api_key\x18\x04 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12^\n\x10request_location\x18\x03 \x01(\x0e\x32?.google.cloud.dialogflow.v2.Tool.Authentication.RequestLocationB\x03\xe0\x41\x02\x1a\x87\x03\n\x0bOAuthConfig\x12i\n\x10oauth_grant_type\x18\x01 \x01(\x0e\x32J.google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig.OauthGrantTypeB\x03\xe0\x41\x02\x12\x16\n\tclient_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rclient_secret\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\\\n secret_version_for_client_secret\x18\x06 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x1b\n\x0etoken_endpoint\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06scopes\x18\x05 \x03(\tB\x03\xe0\x41\x01\"I\n\x0eOauthGrantType\x12 \n\x1cOAUTH_GRANT_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43LIENT_CREDENTIAL\x10\x01\x1a\xea\x01\n\x16ServiceAgentAuthConfig\x12x\n\x12service_agent_auth\x18\x01 \x01(\x0e\x32W.google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuthB\x03\xe0\x41\x01\"V\n\x10ServiceAgentAuth\x12\"\n\x1eSERVICE_AGENT_AUTH_UNSPECIFIED\x10\x00\x12\x0c\n\x08ID_TOKEN\x10\x01\x12\x10\n\x0c\x41\x43\x43\x45SS_TOKEN\x10\x02\x1a}\n\x11\x42\x65\x61rerTokenConfig\x12\x12\n\x05token\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12T\n\x18secret_version_for_token\x18\x02 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"Q\n\x0fRequestLocation\x12 \n\x1cREQUEST_LOCATION_UNSPECIFIED\x10\x00\x12\n\n\x06HEADER\x10\x01\x12\x10\n\x0cQUERY_STRING\x10\x02\x42\r\n\x0b\x61uth_config\x1a\x8d\x01\n\tTLSConfig\x12H\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32\x31.google.cloud.dialogflow.v2.Tool.TLSConfig.CACertB\x03\xe0\x41\x02\x1a\x36\n\x06\x43\x41\x43\x65rt\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x63\x65rt\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x1aZ\n\x16ServiceDirectoryConfig\x12@\n\x07service\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x1a~\n\"ActionConfirmationRequirementEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x05value\x18\x02 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirement:\x02\x38\x01\"c\n\x17\x43onfirmationRequirement\x12(\n$CONFIRMATION_REQUIREMENT_UNSPECIFIED\x10\x00\x12\x0c\n\x08REQUIRED\x10\x01\x12\x10\n\x0cNOT_REQUIRED\x10\x02\"\\\n\nMethodType\x12\x1b\n\x17METHOD_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03GET\x10\x01\x12\x08\n\x04POST\x10\x02\x12\x07\n\x03PUT\x10\x03\x12\n\n\x06\x44\x45LETE\x10\x04\x12\t\n\x05PATCH\x10\x05:f\xea\x41\x63\n\x1e\x64ialogflow.googleapis.com/Tool\x12\x34projects/{project}/locations/{location}/tools/{tool}*\x05tools2\x04toolB\x0f\n\rspecificationB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi2\xac\x07\n\x05Tools\x12\xac\x01\n\nCreateTool\x12-.google.cloud.dialogflow.v2.CreateToolRequest\x1a .google.cloud.dialogflow.v2.Tool\"M\xda\x41\x13parent,tool,tool_id\x82\xd3\xe4\x93\x02\x31\")/v2/{parent=projects/*/locations/*}/tools:\x04tool\x12\x91\x01\n\x07GetTool\x12*.google.cloud.dialogflow.v2.GetToolRequest\x1a .google.cloud.dialogflow.v2.Tool\"8\xda\x41\x04name\x82\xd3\xe4\x93\x02+\x12)/v2/{name=projects/*/locations/*/tools/*}\x12\xa4\x01\n\tListTools\x12,.google.cloud.dialogflow.v2.ListToolsRequest\x1a-.google.cloud.dialogflow.v2.ListToolsResponse\":\xda\x41\x06parent\x82\xd3\xe4\x93\x02+\x12)/v2/{parent=projects/*/locations/*}/tools\x12\x8d\x01\n\nDeleteTool\x12-.google.cloud.dialogflow.v2.DeleteToolRequest\x1a\x16.google.protobuf.Empty\"8\xda\x41\x04name\x82\xd3\xe4\x93\x02+*)/v2/{name=projects/*/locations/*/tools/*}\x12\xae\x01\n\nUpdateTool\x12-.google.cloud.dialogflow.v2.UpdateToolRequest\x1a .google.cloud.dialogflow.v2.Tool\"O\xda\x41\x10tool,update_mask\x82\xd3\xe4\x93\x02\x36\x32./v2/{tool.name=projects/*/locations/*/tools/*}:\x04tool\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xf6\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\tToolProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + CreateToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateToolRequest").msgclass + GetToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetToolRequest").msgclass + ListToolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListToolsRequest").msgclass + ListToolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListToolsResponse").msgclass + DeleteToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteToolRequest").msgclass + UpdateToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateToolRequest").msgclass + Tool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool").msgclass + Tool::ExtensionTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ExtensionTool").msgclass + Tool::FunctionTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.FunctionTool").msgclass + Tool::OpenApiTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.OpenApiTool").msgclass + Tool::ConnectorTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConnectorTool").msgclass + Tool::ConnectorTool::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConnectorTool.Action").msgclass + Tool::ConnectorTool::Action::EntityOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation").msgclass + Tool::ConnectorTool::Action::EntityOperation::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationType").enummodule + Tool::Authentication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication").msgclass + Tool::Authentication::ApiKeyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.ApiKeyConfig").msgclass + Tool::Authentication::OAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig").msgclass + Tool::Authentication::OAuthConfig::OauthGrantType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig.OauthGrantType").enummodule + Tool::Authentication::ServiceAgentAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig").msgclass + Tool::Authentication::ServiceAgentAuthConfig::ServiceAgentAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth").enummodule + Tool::Authentication::BearerTokenConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.BearerTokenConfig").msgclass + Tool::Authentication::RequestLocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation").enummodule + Tool::TLSConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.TLSConfig").msgclass + Tool::TLSConfig::CACert = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.TLSConfig.CACert").msgclass + Tool::ServiceDirectoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfig").msgclass + Tool::ConfirmationRequirement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConfirmationRequirement").enummodule + Tool::MethodType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.MethodType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_services_pb.rb new file mode 100644 index 000000000000..2523d3df1147 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/tool.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/tool_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Tools + # Tool Service for LLM powered Agent Assist. Tools can be used to interact with + # remote APIs (e.g. fetching orders) to retrieve additional information as + # input to LLM. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Tools' + + # Creates a tool. + rpc :CreateTool, ::Google::Cloud::Dialogflow::V2::CreateToolRequest, ::Google::Cloud::Dialogflow::V2::Tool + # Retrieves a tool. + rpc :GetTool, ::Google::Cloud::Dialogflow::V2::GetToolRequest, ::Google::Cloud::Dialogflow::V2::Tool + # Lists tools. + rpc :ListTools, ::Google::Cloud::Dialogflow::V2::ListToolsRequest, ::Google::Cloud::Dialogflow::V2::ListToolsResponse + # Deletes a tool. + rpc :DeleteTool, ::Google::Cloud::Dialogflow::V2::DeleteToolRequest, ::Google::Protobuf::Empty + # Updates a tool. + rpc :UpdateTool, ::Google::Cloud::Dialogflow::V2::UpdateToolRequest, ::Google::Cloud::Dialogflow::V2::Tool + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools.rb new file mode 100644 index 000000000000..b1b2e61ed6ab --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/tools/credentials" +require "google/cloud/dialogflow/v2/tools/paths" +require "google/cloud/dialogflow/v2/tools/client" +require "google/cloud/dialogflow/v2/tools/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Tool Service for LLM powered Agent Assist. Tools can be used to interact with + # remote APIs (e.g. fetching orders) to retrieve additional information as + # input to LLM. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/tools" + # client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/tools/rest" + # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new + # + module Tools + end + end + end + end +end + +helper_path = ::File.join __dir__, "tools", "helpers.rb" +require "google/cloud/dialogflow/v2/tools/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/client.rb new file mode 100644 index 000000000000..24392857a1c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/client.rb @@ -0,0 +1,899 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/tool_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Tools + ## + # Client for the Tools service. + # + # Tool Service for LLM powered Agent Assist. Tools can be used to interact with + # remote APIs (e.g. fetching orders) to retrieve additional information as + # input to LLM. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tools_stub + + ## + # Configure the Tools Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Tools::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Tools clients + # ::Google::Cloud::Dialogflow::V2::Tools::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Tools 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::Dialogflow::V2::Tools::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 + @tools_stub.universe_domain + end + + ## + # Create a new Tools client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Tools 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/dialogflow/v2/tool_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 + + @tools_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Tools::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 + ) + + @tools_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 = @tools_stub.endpoint + config.universe_domain = @tools_stub.universe_domain + config.logger = @tools_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 + @tools_stub.logger + end + + # Service calls + + ## + # Creates a tool. + # + # @overload create_tool(request, options = nil) + # Pass arguments to `create_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateToolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool(parent: nil, tool: nil, tool_id: nil) + # Pass arguments to `create_tool` via keyword arguments. Note that at + # least one keyword argument is 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 project/location to create tool for. Format: + # `projects//locations/` + # @param tool [::Google::Cloud::Dialogflow::V2::Tool, ::Hash] + # Required. The tool to create. + # @param tool_id [::String] + # Optional. The ID to use for the tool, which will become the final + # component of the tool's resource name. + # + # The tool ID must be compliant with the regression formula + # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + # If the field is not provide, an Id will be auto-generated. + # If the field is provided, the caller is responsible for + # 1. the uniqueness of the ID, otherwise the request will be rejected. + # 2. the consistency for whether to use custom ID or not under a project to + # better ensure uniqueness. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Tool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateToolRequest.new + # + # # Call the create_tool method. + # result = client.create_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. + # p result + # + def create_tool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateToolRequest + + # Converts hash and nil to 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_tool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_tool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_tool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :create_tool, 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 + + ## + # Retrieves a tool. + # + # @overload get_tool(request, options = nil) + # Pass arguments to `get_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetToolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool(name: nil) + # Pass arguments to `get_tool` via keyword arguments. Note that at + # least one keyword argument is required. To 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 tool resource name to retrieve. Format: + # `projects//locations//tools/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Tool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetToolRequest.new + # + # # Call the get_tool method. + # result = client.get_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. + # p result + # + def get_tool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetToolRequest + + # Converts hash and nil to 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_tool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_tool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_tool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :get_tool, 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 tools. + # + # @overload list_tools(request, options = nil) + # Pass arguments to `list_tools` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListToolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListToolsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tools(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tools` via keyword arguments. Note that at + # least one keyword argument is 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 project/location to list tools for. Format: + # `projects//locations/` + # @param page_size [::Integer] + # Optional. Maximum number of conversation models to return in a single page. + # Default to 10. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Tool>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Tool>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListToolsRequest.new + # + # # Call the list_tools method. + # result = client.list_tools 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::Dialogflow::V2::Tool. + # p item + # end + # + def list_tools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListToolsRequest + + # Converts hash and nil to 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_tools.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_tools.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :list_tools, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tools_stub, :list_tools, 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 tool. + # + # @overload delete_tool(request, options = nil) + # Pass arguments to `delete_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteToolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool(name: nil) + # Pass arguments to `delete_tool` via keyword arguments. Note that at + # least one keyword argument is required. To 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 tool resource name to delete. Format: + # `projects//locations//tools/` + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteToolRequest.new + # + # # Call the delete_tool method. + # result = client.delete_tool request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteToolRequest + + # Converts hash and nil to 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_tool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_tool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_tool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :delete_tool, 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 tool. + # + # @overload update_tool(request, options = nil) + # Pass arguments to `update_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateToolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool(tool: nil, update_mask: nil) + # Pass arguments to `update_tool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tool [::Google::Cloud::Dialogflow::V2::Tool, ::Hash] + # Required. The tool to update. + # The name field of tool is to identify the tool to + # update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Tool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateToolRequest.new + # + # # Call the update_tool method. + # result = client.update_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. + # p result + # + def update_tool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateToolRequest + + # Converts hash and nil to 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_tool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.tool&.name + header_params["tool.name"] = request.tool.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_tool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_tool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.call_rpc :update_tool, 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 Tools API. + # + # This class represents the configuration for Tools, + # 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::Dialogflow::V2::Tools::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_tool to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Tools::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tool.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tool.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::Dialogflow::V2::Tools::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Tools 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tool + ## + # RPC-specific configuration for `get_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tool + ## + # RPC-specific configuration for `list_tools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tools + ## + # RPC-specific configuration for `delete_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tool + ## + # RPC-specific configuration for `update_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tool + + # @private + def initialize parent_rpcs = nil + create_tool_config = parent_rpcs.create_tool if parent_rpcs.respond_to? :create_tool + @create_tool = ::Gapic::Config::Method.new create_tool_config + get_tool_config = parent_rpcs.get_tool if parent_rpcs.respond_to? :get_tool + @get_tool = ::Gapic::Config::Method.new get_tool_config + list_tools_config = parent_rpcs.list_tools if parent_rpcs.respond_to? :list_tools + @list_tools = ::Gapic::Config::Method.new list_tools_config + delete_tool_config = parent_rpcs.delete_tool if parent_rpcs.respond_to? :delete_tool + @delete_tool = ::Gapic::Config::Method.new delete_tool_config + update_tool_config = parent_rpcs.update_tool if parent_rpcs.respond_to? :update_tool + @update_tool = ::Gapic::Config::Method.new update_tool_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/credentials.rb new file mode 100644 index 000000000000..6b01618f767d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Tools + # Credentials for the Tools API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/paths.rb new file mode 100644 index 000000000000..f021f5d31682 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/paths.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! + + +module Google + module Cloud + module Dialogflow + module V2 + module Tools + # Path helper methods for the Tools API. + module Paths + ## + # 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 SecretVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}/versions/{version}` + # + # @param project [String] + # @param secret [String] + # @param version [String] + # + # @return [::String] + def secret_version_path project:, secret:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}/versions/#{version}" + end + + ## + # Create a fully-qualified Service resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` + # + # @param project [String] + # @param location [String] + # @param namespace [String] + # @param service [String] + # + # @return [::String] + def service_path project:, location:, namespace:, service: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" + + "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" + end + + ## + # Create a fully-qualified Tool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/tools/{tool}` + # + # @param project [String] + # @param location [String] + # @param tool [String] + # + # @return [::String] + def tool_path project:, location:, tool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/tools/#{tool}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest.rb new file mode 100644 index 000000000000..4356a3dfa7d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/tools/credentials" +require "google/cloud/dialogflow/v2/tools/paths" +require "google/cloud/dialogflow/v2/tools/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Tool Service for LLM powered Agent Assist. Tools can be used to interact with + # remote APIs (e.g. fetching orders) to retrieve additional information as + # input to LLM. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/tools/rest" + # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new + # + module Tools + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/tools/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/client.rb new file mode 100644 index 000000000000..7976c58b42f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/client.rb @@ -0,0 +1,829 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/tool_pb" +require "google/cloud/dialogflow/v2/tools/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Tools + module Rest + ## + # REST client for the Tools service. + # + # Tool Service for LLM powered Agent Assist. Tools can be used to interact with + # remote APIs (e.g. fetching orders) to retrieve additional information as + # input to LLM. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :tools_stub + + ## + # Configure the Tools Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Tools::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Tools clients + # ::Google::Cloud::Dialogflow::V2::Tools::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Tools 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::Dialogflow::V2::Tools::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 + @tools_stub.universe_domain + end + + ## + # Create a new Tools REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Tools 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 + + @tools_stub = ::Google::Cloud::Dialogflow::V2::Tools::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @tools_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 = @tools_stub.endpoint + config.universe_domain = @tools_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @tools_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 + @tools_stub.logger + end + + # Service calls + + ## + # Creates a tool. + # + # @overload create_tool(request, options = nil) + # Pass arguments to `create_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateToolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool(parent: nil, tool: nil, tool_id: nil) + # Pass arguments to `create_tool` via keyword arguments. Note that at + # least one keyword argument is 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 project/location to create tool for. Format: + # `projects//locations/` + # @param tool [::Google::Cloud::Dialogflow::V2::Tool, ::Hash] + # Required. The tool to create. + # @param tool_id [::String] + # Optional. The ID to use for the tool, which will become the final + # component of the tool's resource name. + # + # The tool ID must be compliant with the regression formula + # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + # If the field is not provide, an Id will be auto-generated. + # If the field is provided, the caller is responsible for + # 1. the uniqueness of the ID, otherwise the request will be rejected. + # 2. the consistency for whether to use custom ID or not under a project to + # better ensure uniqueness. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateToolRequest.new + # + # # Call the create_tool method. + # result = client.create_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. + # p result + # + def create_tool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateToolRequest + + # Converts hash and nil to an 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_tool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_tool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_tool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.create_tool 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 + + ## + # Retrieves a tool. + # + # @overload get_tool(request, options = nil) + # Pass arguments to `get_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetToolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool(name: nil) + # Pass arguments to `get_tool` via keyword arguments. Note that at + # least one keyword argument is required. To 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 tool resource name to retrieve. Format: + # `projects//locations//tools/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetToolRequest.new + # + # # Call the get_tool method. + # result = client.get_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. + # p result + # + def get_tool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetToolRequest + + # Converts hash and nil to an 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_tool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_tool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_tool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.get_tool 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 tools. + # + # @overload list_tools(request, options = nil) + # Pass arguments to `list_tools` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListToolsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListToolsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tools(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tools` via keyword arguments. Note that at + # least one keyword argument is 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 project/location to list tools for. Format: + # `projects//locations/` + # @param page_size [::Integer] + # Optional. Maximum number of conversation models to return in a single page. + # Default to 10. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Tool>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Tool>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListToolsRequest.new + # + # # Call the list_tools method. + # result = client.list_tools 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::Dialogflow::V2::Tool. + # p item + # end + # + def list_tools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListToolsRequest + + # Converts hash and nil to an 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_tools.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_tools.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.list_tools request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @tools_stub, :list_tools, "tools", 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 tool. + # + # @overload delete_tool(request, options = nil) + # Pass arguments to `delete_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteToolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool(name: nil) + # Pass arguments to `delete_tool` via keyword arguments. Note that at + # least one keyword argument is required. To 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 tool resource name to delete. Format: + # `projects//locations//tools/` + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteToolRequest.new + # + # # Call the delete_tool method. + # result = client.delete_tool request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_tool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteToolRequest + + # Converts hash and nil to an 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_tool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_tool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_tool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.delete_tool 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 tool. + # + # @overload update_tool(request, options = nil) + # Pass arguments to `update_tool` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateToolRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateToolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_tool(tool: nil, update_mask: nil) + # Pass arguments to `update_tool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param tool [::Google::Cloud::Dialogflow::V2::Tool, ::Hash] + # Required. The tool to update. + # The name field of tool is to identify the tool to + # update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateToolRequest.new + # + # # Call the update_tool method. + # result = client.update_tool request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. + # p result + # + def update_tool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateToolRequest + + # Converts hash and nil to an 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_tool.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_tool.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_tool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tools_stub.update_tool 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 Tools REST API. + # + # This class represents the configuration for Tools 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::Dialogflow::V2::Tools::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_tool to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_tool.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_tool.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Tools 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_tool + ## + # RPC-specific configuration for `get_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_tool + ## + # RPC-specific configuration for `list_tools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tools + ## + # RPC-specific configuration for `delete_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_tool + ## + # RPC-specific configuration for `update_tool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_tool + + # @private + def initialize parent_rpcs = nil + create_tool_config = parent_rpcs.create_tool if parent_rpcs.respond_to? :create_tool + @create_tool = ::Gapic::Config::Method.new create_tool_config + get_tool_config = parent_rpcs.get_tool if parent_rpcs.respond_to? :get_tool + @get_tool = ::Gapic::Config::Method.new get_tool_config + list_tools_config = parent_rpcs.list_tools if parent_rpcs.respond_to? :list_tools + @list_tools = ::Gapic::Config::Method.new list_tools_config + delete_tool_config = parent_rpcs.delete_tool if parent_rpcs.respond_to? :delete_tool + @delete_tool = ::Gapic::Config::Method.new delete_tool_config + update_tool_config = parent_rpcs.update_tool if parent_rpcs.respond_to? :update_tool + @update_tool = ::Gapic::Config::Method.new update_tool_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/service_stub.rb new file mode 100644 index 000000000000..78e262df8366 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/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/dialogflow/v2/tool_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Tools + module Rest + ## + # REST service stub for the Tools 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_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateToolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # A result object deserialized from the server's reply + def create_tool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_tool_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_tool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Tool.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_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetToolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # A result object deserialized from the server's reply + def get_tool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_tool_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_tool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Tool.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_tools REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListToolsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListToolsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListToolsResponse] + # A result object deserialized from the server's reply + def list_tools request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tools_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_tools", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListToolsResponse.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_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteToolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_tool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_tool_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_tool", + 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_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateToolRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Tool] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # A result object deserialized from the server's reply + def update_tool request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_tool_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_tool", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Tool.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_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateToolRequest] + # 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_tool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/tools", + body: "tool", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetToolRequest] + # 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_tool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tools REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListToolsRequest] + # 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_tools_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/tools", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteToolRequest] + # 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_tool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/tools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_tool REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateToolRequest] + # 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_tool_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{tool.name}", + body: "tool", + matches: [ + ["tool.name", %r{^projects/[^/]+/locations/[^/]+/tools/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/toolset_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/toolset_pb.rb new file mode 100644 index 000000000000..c286fdc62dd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/toolset_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/toolset.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/dialogflow/v2/tool_pb' + + +descriptor_data = "\n(google/cloud/dialogflow/v2/toolset.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dialogflow/v2/tool.proto\"\xbe\x01\n\x0bToolsetTool\x12\x33\n\x07toolset\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1a\x63\x65s.googleapis.com/Toolset\x12\x19\n\x0coperation_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12_\n\x18\x63onfirmation_requirement\x18\x03 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xe0\x41\x01\x42\xf8\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cToolsetProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\x63\n\x1a\x63\x65s.googleapis.com/Toolset\x12\x45projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + ToolsetTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolsetTool").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/validation_result_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/validation_result_pb.rb new file mode 100644 index 000000000000..824c5890955c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/validation_result_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/validation_result.proto + +require 'google/protobuf' + + +descriptor_data = "\n2google/cloud/dialogflow/v2/validation_result.proto\x12\x1agoogle.cloud.dialogflow.v2\"\xd7\x01\n\x0fValidationError\x12\x46\n\x08severity\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.v2.ValidationError.Severity\x12\x0f\n\x07\x65ntries\x18\x03 \x03(\t\x12\x15\n\rerror_message\x18\x04 \x01(\t\"T\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x08\n\x04INFO\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04\"Z\n\x10ValidationResult\x12\x46\n\x11validation_errors\x18\x01 \x03(\x0b\x32+.google.cloud.dialogflow.v2.ValidationErrorB\x9b\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x15ValidationResultProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + ValidationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ValidationError").msgclass + ValidationError::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ValidationError.Severity").enummodule + ValidationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ValidationResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb new file mode 100644 index 000000000000..1567f6197690 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/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 Dialogflow + module V2 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_pb.rb new file mode 100644 index 000000000000..5e60296c0acb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/version.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/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n(google/cloud/dialogflow/v2/version.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc3\x03\n\x07Version\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0eversion_number\x18\x03 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x06status\x18\x06 \x01(\x0e\x32\x31.google.cloud.dialogflow.v2.Version.VersionStatusB\x03\xe0\x41\x03\"W\n\rVersionStatus\x12\x1e\n\x1aVERSION_STATUS_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\t\n\x05READY\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:\x96\x01\xea\x41\x92\x01\n!dialogflow.googleapis.com/Version\x12+projects/{project}/agent/versions/{version}\x12@projects/{project}/locations/{location}/agent/versions/{version}\"\x81\x01\n\x13ListVersionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Version\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\"f\n\x14ListVersionsResponse\x12\x35\n\x08versions\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Version\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11GetVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\"\x8c\x01\n\x14\x43reateVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Version\x12\x39\n\x07version\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.v2.VersionB\x03\xe0\x41\x02\"\x87\x01\n\x14UpdateVersionRequest\x12\x39\n\x07version\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.v2.VersionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"O\n\x14\x44\x65leteVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version2\xfc\t\n\x08Versions\x12\xe0\x01\n\x0cListVersions\x12/.google.cloud.dialogflow.v2.ListVersionsRequest\x1a\x30.google.cloud.dialogflow.v2.ListVersionsResponse\"m\xda\x41\x06parent\x82\xd3\xe4\x93\x02^\x12&/v2/{parent=projects/*/agent}/versionsZ4\x12\x32/v2/{parent=projects/*/locations/*/agent}/versions\x12\xcd\x01\n\nGetVersion\x12-.google.cloud.dialogflow.v2.GetVersionRequest\x1a#.google.cloud.dialogflow.v2.Version\"k\xda\x41\x04name\x82\xd3\xe4\x93\x02^\x12&/v2/{name=projects/*/agent/versions/*}Z4\x12\x32/v2/{name=projects/*/locations/*/agent/versions/*}\x12\xf0\x01\n\rCreateVersion\x12\x30.google.cloud.dialogflow.v2.CreateVersionRequest\x1a#.google.cloud.dialogflow.v2.Version\"\x87\x01\xda\x41\x0eparent,version\x82\xd3\xe4\x93\x02p\"&/v2/{parent=projects/*/agent}/versions:\x07versionZ=\"2/v2/{parent=projects/*/locations/*/agent}/versions:\x07version\x12\x86\x02\n\rUpdateVersion\x12\x30.google.cloud.dialogflow.v2.UpdateVersionRequest\x1a#.google.cloud.dialogflow.v2.Version\"\x9d\x01\xda\x41\x13version,update_mask\x82\xd3\xe4\x93\x02\x80\x01\x32./v2/{version.name=projects/*/agent/versions/*}:\x07versionZE2:/v2/{version.name=projects/*/locations/*/agent/versions/*}:\x07version\x12\xc6\x01\n\rDeleteVersion\x12\x30.google.cloud.dialogflow.v2.DeleteVersionRequest\x1a\x16.google.protobuf.Empty\"k\xda\x41\x04name\x82\xd3\xe4\x93\x02^*&/v2/{name=projects/*/agent/versions/*}Z4*2/v2/{name=projects/*/locations/*/agent/versions/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x92\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cVersionProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Version").msgclass + Version::VersionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Version.VersionStatus").enummodule + ListVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListVersionsRequest").msgclass + ListVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListVersionsResponse").msgclass + GetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetVersionRequest").msgclass + CreateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateVersionRequest").msgclass + UpdateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateVersionRequest").msgclass + DeleteVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteVersionRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_services_pb.rb new file mode 100644 index 000000000000..bc4784362d51 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/dialogflow/v2/version.proto for package 'google.cloud.dialogflow.v2' +# 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/dialogflow/v2/version_pb' + +module Google + module Cloud + module Dialogflow + module V2 + module Versions + # Service for managing [Versions][google.cloud.dialogflow.v2.Version]. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.dialogflow.v2.Versions' + + # Returns the list of all versions of the specified agent. + rpc :ListVersions, ::Google::Cloud::Dialogflow::V2::ListVersionsRequest, ::Google::Cloud::Dialogflow::V2::ListVersionsResponse + # Retrieves the specified agent version. + rpc :GetVersion, ::Google::Cloud::Dialogflow::V2::GetVersionRequest, ::Google::Cloud::Dialogflow::V2::Version + # Creates an agent version. + # + # The new version points to the agent instance in the "default" environment. + rpc :CreateVersion, ::Google::Cloud::Dialogflow::V2::CreateVersionRequest, ::Google::Cloud::Dialogflow::V2::Version + # Updates the specified agent version. + # + # Note that this method does not allow you to update the state of the agent + # the given version points to. It allows you to update only mutable + # properties of the version resource. + rpc :UpdateVersion, ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, ::Google::Cloud::Dialogflow::V2::Version + # Delete the specified agent version. + rpc :DeleteVersion, ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, ::Google::Protobuf::Empty + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions.rb new file mode 100644 index 000000000000..4bf615cef351 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions.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/dialogflow/v2/version" + +require "google/cloud/dialogflow/v2/versions/credentials" +require "google/cloud/dialogflow/v2/versions/paths" +require "google/cloud/dialogflow/v2/versions/client" +require "google/cloud/dialogflow/v2/versions/rest" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/dialogflow/v2/versions" + # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/dialogflow/v2/versions/rest" + # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + module Versions + end + end + end + end +end + +helper_path = ::File.join __dir__, "versions", "helpers.rb" +require "google/cloud/dialogflow/v2/versions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb new file mode 100644 index 000000000000..ede3695513d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb @@ -0,0 +1,909 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/version_pb" +require "google/cloud/location" + +module Google + module Cloud + module Dialogflow + module V2 + module Versions + ## + # Client for the Versions service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :versions_stub + + ## + # Configure the Versions Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Versions::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Versions clients + # ::Google::Cloud::Dialogflow::V2::Versions::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Versions 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::Dialogflow::V2::Versions::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 + @versions_stub.universe_domain + end + + ## + # Create a new Versions client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Versions 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/dialogflow/v2/version_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 + + @versions_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Dialogflow::V2::Versions::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 + ) + + @versions_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 = @versions_stub.endpoint + config.universe_domain = @versions_stub.universe_domain + config.logger = @versions_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 + @versions_stub.logger + end + + # Service calls + + ## + # Returns the list of all versions of the specified agent. + # + # @overload list_versions(request, options = nil) + # Pass arguments to `list_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_versions` via keyword arguments. Note that at + # least one keyword argument is 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 agent to list all versions from. + # Supported formats: + # + # - `projects//agent` + # - `projects//locations//agent` + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListVersionsRequest.new + # + # # Call the list_versions method. + # result = client.list_versions 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::Dialogflow::V2::Version. + # p item + # end + # + def list_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListVersionsRequest + + # Converts hash and nil to 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_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.call_rpc :list_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @versions_stub, :list_versions, 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 + + ## + # Retrieves the specified agent version. + # + # @overload get_version(request, options = nil) + # Pass arguments to `get_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(name: nil) + # Pass arguments to `get_version` via keyword arguments. Note that at + # least one keyword argument is required. To 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 version. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Version] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Version] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetVersionRequest.new + # + # # Call the get_version method. + # result = client.get_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + # p result + # + def get_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetVersionRequest + + # Converts hash and nil to 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_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.call_rpc :get_version, 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 an agent version. + # + # The new version points to the agent instance in the "default" environment. + # + # @overload create_version(request, options = nil) + # Pass arguments to `create_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(parent: nil, version: nil) + # Pass arguments to `create_version` via keyword arguments. Note that at + # least one keyword argument is 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 agent to create a version for. + # Supported formats: + # + # - `projects//agent` + # - `projects//locations//agent` + # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash] + # Required. The version to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Version] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Version] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateVersionRequest.new + # + # # Call the create_version method. + # result = client.create_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + # p result + # + def create_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateVersionRequest + + # Converts hash and nil to 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_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.call_rpc :create_version, 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 the specified agent version. + # + # Note that this method does not allow you to update the state of the agent + # the given version points to. It allows you to update only mutable + # properties of the version resource. + # + # @overload update_version(request, options = nil) + # Pass arguments to `update_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(version: nil, update_mask: nil) + # Pass arguments to `update_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash] + # Required. The version to update. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Dialogflow::V2::Version] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Dialogflow::V2::Version] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new + # + # # Call the update_version method. + # result = client.update_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + # p result + # + def update_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest + + # Converts hash and nil to 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_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.version&.name + header_params["version.name"] = request.version.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_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.call_rpc :update_version, 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 + + ## + # Delete the specified agent version. + # + # @overload delete_version(request, options = nil) + # Pass arguments to `delete_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(name: nil) + # Pass arguments to `delete_version` via keyword arguments. Note that at + # least one keyword argument is required. To 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 version to delete. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + # + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new + # + # # Call the delete_version method. + # result = client.delete_version request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest + + # Converts hash and nil to 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_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-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_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.call_rpc :delete_version, 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 Versions API. + # + # This class represents the configuration for Versions, + # 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::Dialogflow::V2::Versions::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_versions to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Versions::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_versions.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_versions.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::Dialogflow::V2::Versions::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 Versions 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_versions + ## + # RPC-specific configuration for `get_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_version + ## + # RPC-specific configuration for `create_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_version + ## + # RPC-specific configuration for `update_version` + # @return [::Gapic::Config::Method] + # + attr_reader :update_version + ## + # RPC-specific configuration for `delete_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_version + + # @private + def initialize parent_rpcs = nil + list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions + @list_versions = ::Gapic::Config::Method.new list_versions_config + get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version + @get_version = ::Gapic::Config::Method.new get_version_config + create_version_config = parent_rpcs.create_version if parent_rpcs.respond_to? :create_version + @create_version = ::Gapic::Config::Method.new create_version_config + update_version_config = parent_rpcs.update_version if parent_rpcs.respond_to? :update_version + @update_version = ::Gapic::Config::Method.new update_version_config + delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version + @delete_version = ::Gapic::Config::Method.new delete_version_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/credentials.rb new file mode 100644 index 000000000000..fbb76520093c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/credentials.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 "googleauth" + +module Google + module Cloud + module Dialogflow + module V2 + module Versions + # Credentials for the Versions API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow" + ] + self.env_vars = [ + "DIALOGFLOW_CREDENTIALS", + "DIALOGFLOW_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "DIALOGFLOW_CREDENTIALS_JSON", + "DIALOGFLOW_KEYFILE_JSON", + "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/paths.rb new file mode 100644 index 000000000000..12e1ff30d50f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/paths.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + module Versions + # Path helper methods for the Versions API. + module Paths + ## + # Create a fully-qualified Agent resource string. + # + # @overload agent_path(project:) + # The resource will be in the following format: + # + # `projects/{project}/agent` + # + # @param project [String] + # + # @overload agent_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def agent_path **args + resources = { + "project" => (proc do |project:| + "projects/#{project}/agent" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent" + 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 Version resource string. + # + # @overload version_path(project:, version:) + # The resource will be in the following format: + # + # `projects/{project}/agent/versions/{version}` + # + # @param project [String] + # @param version [String] + # + # @overload version_path(project:, location:, version:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/agent/versions/{version}` + # + # @param project [String] + # @param location [String] + # @param version [String] + # + # @return [::String] + def version_path **args + resources = { + "project:version" => (proc do |project:, version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/agent/versions/#{version}" + end), + "location:project:version" => (proc do |project:, location:, version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/agent/versions/#{version}" + 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest.rb new file mode 100644 index 000000000000..818e626fa76b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/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/dialogflow/v2/version" +require "google/cloud/dialogflow/v2/bindings_override" + +require "google/cloud/dialogflow/v2/versions/credentials" +require "google/cloud/dialogflow/v2/versions/paths" +require "google/cloud/dialogflow/v2/versions/rest/client" + +module Google + module Cloud + module Dialogflow + module V2 + ## + # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/dialogflow/v2/versions/rest" + # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + module Versions + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/dialogflow/v2/versions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb new file mode 100644 index 000000000000..c75bf3b1900b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb @@ -0,0 +1,839 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/version_pb" +require "google/cloud/dialogflow/v2/versions/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Dialogflow + module V2 + module Versions + module Rest + ## + # REST client for the Versions service. + # + # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :versions_stub + + ## + # Configure the Versions Client class. + # + # See {::Google::Cloud::Dialogflow::V2::Versions::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Versions clients + # ::Google::Cloud::Dialogflow::V2::Versions::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", "Dialogflow", "V2"] + 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 = 60.0 + default_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Versions 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::Dialogflow::V2::Versions::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 + @versions_stub.universe_domain + end + + ## + # Create a new Versions REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Versions 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 + + @versions_stub = ::Google::Cloud::Dialogflow::V2::Versions::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @versions_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 = @versions_stub.endpoint + config.universe_domain = @versions_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @versions_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 + @versions_stub.logger + end + + # Service calls + + ## + # Returns the list of all versions of the specified agent. + # + # @overload list_versions(request, options = nil) + # Pass arguments to `list_versions` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::ListVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::ListVersionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_versions(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_versions` via keyword arguments. Note that at + # least one keyword argument is 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 agent to list all versions from. + # Supported formats: + # + # - `projects//agent` + # - `projects//locations//agent` + # @param page_size [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @param page_token [::String] + # Optional. The next_page_token value returned from a previous list request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::ListVersionsRequest.new + # + # # Call the list_versions method. + # result = client.list_versions 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::Dialogflow::V2::Version. + # p item + # end + # + def list_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListVersionsRequest + + # Converts hash and nil to an 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_versions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.list_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @versions_stub, :list_versions, "versions", 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 + + ## + # Retrieves the specified agent version. + # + # @overload get_version(request, options = nil) + # Pass arguments to `get_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::GetVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::GetVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(name: nil) + # Pass arguments to `get_version` via keyword arguments. Note that at + # least one keyword argument is required. To 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 version. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Version] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::GetVersionRequest.new + # + # # Call the get_version method. + # result = client.get_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + # p result + # + def get_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetVersionRequest + + # Converts hash and nil to an 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_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.get_version 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 an agent version. + # + # The new version points to the agent instance in the "default" environment. + # + # @overload create_version(request, options = nil) + # Pass arguments to `create_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::CreateVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::CreateVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(parent: nil, version: nil) + # Pass arguments to `create_version` via keyword arguments. Note that at + # least one keyword argument is 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 agent to create a version for. + # Supported formats: + # + # - `projects//agent` + # - `projects//locations//agent` + # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash] + # Required. The version to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Version] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::CreateVersionRequest.new + # + # # Call the create_version method. + # result = client.create_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + # p result + # + def create_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateVersionRequest + + # Converts hash and nil to an 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_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.create_version 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 the specified agent version. + # + # Note that this method does not allow you to update the state of the agent + # the given version points to. It allows you to update only mutable + # properties of the version resource. + # + # @overload update_version(request, options = nil) + # Pass arguments to `update_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::UpdateVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(version: nil, update_mask: nil) + # Pass arguments to `update_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash] + # Required. The version to update. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to control which fields get updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Dialogflow::V2::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Version] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new + # + # # Call the update_version method. + # result = client.update_version request + # + # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + # p result + # + def update_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest + + # Converts hash and nil to an 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_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.update_version 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 + + ## + # Delete the specified agent version. + # + # @overload delete_version(request, options = nil) + # Pass arguments to `delete_version` via a request object, either of type + # {::Google::Cloud::Dialogflow::V2::DeleteVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_version(name: nil) + # Pass arguments to `delete_version` via keyword arguments. Note that at + # least one keyword argument is required. To 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 version to delete. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + # @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/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new + # + # # Call the delete_version method. + # result = client.delete_version request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest + + # Converts hash and nil to an 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_version.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_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_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @versions_stub.delete_version 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 Versions REST API. + # + # This class represents the configuration for Versions 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::Dialogflow::V2::Versions::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_versions to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_versions.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_versions.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "dialogflow.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, 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 Versions 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_versions + ## + # RPC-specific configuration for `get_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_version + ## + # RPC-specific configuration for `create_version` + # @return [::Gapic::Config::Method] + # + attr_reader :create_version + ## + # RPC-specific configuration for `update_version` + # @return [::Gapic::Config::Method] + # + attr_reader :update_version + ## + # RPC-specific configuration for `delete_version` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_version + + # @private + def initialize parent_rpcs = nil + list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions + @list_versions = ::Gapic::Config::Method.new list_versions_config + get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version + @get_version = ::Gapic::Config::Method.new get_version_config + create_version_config = parent_rpcs.create_version if parent_rpcs.respond_to? :create_version + @create_version = ::Gapic::Config::Method.new create_version_config + update_version_config = parent_rpcs.update_version if parent_rpcs.respond_to? :update_version + @update_version = ::Gapic::Config::Method.new update_version_config + delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version + @delete_version = ::Gapic::Config::Method.new delete_version_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb new file mode 100644 index 000000000000..ded9b924bc8c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/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/dialogflow/v2/version_pb" + +module Google + module Cloud + module Dialogflow + module V2 + module Versions + module Rest + ## + # REST service stub for the Versions 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_versions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListVersionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::ListVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::ListVersionsResponse] + # A result object deserialized from the server's reply + def list_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_versions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::ListVersionsResponse.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_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Version] + # A result object deserialized from the server's reply + def get_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Version.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_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Version] + # A result object deserialized from the server's reply + def create_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Version.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_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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::Dialogflow::V2::Version] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Dialogflow::V2::Version] + # A result object deserialized from the server's reply + def update_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Dialogflow::V2::Version.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_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteVersionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default 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_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_version_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_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_version", + 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_versions REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::ListVersionsRequest] + # 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_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::GetVersionRequest] + # 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_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateVersionRequest] + # 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_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/versions", + body: "version", + matches: [ + ["parent", %r{^projects/[^/]+/agent/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}/versions", + body: "version", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateVersionRequest] + # 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_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{version.name}", + body: "version", + matches: [ + ["version.name", %r{^projects/[^/]+/agent/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{version.name}", + body: "version", + matches: [ + ["version.name", %r{^projects/[^/]+/locations/[^/]+/agent/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_version REST call + # + # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteVersionRequest] + # 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_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/agent/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/agent/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/webhook_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/webhook_pb.rb new file mode 100644 index 000000000000..b8f8c8e35938 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/webhook_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow/v2/webhook.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/dialogflow/v2/context_pb' +require 'google/cloud/dialogflow/v2/intent_pb' +require 'google/cloud/dialogflow/v2/session_pb' +require 'google/cloud/dialogflow/v2/session_entity_type_pb' +require 'google/protobuf/struct_pb' + + +descriptor_data = "\n(google/cloud/dialogflow/v2/webhook.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x19google/api/resource.proto\x1a(google/cloud/dialogflow/v2/context.proto\x1a\'google/cloud/dialogflow/v2/intent.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a\x34google/cloud/dialogflow/v2/session_entity_type.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xd6\x01\n\x0eWebhookRequest\x12\x0f\n\x07session\x18\x04 \x01(\t\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12=\n\x0cquery_result\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResult\x12_\n\x1eoriginal_detect_intent_request\x18\x03 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.OriginalDetectIntentRequest\"\x80\x03\n\x0fWebhookResponse\x12\x18\n\x10\x66ulfillment_text\x18\x01 \x01(\t\x12H\n\x14\x66ulfillment_messages\x18\x02 \x03(\x0b\x32*.google.cloud.dialogflow.v2.Intent.Message\x12\x0e\n\x06source\x18\x03 \x01(\t\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12<\n\x0foutput_contexts\x18\x05 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x44\n\x14\x66ollowup_event_input\x18\x06 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInput\x12K\n\x14session_entity_types\x18\n \x03(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\"h\n\x1bOriginalDetectIntentRequest\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12(\n\x07payload\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x91\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cWebhookProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Dialogflow + module V2 + WebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.WebhookRequest").msgclass + WebhookResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.WebhookResponse").msgclass + OriginalDetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OriginalDetectIntentRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/README.md new file mode 100644 index 000000000000..fa2293e709ea --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Dialogflow V2 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-dialogflow-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent.rb new file mode 100644 index 000000000000..fdc6b6706f55 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent.rb @@ -0,0 +1,338 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # A Dialogflow agent is a virtual agent that handles conversations with your + # end-users. It is a natural language understanding module that understands the + # nuances of human language. Dialogflow translates end-user text or audio + # during a conversation to structured data that your apps and services can + # understand. You design and build a Dialogflow agent to handle the types of + # conversations required for your system. + # + # For more information about agents, see the + # [Agent guide](https://cloud.google.com/dialogflow/docs/agents-overview). + # @!attribute [rw] parent + # @return [::String] + # Required. The project of this agent. + # Format: `projects/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The name of this agent. + # @!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. This field cannot be + # set by the `Update` method. + # @!attribute [rw] supported_language_codes + # @return [::Array<::String>] + # Optional. The list of all languages supported by this agent (except for the + # `default_language_code`). + # @!attribute [rw] time_zone + # @return [::String] + # Required. The time zone of this agent from the + # [time zone database](https://www.iana.org/time-zones), e.g., + # America/New_York, Europe/Paris. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of this agent. + # The maximum length is 500 characters. If exceeded, the request is rejected. + # @!attribute [rw] avatar_uri + # @return [::String] + # Optional. The URI of the agent's avatar. + # Avatars are used throughout the Dialogflow console and in the self-hosted + # [Web + # Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) + # integration. + # @!attribute [rw] enable_logging + # @return [::Boolean] + # Optional. Determines whether this agent should log conversation queries. + # @!attribute [rw] match_mode + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Dialogflow::V2::Agent::MatchMode] + # Optional. Determines how intents are detected from user queries. + # @!attribute [rw] classification_threshold + # @return [::Float] + # Optional. To filter out false positive results and still get variety in + # matched natural language inputs for your agent, you can tune the machine + # learning classification threshold. If the returned score value is less than + # the threshold value, then a fallback intent will be triggered or, if there + # are no fallback intents defined, no intent will be triggered. The score + # values range from 0.0 (completely uncertain) to 1.0 (completely certain). + # If set to 0.0, the default of 0.3 is used. + # @!attribute [rw] api_version + # @return [::Google::Cloud::Dialogflow::V2::Agent::ApiVersion] + # Optional. API version displayed in Dialogflow console. If not specified, + # V2 API is assumed. Clients are free to query different service endpoints + # for different API versions. However, bots connectors and webhook calls will + # follow the specified API version. + # @!attribute [rw] tier + # @return [::Google::Cloud::Dialogflow::V2::Agent::Tier] + # Optional. The agent tier. If not specified, TIER_STANDARD is assumed. + class Agent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Match mode determines how intents are detected from user queries. + module MatchMode + # Not specified. + MATCH_MODE_UNSPECIFIED = 0 + + # Best for agents with a small number of examples in intents and/or wide + # use of templates syntax and composite entities. + MATCH_MODE_HYBRID = 1 + + # Can be used for agents with a large number of examples in intents, + # especially the ones using @sys.any or very large custom entities. + MATCH_MODE_ML_ONLY = 2 + end + + # API version for the agent. + module ApiVersion + # Not specified. + API_VERSION_UNSPECIFIED = 0 + + # Legacy V1 API. + API_VERSION_V1 = 1 + + # V2 API. + API_VERSION_V2 = 2 + + # V2beta1 API. + API_VERSION_V2_BETA_1 = 3 + end + + # Represents the agent tier. + module Tier + # Not specified. This value should never be used. + TIER_UNSPECIFIED = 0 + + # Trial Edition, previously known as Standard Edition. + TIER_STANDARD = 1 + + # Essentials Edition, previously known as Enterprise Essential Edition. + TIER_ENTERPRISE = 2 + + # Essentials Edition (same as TIER_ENTERPRISE), previously known as + # Enterprise Plus Edition. + TIER_ENTERPRISE_PLUS = 3 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#get_agent Agents.GetAgent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project that the agent to fetch is associated with. + # Format: `projects/`. + class GetAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#set_agent Agents.SetAgent}. + # @!attribute [rw] agent + # @return [::Google::Cloud::Dialogflow::V2::Agent] + # Required. The agent to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields get updated. + class SetAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#delete_agent Agents.DeleteAgent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project that the agent to delete is associated with. + # Format: `projects/`. + class DeleteAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#search_agents Agents.SearchAgents}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project to list agents from. + # Format: `projects/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous list request. + class SearchAgentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#search_agents Agents.SearchAgents}. + # @!attribute [rw] agents + # @return [::Array<::Google::Cloud::Dialogflow::V2::Agent>] + # The list of agents. There will be a maximum number of items returned based + # on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class SearchAgentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent Agents.TrainAgent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project that the agent to train is associated with. + # Format: `projects/`. + class TrainAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#export_agent Agents.ExportAgent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project that the agent to export is associated with. + # Format: `projects/`. + # @!attribute [rw] agent_uri + # @return [::String] + # Required. The [Google Cloud + # Storage](https://cloud.google.com/storage/docs/) URI to export the agent + # to. The format of this URI must be `gs:///`. If + # left unspecified, the serialized agent is returned inline. + # + # Dialogflow performs a write operation for the Cloud Storage object + # on the caller's behalf, so your request authentication must + # have write permissions for the object. For more information, see + # [Dialogflow access + # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + class ExportAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#export_agent Agents.ExportAgent}. + # @!attribute [rw] agent_uri + # @return [::String] + # The URI to a file containing the exported agent. This field is populated + # only if `agent_uri` is specified in `ExportAgentRequest`. + # + # Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] agent_content + # @return [::String] + # Zip compressed raw byte content for agent. + # + # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ExportAgentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#import_agent Agents.ImportAgent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project that the agent to import is associated with. + # Format: `projects/`. + # @!attribute [rw] agent_uri + # @return [::String] + # The URI to a Google Cloud Storage file containing the agent to import. + # Note: The URI must start with "gs://". + # + # Dialogflow performs a read operation for the Cloud Storage object + # on the caller's behalf, so your request authentication must + # have read permissions for the object. For more information, see + # [Dialogflow access + # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] agent_content + # @return [::String] + # Zip compressed raw byte content for agent. + # + # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ImportAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#restore_agent Agents.RestoreAgent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project that the agent to restore is associated with. + # Format: `projects/`. + # @!attribute [rw] agent_uri + # @return [::String] + # The URI to a Google Cloud Storage file containing the agent to restore. + # Note: The URI must start with "gs://". + # + # Dialogflow performs a read operation for the Cloud Storage object + # on the caller's behalf, so your request authentication must + # have read permissions for the object. For more information, see + # [Dialogflow access + # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). + # + # Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] agent_content + # @return [::String] + # Zip compressed raw byte content for agent. + # + # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class RestoreAgentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Agents::Client#get_validation_result Agents.GetValidationResult}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project that the agent is associated with. + # Format: `projects/`. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language for which you want a validation result. If not + # specified, the agent's default language is used. [Many + # languages](https://cloud.google.com/dialogflow/docs/reference/language) + # are supported. Note: languages must be enabled in the agent before they can + # be used. + class GetValidationResultRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent_coaching_instruction.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent_coaching_instruction.rb new file mode 100644 index 000000000000..1700c7870d25 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent_coaching_instruction.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! + + +module Google + module Cloud + module Dialogflow + module V2 + # Agent Coaching instructions that customer can configure. + # @!attribute [rw] display_name + # @return [::String] + # Optional. Display name for the instruction. + # @!attribute [rw] display_details + # @return [::String] + # Optional. The detailed description of this instruction. + # @!attribute [rw] condition + # @return [::String] + # Optional. The condition of the instruction. For example, "the customer + # wants to cancel an order". If the users want the instruction to be + # triggered unconditionally, the condition can be empty. + # @!attribute [rw] agent_action + # @return [::String] + # Optional. The action that human agent should take. For example, "apologize + # for the slow shipping". If the users only want to use agent coaching for + # intent detection, agent_action can be empty + # @!attribute [rw] system_action + # @return [::String] + # Optional. The action that system should take. For example, + # "call GetOrderTime with order_number={order number provided by the + # customer}". If the users don't have plugins or don't want to trigger + # plugins, the system_action can be empty + # @!attribute [r] duplicate_check_result + # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction::DuplicateCheckResult] + # Output only. Duplication check for the AgentCoachingInstruction. + # @!attribute [rw] triggering_event + # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction::TriggerEvent] + # Optional. The event that should trigger this instruction. + # If UNSPECIFIED, the instruction triggering will be same as the generator's + # trigger_event. + class AgentCoachingInstruction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Duplication check for the suggestion. + # @!attribute [r] duplicate_suggestions + # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction::DuplicateCheckResult::DuplicateSuggestion>] + # Output only. The duplicate suggestions. + class DuplicateCheckResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The duplicate suggestion details. + # @!attribute [r] answer_record + # @return [::String] + # Output only. The answer record id of the past duplicate suggestion. + # @!attribute [r] suggestion_index + # @return [::Integer] + # Output only. The index of the duplicate suggestion in the past + # suggestion list. + # @!attribute [r] similarity_score + # @return [::Float] + # Output only. The similarity score of between the past and current + # suggestion. + class DuplicateSuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The event that should trigger this instruction. + module TriggerEvent + # Default value for TriggerEvent. + TRIGGER_EVENT_UNSPECIFIED = 0 + + # Triggers when each chat message or voice utterance ends. + END_OF_UTTERANCE = 1 + + # Triggers on the conversation manually by API calls. + MANUAL_CALL = 2 + + # Triggers after each customer message. + CUSTOMER_MESSAGE = 3 + + # Triggers after each agent message. + AGENT_MESSAGE = 4 + + # Triggers on tool call completion. + TOOL_CALL_COMPLETION = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/answer_record.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/answer_record.rb new file mode 100644 index 000000000000..0cad197bb7eb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/answer_record.rb @@ -0,0 +1,360 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Answer records are records to manage answer history and feedbacks for + # Dialogflow. + # + # Currently, answer record includes: + # + # - human agent assistant article suggestion + # - human agent assistant faq article + # + # It doesn't include: + # + # - `DetectIntent` intent matching + # - `DetectIntent` knowledge + # + # Answer records are not related to the conversation history in the + # Dialogflow Console. A Record is generated even when the end-user disables + # conversation history in the console. Records are created when there's a human + # agent assistant suggestion generated. + # + # A typical workflow for customers provide feedback to an answer is: + # + # 1. For human agent assistant, customers get suggestion via ListSuggestions + # API. Together with the answers, + # {::Google::Cloud::Dialogflow::V2::AnswerRecord#name AnswerRecord.name} are + # returned to the customers. + # 2. The customer uses the + # {::Google::Cloud::Dialogflow::V2::AnswerRecord#name AnswerRecord.name} to call the + # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record AnswerRecords.UpdateAnswerRecord} + # method to send feedback about a specific answer that they believe is + # wrong. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of this answer record. + # Format: `projects//locations//answerRecords/`. + # @!attribute [rw] answer_feedback + # @return [::Google::Cloud::Dialogflow::V2::AnswerFeedback] + # Required. The AnswerFeedback for this record. You can set this with + # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record AnswerRecords.UpdateAnswerRecord} + # in order to give us feedback about this answer. + # @!attribute [r] agent_assistant_record + # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantRecord] + # Output only. The record for human agent assistant. + class AnswerRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records AnswerRecords.ListAnswerRecords}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project to list all answer records for in reverse + # chronological order. Format: `projects//locations/`. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filters to restrict results to specific answer records. The + # expression has the following syntax: + # + # [AND ] ... + # + # The following fields and operators are supported: + # * conversation_id with equals(=) operator + # + # Examples: + # + # * `conversation_id=bar` matches answer records in the + # `projects/foo/locations/global/conversations/bar` conversation + # (assuming the parent is `projects/foo/locations/global`). + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of records to return in a single page. + # The server may return fewer records than this. If unspecified, we use 10. + # The maximum is 100. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The + # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse#next_page_token ListAnswerRecordsResponse.next_page_token} + # value returned from a previous list request used to continue listing on + # the next page. + class ListAnswerRecordsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records AnswerRecords.ListAnswerRecords}. + # @!attribute [rw] answer_records + # @return [::Array<::Google::Cloud::Dialogflow::V2::AnswerRecord>] + # The list of answer records. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. Or empty if there are no more + # results. + # Pass this value in the + # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest#page_token ListAnswerRecordsRequest.page_token} + # field in the subsequent call to `ListAnswerRecords` method to retrieve the + # next page of results. + class ListAnswerRecordsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record AnswerRecords.UpdateAnswerRecord}. + # @!attribute [rw] answer_record + # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord] + # Required. Answer record to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to control which fields get updated. + class UpdateAnswerRecordRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents feedback the customer has about the quality & correctness of a + # certain answer in a conversation. + # @!attribute [rw] correctness_level + # @return [::Google::Cloud::Dialogflow::V2::AnswerFeedback::CorrectnessLevel] + # The correctness level of the specific answer. + # @!attribute [rw] agent_assistant_detail_feedback + # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback] + # Detail feedback of agent assist suggestions. + # @!attribute [rw] clicked + # @return [::Boolean] + # Indicates whether the answer/item was clicked by the human agent + # or not. Default to false. + # For knowledge search and knowledge assist, the answer record is considered + # to be clicked if the answer was copied or any URI was clicked. + # @!attribute [rw] click_time + # @return [::Google::Protobuf::Timestamp] + # Time when the answer/item was clicked. + # @!attribute [rw] displayed + # @return [::Boolean] + # Indicates whether the answer/item was displayed to the human + # agent in the agent desktop UI. Default to false. + # @!attribute [rw] display_time + # @return [::Google::Protobuf::Timestamp] + # Time when the answer/item was displayed. + class AnswerFeedback + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The correctness level of an answer. + module CorrectnessLevel + # Correctness level unspecified. + CORRECTNESS_LEVEL_UNSPECIFIED = 0 + + # Answer is totally wrong. + NOT_CORRECT = 1 + + # Answer is partially correct. + PARTIALLY_CORRECT = 2 + + # Answer is fully correct. + FULLY_CORRECT = 3 + end + end + + # Detail feedback of Agent Assist result. + # @!attribute [rw] answer_relevance + # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::AnswerRelevance] + # Optional. Whether or not the suggested answer is relevant. + # + # For example: + # + # * Query: "Can I change my mailing address?" + # * Suggested document says: "Items must be returned/exchanged within 60 + # days of the purchase date." + # * {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback#answer_relevance answer_relevance}: {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::AnswerRelevance::IRRELEVANT AnswerRelevance.IRRELEVANT} + # @!attribute [rw] document_correctness + # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentCorrectness] + # Optional. Whether or not the information in the document is correct. + # + # For example: + # + # * Query: "Can I return the package in 2 days once received?" + # * Suggested document says: "Items must be returned/exchanged within 60 + # days of the purchase date." + # * Ground truth: "No return or exchange is allowed." + # * {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback#document_correctness document_correctness}: {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentCorrectness::INCORRECT INCORRECT} + # @!attribute [rw] document_efficiency + # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentEfficiency] + # Optional. Whether or not the suggested document is efficient. For example, + # if the document is poorly written, hard to understand, hard to use or + # too long to find useful information, + # {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback#document_efficiency document_efficiency} + # is + # {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentEfficiency::INEFFICIENT DocumentEfficiency.INEFFICIENT}. + # @!attribute [rw] summarization_feedback + # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::SummarizationFeedback] + # Optional. Feedback for conversation summarization. + # @!attribute [rw] knowledge_search_feedback + # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::KnowledgeSearchFeedback] + # Optional. Feedback for knowledge search. + # @!attribute [rw] knowledge_assist_feedback + # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::KnowledgeAssistFeedback] + # Optional. Feedback for knowledge assist. + class AgentAssistantFeedback + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Feedback for conversation summarization. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when composing of the summary starts. + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when the summary was submitted. + # @!attribute [rw] summary_text + # @return [::String] + # Text of actual submitted summary. + # @!attribute [rw] text_sections + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Actual text sections of submitted summary. + class SummarizationFeedback + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TextSectionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Feedback for knowledge search. + # @!attribute [rw] answer_copied + # @return [::Boolean] + # Whether the answer was copied by the human agent or not. + # If the value is set to be true, + # {::Google::Cloud::Dialogflow::V2::AnswerFeedback#clicked AnswerFeedback.clicked} + # will be updated to be true. + # @!attribute [rw] clicked_uris + # @return [::Array<::String>] + # The URIs clicked by the human agent. The value is appended for each + # {::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest UpdateAnswerRecordRequest}. + # If the value is not empty, + # {::Google::Cloud::Dialogflow::V2::AnswerFeedback#clicked AnswerFeedback.clicked} + # will be updated to be true. + class KnowledgeSearchFeedback + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Feedback for knowledge assist. + # @!attribute [rw] answer_copied + # @return [::Boolean] + # Whether the suggested answer was copied by the human agent. + # If the value is set to be true, + # {::Google::Cloud::Dialogflow::V2::AnswerFeedback#clicked AnswerFeedback.clicked} + # will be updated to be true. + # @!attribute [rw] clicked_uris + # @return [::Array<::String>] + # The URIs clicked by the human agent. The value is appended for each + # UpdateAnswerRecordRequest. + # If the value is not empty, + # {::Google::Cloud::Dialogflow::V2::AnswerFeedback#clicked AnswerFeedback.clicked} + # will be updated to be true. + class KnowledgeAssistFeedback + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Relevance of an answer. + module AnswerRelevance + # Answer relevance unspecified. + ANSWER_RELEVANCE_UNSPECIFIED = 0 + + # Answer is irrelevant to query. + IRRELEVANT = 1 + + # Answer is relevant to query. + RELEVANT = 2 + end + + # Correctness of document. + module DocumentCorrectness + # Document correctness unspecified. + DOCUMENT_CORRECTNESS_UNSPECIFIED = 0 + + # Information in document is incorrect. + INCORRECT = 1 + + # Information in document is correct. + CORRECT = 2 + end + + # Efficiency of document. + module DocumentEfficiency + # Document efficiency unspecified. + DOCUMENT_EFFICIENCY_UNSPECIFIED = 0 + + # Document is inefficient. + INEFFICIENT = 1 + + # Document is efficient. + EFFICIENT = 2 + end + end + + # Represents a record of a human agent assist answer. + # @!attribute [r] article_suggestion_answer + # @return [::Google::Cloud::Dialogflow::V2::ArticleAnswer] + # Output only. The article suggestion answer. + # + # Note: The following fields are mutually exclusive: `article_suggestion_answer`, `faq_answer`, `dialogflow_assist_answer`, `generator_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] faq_answer + # @return [::Google::Cloud::Dialogflow::V2::FaqAnswer] + # Output only. The FAQ answer. + # + # Note: The following fields are mutually exclusive: `faq_answer`, `article_suggestion_answer`, `dialogflow_assist_answer`, `generator_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] dialogflow_assist_answer + # @return [::Google::Cloud::Dialogflow::V2::DialogflowAssistAnswer] + # Output only. Dialogflow assist answer. + # + # Note: The following fields are mutually exclusive: `dialogflow_assist_answer`, `article_suggestion_answer`, `faq_answer`, `generator_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] generator_suggestion + # @return [::Google::Cloud::Dialogflow::V2::GeneratorSuggestion] + # Output only. The generator suggestion. + # + # Note: The following fields are mutually exclusive: `generator_suggestion`, `article_suggestion_answer`, `faq_answer`, `dialogflow_assist_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AgentAssistantRecord + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb new file mode 100644 index 000000000000..8c2ab31aa3a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb @@ -0,0 +1,573 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Hints for the speech recognizer to help with recognition in a specific + # conversation state. + # @!attribute [rw] phrases + # @return [::Array<::String>] + # Optional. A list of strings containing words and phrases that the speech + # recognizer should recognize with higher likelihood. + # + # This list can be used to: + # + # * improve accuracy for words and phrases you expect the user to say, + # e.g. typical commands for your Dialogflow agent + # * add additional words to the speech recognizer vocabulary + # * ... + # + # See the [Cloud Speech + # documentation](https://cloud.google.com/speech-to-text/quotas) for usage + # limits. + # @!attribute [rw] boost + # @return [::Float] + # Optional. Boost for this context compared to other contexts: + # + # * If the boost is positive, Dialogflow will increase the probability that + # the phrases in this context are recognized over similar sounding phrases. + # * If the boost is unspecified or non-positive, Dialogflow will not apply + # any boost. + # + # Dialogflow recommends that you use boosts in the range (0, 20] and that you + # find a value that fits your use case with binary search. + class SpeechContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information for a word recognized by the speech recognizer. + # @!attribute [rw] word + # @return [::String] + # The word this info is for. + # @!attribute [rw] start_offset + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio that corresponds to the + # start of the spoken word. This is an experimental feature and the accuracy + # of the time offset can vary. + # @!attribute [rw] end_offset + # @return [::Google::Protobuf::Duration] + # Time offset relative to the beginning of the audio that corresponds to the + # end of the spoken word. This is an experimental feature and the accuracy of + # the time offset can vary. + # @!attribute [rw] confidence + # @return [::Float] + # The Speech confidence between 0.0 and 1.0 for this word. A higher number + # indicates an estimated greater likelihood that the recognized word is + # correct. The default of 0.0 is a sentinel value indicating that confidence + # was not set. + # + # This field is not guaranteed to be fully stable over time for the same + # audio input. Users should also not rely on it to always be provided. + class SpeechWordInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Instructs the speech recognizer how to process the audio content. + # @!attribute [rw] audio_encoding + # @return [::Google::Cloud::Dialogflow::V2::AudioEncoding] + # Required. Audio encoding of the audio content to process. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Required. Sample rate (in Hertz) of the audio content sent in the query. + # Refer to [Cloud Speech API + # documentation](https://cloud.google.com/speech-to-text/docs/basics) for + # more details. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language of the supplied audio. Dialogflow does not do + # translations. See [Language + # Support](https://cloud.google.com/dialogflow/docs/reference/language) + # for a list of the currently supported language codes. Note that queries in + # the same session do not necessarily need to specify the same language. + # If not set, the language is inferred from the + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#stt_config ConversationProfile.stt_config}. + # @!attribute [rw] enable_word_info + # @return [::Boolean] + # If `true`, Dialogflow returns + # {::Google::Cloud::Dialogflow::V2::SpeechWordInfo SpeechWordInfo} in + # {::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult StreamingRecognitionResult} + # with information about the recognized speech words, e.g. start and end time + # offsets. If false or unspecified, Speech doesn't return any word-level + # information. + # @!attribute [rw] phrase_hints + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # A list of strings containing words and phrases that the speech + # recognizer should recognize with higher likelihood. + # + # See [the Cloud Speech + # documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + # for more details. + # + # This field is deprecated. Please use [`speech_contexts`]() instead. If you + # specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will + # treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). + # @!attribute [rw] speech_contexts + # @return [::Array<::Google::Cloud::Dialogflow::V2::SpeechContext>] + # Context information to assist speech recognition. + # + # See [the Cloud Speech + # documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) + # for more details. + # @!attribute [rw] model + # @return [::String] + # Optional. Which Speech model to select for the given request. + # For more information, see + # [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). + # @!attribute [rw] model_variant + # @return [::Google::Cloud::Dialogflow::V2::SpeechModelVariant] + # Which variant of the [Speech + # model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + # @!attribute [rw] single_utterance + # @return [::Boolean] + # If `false` (default), recognition does not cease until the + # client closes the stream. + # If `true`, the recognizer will detect a single spoken utterance in input + # audio. Recognition ceases when it detects the audio's voice has + # stopped or paused. In this case, once a detected intent is received, the + # client should close the stream and start a new request with a new stream as + # needed. + # Note: This setting is relevant only for streaming methods. + # Note: When specified, InputAudioConfig.single_utterance takes precedence + # over StreamingDetectIntentRequest.single_utterance. + # @!attribute [rw] disable_no_speech_recognized_event + # @return [::Boolean] + # Only used in + # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} + # and + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent}. + # If `false` and recognition doesn't return any result, trigger + # `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + # @!attribute [rw] enable_automatic_punctuation + # @return [::Boolean] + # Enable automatic punctuation option at the speech backend. + # @!attribute [rw] phrase_sets + # @return [::Array<::String>] + # A collection of phrase set resources to use for speech adaptation. + # @!attribute [rw] opt_out_conformer_model_migration + # @return [::Boolean] + # If `true`, the request will opt out for STT conformer model migration. + # This field will be deprecated once force migration takes place in June + # 2024. Please refer to [Dialogflow ES Speech model + # migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). + class InputAudioConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Description of which voice to use for speech synthesis. + # @!attribute [rw] name + # @return [::String] + # Optional. The name of the voice. If not set, the service will choose a + # voice based on the other parameters such as language_code and + # {::Google::Cloud::Dialogflow::V2::VoiceSelectionParams#ssml_gender ssml_gender}. + # @!attribute [rw] ssml_gender + # @return [::Google::Cloud::Dialogflow::V2::SsmlVoiceGender] + # Optional. The preferred gender of the voice. If not set, the service will + # choose a voice based on the other parameters such as language_code and + # {::Google::Cloud::Dialogflow::V2::VoiceSelectionParams#name name}. Note that + # this is only a preference, not requirement. If a voice of the appropriate + # gender is not available, the synthesizer should substitute a voice with a + # different gender rather than failing the request. + class VoiceSelectionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of how speech should be synthesized. + # @!attribute [rw] speaking_rate + # @return [::Float] + # Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + # native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 + # is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other + # values < 0.25 or > 4.0 will return an error. + # @!attribute [rw] pitch + # @return [::Float] + # Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + # semitones from the original pitch. -20 means decrease 20 semitones from the + # original pitch. + # @!attribute [rw] volume_gain_db + # @return [::Float] + # Optional. Volume gain (in dB) of the normal native volume supported by the + # specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of + # 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) + # will play at approximately half the amplitude of the normal native signal + # amplitude. A value of +6.0 (dB) will play at approximately twice the + # amplitude of the normal native signal amplitude. We strongly recommend not + # to exceed +10 (dB) as there's usually no effective increase in loudness for + # any value greater than that. + # @!attribute [rw] effects_profile_id + # @return [::Array<::String>] + # Optional. An identifier which selects 'audio effects' profiles that are + # applied on (post synthesized) text to speech. Effects are applied on top of + # each other in the order they are given. + # @!attribute [rw] voice + # @return [::Google::Cloud::Dialogflow::V2::VoiceSelectionParams] + # Optional. The desired voice of the synthesized audio. + # @!attribute [rw] pronunciations + # @return [::Array<::Google::Cloud::Dialogflow::V2::CustomPronunciationParams>] + # Optional. The custom pronunciations for the synthesized audio. + class SynthesizeSpeechConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Pronunciation customization for a phrase. + # @!attribute [rw] phrase + # @return [::String] + # The phrase to which the customization is applied. + # The phrase can be multiple words, such as proper nouns, but shouldn't span + # the length of the sentence. + # @!attribute [rw] phonetic_encoding + # @return [::Google::Cloud::Dialogflow::V2::CustomPronunciationParams::PhoneticEncoding] + # The phonetic encoding of the phrase. + # @!attribute [rw] pronunciation + # @return [::String] + # The pronunciation of the phrase. This must be in the phonetic encoding + # specified above. + class CustomPronunciationParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The phonetic encoding of the phrase. + module PhoneticEncoding + # Not specified. + PHONETIC_ENCODING_UNSPECIFIED = 0 + + # IPA, such as apple -> ˈæpəl. + # https://en.wikipedia.org/wiki/International_Phonetic_Alphabet + PHONETIC_ENCODING_IPA = 1 + + # X-SAMPA, such as apple -> "{p@l". + # https://en.wikipedia.org/wiki/X-SAMPA + PHONETIC_ENCODING_X_SAMPA = 2 + end + end + + # Instructs the speech synthesizer on how to generate the output audio content. + # If this audio config is supplied in a request, it overrides all existing + # text-to-speech settings applied to the agent. + # @!attribute [rw] audio_encoding + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioEncoding] + # Required. Audio encoding of the synthesized audio content. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # The synthesis sample rate (in hertz) for this audio. If not + # provided, then the synthesizer will use the default sample rate based on + # the audio encoding. If this is different from the voice's natural sample + # rate, then the synthesizer will honor this request by converting to the + # desired sample rate (which might result in worse audio quality). + # @!attribute [rw] synthesize_speech_config + # @return [::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig] + # Configuration of how speech should be synthesized. + class OutputAudioConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A wrapper of repeated TelephonyDtmf digits. + # @!attribute [rw] dtmf_events + # @return [::Array<::Google::Cloud::Dialogflow::V2::TelephonyDtmf>] + # A sequence of TelephonyDtmf digits. + class TelephonyDtmfEvents + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configures speech transcription for + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile}. + # @!attribute [rw] speech_model_variant + # @return [::Google::Cloud::Dialogflow::V2::SpeechModelVariant] + # The speech model used in speech to text. + # `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as + # `USE_ENHANCED`. It can be overridden in + # {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest AnalyzeContentRequest} + # and + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest StreamingAnalyzeContentRequest} + # request. If enhanced model variant is specified and an enhanced version of + # the specified model for the language does not exist, then it would emit an + # error. + # @!attribute [rw] model + # @return [::String] + # Which Speech model to select. Select the + # model best suited to your domain to get best results. If a model is not + # explicitly specified, then Dialogflow auto-selects a model based on other + # parameters in the SpeechToTextConfig and Agent settings. + # If enhanced speech model is enabled for the agent and an enhanced + # version of the specified model for the language does not exist, then the + # speech is recognized using the standard version of the specified model. + # Refer to + # [Cloud Speech API + # documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + # for more details. + # If you specify a model, the following models typically have the best + # performance: + # + # - phone_call (best for Agent Assist and telephony) + # - latest_short (best for Dialogflow non-telephony) + # - command_and_search + # + # Leave this field unspecified to use + # [Agent Speech + # settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) + # for model selection. + # @!attribute [rw] phrase_sets + # @return [::Array<::String>] + # List of names of Cloud Speech phrase sets that are used for transcription. + # For phrase set limitations, please refer to [Cloud Speech API quotas and + # limits](https://cloud.google.com/speech-to-text/quotas#content). + # @!attribute [rw] audio_encoding + # @return [::Google::Cloud::Dialogflow::V2::AudioEncoding] + # Audio encoding of the audio content to process. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Sample rate (in Hertz) of the audio content sent in the query. + # Refer to [Cloud Speech API + # documentation](https://cloud.google.com/speech-to-text/docs/basics) for + # more details. + # @!attribute [rw] language_code + # @return [::String] + # The language of the supplied audio. Dialogflow does not do + # translations. See [Language + # Support](https://cloud.google.com/dialogflow/docs/reference/language) + # for a list of the currently supported language codes. Note that queries in + # the same session do not necessarily need to specify the same language. + # If not specified, the default language configured at + # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} is + # used. + # @!attribute [rw] enable_word_info + # @return [::Boolean] + # If `true`, Dialogflow returns + # {::Google::Cloud::Dialogflow::V2::SpeechWordInfo SpeechWordInfo} in + # {::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult StreamingRecognitionResult} + # with information about the recognized speech words, e.g. start and end time + # offsets. If false or unspecified, Speech doesn't return any word-level + # information. + # @!attribute [rw] use_timeout_based_endpointing + # @return [::Boolean] + # Use timeout based endpointing, interpreting endpointer sensitivity as + # seconds of timeout value. + class SpeechToTextConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling) + # digit in Telephony Gateway. + module TelephonyDtmf + # Not specified. This value may be used to indicate an absent digit. + TELEPHONY_DTMF_UNSPECIFIED = 0 + + # Number: '1'. + DTMF_ONE = 1 + + # Number: '2'. + DTMF_TWO = 2 + + # Number: '3'. + DTMF_THREE = 3 + + # Number: '4'. + DTMF_FOUR = 4 + + # Number: '5'. + DTMF_FIVE = 5 + + # Number: '6'. + DTMF_SIX = 6 + + # Number: '7'. + DTMF_SEVEN = 7 + + # Number: '8'. + DTMF_EIGHT = 8 + + # Number: '9'. + DTMF_NINE = 9 + + # Number: '0'. + DTMF_ZERO = 10 + + # Letter: 'A'. + DTMF_A = 11 + + # Letter: 'B'. + DTMF_B = 12 + + # Letter: 'C'. + DTMF_C = 13 + + # Letter: 'D'. + DTMF_D = 14 + + # Asterisk/star: '*'. + DTMF_STAR = 15 + + # Pound/diamond/hash/square/gate/octothorpe: '#'. + DTMF_POUND = 16 + end + + # Audio encoding of the audio content sent in the conversational query request. + # Refer to the + # [Cloud Speech API + # documentation](https://cloud.google.com/speech-to-text/docs/basics) for more + # details. + module AudioEncoding + # Not specified. + AUDIO_ENCODING_UNSPECIFIED = 0 + + # Uncompressed 16-bit signed little-endian samples (Linear PCM). + AUDIO_ENCODING_LINEAR_16 = 1 + + # [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio + # Codec) is the recommended encoding because it is lossless (therefore + # recognition is not compromised) and requires only about half the + # bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and + # 24-bit samples, however, not all fields in `STREAMINFO` are supported. + AUDIO_ENCODING_FLAC = 2 + + # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + AUDIO_ENCODING_MULAW = 3 + + # Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AUDIO_ENCODING_AMR = 4 + + # Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_AMR_WB = 5 + + # Opus encoded audio frames in Ogg container + # ([OggOpus](https://wiki.xiph.org/OggOpus)). + # `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_OGG_OPUS = 6 + + # Although the use of lossy encodings is not recommended, if a very low + # bitrate encoding is required, `OGG_OPUS` is highly preferred over + # Speex encoding. The [Speex](https://speex.org/) encoding supported by + # Dialogflow API has a header byte in each block, as in MIME type + # `audio/x-speex-with-header-byte`. + # It is a variant of the RTP Speex encoding defined in + # [RFC 5574](https://tools.ietf.org/html/rfc5574). + # The stream is a sequence of blocks, one block per RTP packet. Each block + # starts with a byte containing the length of the block, in bytes, followed + # by one or more frames of Speex data, padded to an integral number of + # bytes (octets) as specified in RFC 5574. In other words, each RTP header + # is replaced with a single byte containing the block length. Only Speex + # wideband is supported. `sample_rate_hertz` must be 16000. + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 + + # 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + AUDIO_ENCODING_ALAW = 8 + end + + # Variant of the specified [Speech + # model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. + # + # See the [Cloud Speech + # documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + # for which models have different variants. For example, the "phone_call" model + # has both a standard and an enhanced variant. When you use an enhanced model, + # you will generally receive higher quality results than for a standard model. + module SpeechModelVariant + # No model variant specified. In this case Dialogflow defaults to + # USE_BEST_AVAILABLE. + SPEECH_MODEL_VARIANT_UNSPECIFIED = 0 + + # Use the best available variant of the [Speech model][model] that the caller + # is eligible for. + # + # Please see the [Dialogflow + # docs](https://cloud.google.com/dialogflow/docs/data-logging) for + # how to make your project eligible for enhanced models. + USE_BEST_AVAILABLE = 1 + + # Use standard model variant even if an enhanced model is available. See the + # [Cloud Speech + # documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + # for details about enhanced models. + USE_STANDARD = 2 + + # Use an enhanced model variant: + # + # * If an enhanced variant does not exist for the given + # {::Google::Cloud::Dialogflow::V2::InputAudioConfig#model model} and request + # language, Dialogflow falls back to the standard variant. + # + # The [Cloud Speech + # documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) + # describes which models have enhanced variants. + # + # * If the API caller isn't eligible for enhanced models, Dialogflow returns + # an error. Please see the [Dialogflow + # docs](https://cloud.google.com/dialogflow/docs/data-logging) + # for how to make your project eligible. + USE_ENHANCED = 3 + end + + # Gender of the voice as described in + # [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). + module SsmlVoiceGender + # An unspecified gender, which means that the client doesn't care which + # gender the selected voice will have. + SSML_VOICE_GENDER_UNSPECIFIED = 0 + + # A male voice. + SSML_VOICE_GENDER_MALE = 1 + + # A female voice. + SSML_VOICE_GENDER_FEMALE = 2 + + # A gender-neutral voice. + SSML_VOICE_GENDER_NEUTRAL = 3 + end + + # Audio encoding of the output audio format in Text-To-Speech. + module OutputAudioEncoding + # Not specified. + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0 + + # Uncompressed 16-bit signed little-endian samples (Linear PCM). + # Audio content returned as LINEAR16 also contains a WAV header. + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1 + + # MP3 audio at 64kbps. + OUTPUT_AUDIO_ENCODING_MP3 = 2 + + # MP3 audio at 64kbps. + OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4 + + # Opus encoded audio wrapped in an ogg container. The result will be a + # file which can be played natively on Android, and in browsers (at least + # Chrome and Firefox). The quality of the encoding is considerably higher + # than MP3 while using approximately the same bitrate. + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3 + + # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + OUTPUT_AUDIO_ENCODING_MULAW = 5 + + # 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. + OUTPUT_AUDIO_ENCODING_ALAW = 6 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb new file mode 100644 index 000000000000..4ca1b2a80b54 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.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! + + +module Google + module Cloud + module Dialogflow + module V2 + # Spec of CES app that the generator can choose from. + # @!attribute [rw] ces_app + # @return [::String] + # Optional. Format: `projects//locations//apps/`. + # @!attribute [rw] confirmation_requirement + # @return [::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement] + # Optional. Indicates whether the app requires human confirmation. + # @!attribute [rw] proactive_enabled + # @return [::Boolean] + # Optional. Only applicable for CompanionAgent. + # Indicates whether the ces app is enabled in proactive mode. + # At least one of `proactive_enabled` or `reactive_enabled` should be + # true; otherwise, the ces app will be ignored. + # @!attribute [rw] reactive_enabled + # @return [::Boolean] + # Optional. Only applicable for CompanionAgent. + # Indicates whether the ces app is enabled in reactive mode. + # At least one of `proactive_enabled` or `reactive_enabled` should be + # true; otherwise, the ces app will be ignored. + class CesAppSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_tool.rb new file mode 100644 index 000000000000..6919735037fb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_tool.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 Dialogflow + module V2 + # Spec of CES tool that the generator can choose from. + # @!attribute [rw] ces_tool + # @return [::String] + # Optional. Format: `projects//locations//apps//tools/`. + # @!attribute [rw] confirmation_requirement + # @return [::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement] + # Optional. Indicates whether the tool requires human confirmation. + class CesToolSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/context.rb new file mode 100644 index 000000000000..5efa6c079177 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/context.rb @@ -0,0 +1,200 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Dialogflow contexts are similar to natural language context. If a person says + # to you "they are orange", you need context in order to understand what "they" + # is referring to. Similarly, for Dialogflow to handle an end-user expression + # like that, it needs to be provided with context in order to correctly match + # an intent. + # + # Using contexts, you can control the flow of a conversation. You can configure + # contexts for an intent by setting input and output contexts, which are + # identified by string names. When an intent is matched, any configured output + # contexts for that intent become active. While any contexts are active, + # Dialogflow is more likely to match intents that are configured with input + # contexts that correspond to the currently active contexts. + # + # For more information about context, see the + # [Contexts guide](https://cloud.google.com/dialogflow/docs/contexts-overview). + # @!attribute [rw] name + # @return [::String] + # Required. The unique identifier of the context. Format: + # `projects//agent/sessions//contexts/`, + # or `projects//agent/environments//users//sessions//contexts/`. + # + # The `Context ID` is always converted to lowercase, may only contain + # characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. + # + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # + # The following context names are reserved for internal use by Dialogflow. + # You should not use these contexts or create contexts with these names: + # + # * `__system_counters__` + # * `*_id_dialog_context` + # * `*_dialog_params_size` + # @!attribute [rw] lifespan_count + # @return [::Integer] + # Optional. The number of conversational query requests after which the + # context expires. The default is `0`. If set to `0`, the context expires + # immediately. Contexts expire automatically after 20 minutes if there + # are no matching queries. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Struct] + # Optional. The collection of parameters associated with this context. + # + # Depending on your protocol or client library language, this is a + # map, associative array, symbol table, dictionary, or JSON object + # composed of a collection of (MapKey, MapValue) pairs: + # + # * MapKey type: string + # * MapKey value: parameter name + # * MapValue type: If parameter's entity type is a composite entity then use + # map, otherwise, depending on the parameter value type, it could be one of + # string, number, boolean, null, list or map. + # * MapValue value: If parameter's entity type is a composite entity then use + # map from composite entity property names to property values, otherwise, + # use parameter value. + class Context + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Contexts::Client#list_contexts Contexts.ListContexts}. + # @!attribute [rw] parent + # @return [::String] + # Required. The session to list all contexts from. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListContextsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Contexts::Client#list_contexts Contexts.ListContexts}. + # @!attribute [rw] contexts + # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] + # The list of contexts. There will be a maximum number of items + # returned based on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListContextsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Contexts::Client#get_context Contexts.GetContext}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the context. Format: + # `projects//agent/sessions//contexts/` + # or `projects//agent/environments//users//sessions//contexts/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + class GetContextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Contexts::Client#create_context Contexts.CreateContext}. + # @!attribute [rw] parent + # @return [::String] + # Required. The session to create a context for. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users//sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @!attribute [rw] context + # @return [::Google::Cloud::Dialogflow::V2::Context] + # Required. The context to create. + class CreateContextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Contexts::Client#update_context Contexts.UpdateContext}. + # @!attribute [rw] context + # @return [::Google::Cloud::Dialogflow::V2::Context] + # Required. The context to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields get updated. + class UpdateContextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Contexts::Client#delete_context Contexts.DeleteContext}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the context to delete. Format: + # `projects//agent/sessions//contexts/` + # or `projects//agent/environments//users//sessions//contexts/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + class DeleteContextRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Contexts::Client#delete_all_contexts Contexts.DeleteAllContexts}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the session to delete all contexts from. Format: + # `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + # If `Environment ID` is not specified we assume default 'draft' environment. + # If `User ID` is not specified, we assume default '-' user. + class DeleteAllContextsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb new file mode 100644 index 000000000000..31e89b56d0a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb @@ -0,0 +1,1150 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Represents a conversation. + # A conversation is an interaction between an agent, including live agents + # and Dialogflow agents, and a support customer. Conversations can + # include phone calls and text-based chat sessions. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The unique identifier of this conversation. + # Format: `projects//locations//conversations/`. + # @!attribute [r] lifecycle_state + # @return [::Google::Cloud::Dialogflow::V2::Conversation::LifecycleState] + # Output only. The current state of the Conversation. + # @!attribute [rw] conversation_profile + # @return [::String] + # Required. The Conversation Profile to be used to configure this + # Conversation. This field cannot be updated. + # Format: `projects//locations//conversationProfiles/`. + # @!attribute [r] phone_number + # @return [::Google::Cloud::Dialogflow::V2::ConversationPhoneNumber] + # Output only. It will not be empty if the conversation is to be connected + # over telephony. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the conversation was started. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the conversation was finished. + # @!attribute [rw] conversation_stage + # @return [::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage] + # Optional. The stage of a conversation. It indicates whether the virtual + # agent or a human agent is handling the conversation. + # + # If the conversation is created with the conversation profile that has + # Dialogflow config set, defaults to + # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::VIRTUAL_AGENT_STAGE ConversationStage.VIRTUAL_AGENT_STAGE}; + # Otherwise, defaults to + # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::HUMAN_ASSIST_STAGE ConversationStage.HUMAN_ASSIST_STAGE}. + # + # If the conversation is created with the conversation profile that has + # Dialogflow config set but explicitly sets conversation_stage to + # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::HUMAN_ASSIST_STAGE ConversationStage.HUMAN_ASSIST_STAGE}, + # it skips + # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::VIRTUAL_AGENT_STAGE ConversationStage.VIRTUAL_AGENT_STAGE} + # stage and directly goes to + # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::HUMAN_ASSIST_STAGE ConversationStage.HUMAN_ASSIST_STAGE}. + # @!attribute [r] telephony_connection_info + # @return [::Google::Cloud::Dialogflow::V2::Conversation::TelephonyConnectionInfo] + # Output only. The telephony connection information. + # @!attribute [r] initial_conversation_profile + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # Optional. Output only. The initial conversation profile to be used to + # configure this conversation, which is a copy of the conversation profile + # config read at conversation creation time. + # @!attribute [r] ingested_context_references + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference}] + # Output only. The context reference updates provided by external systems. + # @!attribute [r] initial_generator_contexts + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::GeneratorContext}] + # Output only. A map with generator name as key and generator context as + # value. + class Conversation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The information about phone calls connected via phone gateway to the + # conversation. + # @!attribute [r] dialed_number + # @return [::String] + # Output only. The number dialed to connect this call in E.164 format. + # @!attribute [rw] sdp + # @return [::String] + # Optional. SDP of the call. It's initially the SDP answer to the incoming + # call, but maybe later updated for the purpose of making the link active, + # etc. + # @!attribute [r] sip_headers + # @return [::Array<::Google::Cloud::Dialogflow::V2::Conversation::TelephonyConnectionInfo::SipHeader>] + # Output only. The SIP headers from the initial SIP INVITE. + # @!attribute [r] extra_mime_contents + # @return [::Array<::Google::Cloud::Dialogflow::V2::Conversation::TelephonyConnectionInfo::MimeContent>] + # Output only. The mime content from the initial SIP INVITE. + class TelephonyConnectionInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The SIP headers from the initial SIP INVITE. + # @!attribute [rw] name + # @return [::String] + # Optional. The name of the header. + # @!attribute [rw] value + # @return [::String] + # Optional. The value of the header. + class SipHeader + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The mime content from the initial SIP INVITE. + # @!attribute [rw] mime_type + # @return [::String] + # Optional. The mime type of the content. + # @!attribute [rw] content + # @return [::String] + # Optional. The content payload. + class MimeContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents a section of ingested context information. + # @!attribute [rw] context_contents + # @return [::Array<::Google::Cloud::Dialogflow::V2::Conversation::ContextReference::ContextContent>] + # Required. The list of content updates for a context reference. + # @!attribute [rw] update_mode + # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference::UpdateMode] + # Required. The mode in which context reference contents are updated. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language of the information ingested, defaults to "en-US" + # if not set. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the context reference was first created. + class ContextReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contents ingested. + # @!attribute [rw] content + # @return [::String] + # Required. The information ingested in a single request. + # @!attribute [rw] content_format + # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference::ContextContent::ContentFormat] + # Required. The format of the ingested string. + # @!attribute [r] ingestion_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when this information was incorporated into the + # relevant context reference. + # @!attribute [rw] answer_record + # @return [::String] + # If the context content was generated from a tool call, specify the + # answer record associated with the tool call. + # Format: `projects//locations//answerRecords/`. + class ContextContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the format of the ingested string. + module ContentFormat + # Unspecified content format. + CONTENT_FORMAT_UNSPECIFIED = 0 + + # Content was provided in JSON format. + JSON = 1 + + # Content was provided as plain text. + PLAIN_TEXT = 2 + end + end + + # Represents the mode in which context reference contents are updated. + module UpdateMode + # Unspecified update mode. + UPDATE_MODE_UNSPECIFIED = 0 + + # Context content updates are applied in append mode. + APPEND = 1 + + # Context content updates are applied in overwrite mode. + OVERWRITE = 2 + end + end + + # Represents the context of a generator. + # @!attribute [r] generator_type + # @return [::Google::Cloud::Dialogflow::V2::Conversation::GeneratorContext::GeneratorType] + # Output only. The type of the generator. + class GeneratorContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The available generator types. + module GeneratorType + # Unspecified generator type. + GENERATOR_TYPE_UNSPECIFIED = 0 + + # Free form generator type. + FREE_FORM = 1 + + # Agent coaching generator type. + AGENT_COACHING = 2 + + # Summarization generator type. + SUMMARIZATION = 3 + + # Translation generator type. + TRANSLATION = 4 + + # Agent feedback generator type. + AGENT_FEEDBACK = 5 + + # Customer message generation generator type. + CUSTOMER_MESSAGE_GENERATION = 6 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference] + class IngestedContextReferencesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::V2::Conversation::GeneratorContext] + class InitialGeneratorContextsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enumeration of the completion status of the conversation. + module LifecycleState + # Unknown. + LIFECYCLE_STATE_UNSPECIFIED = 0 + + # Conversation is currently open for media analysis. + IN_PROGRESS = 1 + + # Conversation has been completed. + COMPLETED = 2 + end + + # Enumeration of the different conversation stages a conversation can be in. + # Reference: + # https://cloud.google.com/agent-assist/docs/basics#conversation_stages + module ConversationStage + # Unknown. Should never be used after a conversation is successfully + # created. + CONVERSATION_STAGE_UNSPECIFIED = 0 + + # The conversation should return virtual agent responses into the + # conversation. + VIRTUAL_AGENT_STAGE = 1 + + # The conversation should not provide responses, just listen and provide + # suggestions. + HUMAN_ASSIST_STAGE = 2 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#create_conversation Conversations.CreateConversation}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource identifier of the project creating the conversation. + # Format: `projects//locations/`. + # @!attribute [rw] conversation + # @return [::Google::Cloud::Dialogflow::V2::Conversation] + # Required. The conversation to create. + # @!attribute [rw] conversation_id + # @return [::String] + # Optional. Identifier of the conversation. Generally it's auto generated by + # Google. Only set it if you cannot wait for the response to return a + # auto-generated one to you. + # + # The conversation ID must be compliant with the regression formula + # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + # If the field is provided, the caller is responsible for + # 1. the uniqueness of the ID, otherwise the request will be rejected. + # 2. the consistency for whether to use custom ID or not under a project to + # better ensure uniqueness. + class CreateConversationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_conversations Conversations.ListConversations}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project from which to list all conversation. + # Format: `projects//locations/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + # @!attribute [rw] filter + # @return [::String] + # Optional. A filter expression that filters conversations listed in the + # response. Only `lifecycle_state` can be filtered on in this way. For + # example, the following expression only returns `COMPLETED` conversations: + # + # `lifecycle_state = "COMPLETED"` + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + class ListConversationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_conversations Conversations.ListConversations}. + # @!attribute [rw] conversations + # @return [::Array<::Google::Cloud::Dialogflow::V2::Conversation>] + # The list of conversations. There will be a maximum number of items + # returned based on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListConversationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#get_conversation Conversations.GetConversation}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the conversation. Format: + # `projects//locations//conversations/`. + class GetConversationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#complete_conversation Conversations.CompleteConversation}. + # @!attribute [rw] name + # @return [::String] + # Required. Resource identifier of the conversation to close. + # Format: `projects//locations//conversations/`. + class CompleteConversationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the conversation to list messages for. + # Format: `projects//locations//conversations/` + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter on message fields. Currently predicates on `create_time` + # and `create_time_epoch_microseconds` are supported. `create_time` only + # support milliseconds accuracy. E.g., + # `create_time_epoch_microseconds > 1551790877964485` or + # `create_time > 2017-01-15T01:30:15.01Z`. + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListMessagesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages}. + # @!attribute [rw] messages + # @return [::Array<::Google::Cloud::Dialogflow::V2::Message>] + # The list of messages. There will be a maximum number of items + # returned based on the page_size field in the request. + # `messages` is sorted by `create_time` in descending order. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are + # no more results in the list. + class ListMessagesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a phone number for telephony integration. It allows for connecting + # a particular conversation over telephony. + # @!attribute [r] country_code + # @return [::Integer] + # Output only. Desired country code for the phone number. + # @!attribute [r] phone_number + # @return [::String] + # Output only. The phone number to connect to this conversation. + class ConversationPhoneNumber + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for [ConversationsService.IngestContextReferences][]. + # @!attribute [rw] conversation + # @return [::String] + # Required. Resource identifier of the conversation to ingest context + # information for. Format: `projects//locations//conversations/`. + # @!attribute [rw] context_references + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference}] + # Required. The context references to ingest. The key is the name of the + # context reference and the value contains the contents of the context + # reference. The key is used to incorporate ingested context references to + # enhance the generator. + class IngestContextReferencesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference] + class ContextReferencesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response message for [ConversationsService.IngestContextReferences][]. + # @!attribute [rw] ingested_context_references + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference}] + # All context references ingested. + class IngestContextReferencesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference] + class IngestedContextReferencesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#suggest_conversation_summary Conversations.SuggestConversationSummary}. + # @!attribute [rw] conversation + # @return [::String] + # Required. The conversation to fetch suggestion for. + # Format: `projects//locations//conversations/`. + # @!attribute [rw] latest_message + # @return [::String] + # Optional. The name of the latest conversation message used as context for + # compiling suggestion. If empty, the latest message of the conversation will + # be used. + # + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Optional. Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 500 and at most 1000. + # @!attribute [rw] assist_query_params + # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] + # Optional. Parameters for a human assist query. Only used for POC/demo + # purpose. + class SuggestConversationSummaryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#suggest_conversation_summary Conversations.SuggestConversationSummary}. + # @!attribute [rw] summary + # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse::Summary] + # Generated summary. + # @!attribute [rw] latest_message + # @return [::String] + # The name of the latest conversation message used as context for + # compiling suggestion. + # + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse#latest_message latest_message} + # used to compile the suggestion. It may be smaller than the + # {::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest#context_size SuggestConversationSummaryRequest.context_size} + # field in the request if there weren't that many messages in the + # conversation. + class SuggestConversationSummaryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Generated summary for a conversation. + # @!attribute [rw] text + # @return [::String] + # The summary content that is concatenated into one string. + # @!attribute [rw] text_sections + # @return [::Google::Protobuf::Map{::String => ::String}] + # The summary content that is divided into sections. The key is the + # section's name and the value is the section's content. There is no + # specific format for the key or value. + # @!attribute [rw] sorted_text_sections + # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse::Summary::SummarySection>] + # Same as text_sections, but in an order that is consistent with the order + # of the sections in the generator. + # @!attribute [rw] answer_record + # @return [::String] + # The name of the answer record. Format: + # "projects//answerRecords/" + # @!attribute [rw] baseline_model_version + # @return [::String] + # The baseline model version used to generate this summary. It is empty if + # a baseline model was not used to generate this summary. + class Summary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A component of the generated summary. + # @!attribute [r] section + # @return [::String] + # Output only. Name of the section. + # @!attribute [r] summary + # @return [::String] + # Output only. Summary text for the section. + class SummarySection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TextSectionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_summary Conversations.GenerateStatelessSummary}. + # @!attribute [rw] stateless_conversation + # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest::MinimalConversation] + # Required. The conversation to suggest a summary for. + # @!attribute [rw] conversation_profile + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # Required. A ConversationProfile containing information required for Summary + # generation. + # Required fields: \\{language_code, security_settings} + # Optional fields: \\{agent_assistant_config} + # @!attribute [rw] latest_message + # @return [::String] + # Optional. The name of the latest conversation message used as context for + # generating a Summary. If empty, the latest message of the conversation will + # be used. The format is specific to the user and the names of the messages + # provided. + # @!attribute [rw] max_context_size + # @return [::Integer] + # Optional. Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 500 and at most 1000. + class GenerateStatelessSummaryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The minimum amount of information required to generate a Summary without + # having a Conversation resource created. + # @!attribute [rw] messages + # @return [::Array<::Google::Cloud::Dialogflow::V2::Message>] + # Required. The messages that the Summary will be generated from. It is + # expected that this message content is already redacted and does not + # contain any PII. Required fields: {content, language_code, participant, + # participant_role} Optional fields: \\{send_time} If send_time is not + # provided, then the messages must be provided in chronological order. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource to charge for the Summary's generation. + # Format: `projects//locations/`. + class MinimalConversation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_summary Conversations.GenerateStatelessSummary}. + # @!attribute [rw] summary + # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse::Summary] + # Generated summary. + # @!attribute [rw] latest_message + # @return [::String] + # The name of the latest conversation message used as context for + # compiling suggestion. The format is specific to the user and the names of + # the messages provided. + # @!attribute [rw] context_size + # @return [::Integer] + # Number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse#latest_message latest_message} + # used to compile the suggestion. It may be smaller than the + # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest#max_context_size GenerateStatelessSummaryRequest.max_context_size} + # field in the request if there weren't that many messages in the + # conversation. + class GenerateStatelessSummaryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Generated summary for a conversation. + # @!attribute [rw] text + # @return [::String] + # The summary content that is concatenated into one string. + # @!attribute [rw] text_sections + # @return [::Google::Protobuf::Map{::String => ::String}] + # The summary content that is divided into sections. The key is the + # section's name and the value is the section's content. There is no + # specific format for the key or value. + # @!attribute [rw] baseline_model_version + # @return [::String] + # The baseline model version used to generate this summary. It is empty if + # a baseline model was not used to generate this summary. + class Summary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TextSectionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion Conversations.GenerateStatelessSuggestion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource to charge for the Suggestion's generation. + # Format: `projects//locations/`. + # @!attribute [rw] generator + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # Uncreated generator. It should be a complete generator that includes all + # information about the generator. + # + # Note: The following fields are mutually exclusive: `generator`, `generator_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] generator_name + # @return [::String] + # The resource name of the existing created generator. Format: + # `projects//locations//generators/` + # + # Note: The following fields are mutually exclusive: `generator_name`, `generator`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] context_references + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference}] + # Optional. A section of ingested context information. The key is the name of + # the context reference and the value contains the contents of the context + # reference. The key is used to incorporate ingested context references to + # enhance the generator. + # @!attribute [rw] conversation_context + # @return [::Google::Cloud::Dialogflow::V2::ConversationContext] + # Optional. Context of the conversation, including transcripts. + # @!attribute [rw] trigger_events + # @return [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] + # Optional. A list of trigger events. Generator will be triggered only if + # it's trigger event is included here. + # @!attribute [rw] security_settings + # @return [::String] + # Optional. Name of the CX SecuritySettings which is used to redact generated + # response. If this field is empty, try to fetch v2 security_settings, which + # is a project level setting. If this field is empty and no v2 + # security_settings set up in this project, no redaction will be done. + # + # Format: + # `projects//locations//securitySettings/`. + class GenerateStatelessSuggestionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference] + class ContextReferencesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion Conversations.GenerateStatelessSuggestion}. + # @!attribute [rw] generator_suggestion + # @return [::Google::Cloud::Dialogflow::V2::GeneratorSuggestion] + # Required. Generated suggestion for a conversation. + class GenerateStatelessSuggestionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#search_knowledge Conversations.SearchKnowledge}. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource contains the conversation profile + # Format: 'projects/' or `projects//locations/`. + # @!attribute [rw] query + # @return [::Google::Cloud::Dialogflow::V2::TextInput] + # Required. The natural language text query for knowledge search. + # @!attribute [rw] conversation_profile + # @return [::String] + # Required. The conversation profile used to configure the search. + # Format: `projects//locations//conversationProfiles/`. + # @!attribute [rw] session_id + # @return [::String] + # Required. The ID of the search session. + # The session_id can be combined with Dialogflow V3 Agent ID retrieved from + # conversation profile or on its own to identify a search session. The search + # history of the same session will impact the search result. It's up to the + # API caller to choose an appropriate `Session ID`. It can be a random number + # or some type of session identifiers (preferably hashed). The length must + # not exceed 36 characters. + # @!attribute [rw] conversation + # @return [::String] + # Optional. The conversation (between human agent and end user) where the + # search request is triggered. Format: `projects//locations//conversations/`. + # @!attribute [rw] latest_message + # @return [::String] + # Optional. The name of the latest conversation message when the request is + # triggered. + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] query_source + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::QuerySource] + # Optional. The source of the query in the request. + # @!attribute [rw] end_user_metadata + # @return [::Google::Protobuf::Struct] + # Optional. Information about the end-user to improve the relevance and + # accuracy of generative answers. + # + # This will be interpreted and used by a language model, so, for good + # results, the data should be self-descriptive, and in a simple structure. + # + # Example: + # + # ```json + # { + # "subscription plan": "Business Premium Plus", + # "devices owned": [ + # \\{"model": "Google Pixel 7"}, + # \\{"model": "Google Pixel Tablet"} + # ] + # } + # ``` + # @!attribute [rw] search_config + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig] + # Optional. Configuration specific to search queries with data stores. + # @!attribute [rw] exact_search + # @return [::Boolean] + # Optional. Whether to search the query exactly without query rewrite. + class SearchKnowledgeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration specific to search queries with data stores. + # @!attribute [rw] boost_specs + # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs>] + # Optional. Boost specifications for data stores. + # + # Maps from datastore name to their boost configuration. Do not specify + # more than one BoostSpecs for each datastore name. If multiple BoostSpecs + # are provided for the same datastore name, the behavior is undefined. + # @!attribute [rw] filter_specs + # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::FilterSpecs>] + # Optional. Filter specification for data store queries. + # + # TMaps from datastore name to the filter expression for that datastore. Do + # not specify more than one FilterSpecs for each datastore name. If + # multiple FilterSpecs are provided for the same datastore name, the + # behavior is undefined. + class SearchConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Boost specifications for data stores. + # @!attribute [rw] data_stores + # @return [::Array<::String>] + # Optional. Data Stores where the boosting configuration is applied. The + # full names of the referenced data stores. Formats: + # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` + # `projects/{project}/locations/{location}/dataStores/{data_store}` + # @!attribute [rw] spec + # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec>] + # Optional. A list of boosting specifications. + class BoostSpecs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Boost specification to boost certain documents. + # A copy of google.cloud.discoveryengine.v1main.BoostSpec, field + # documentation is available at + # https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/BoostSpec + # @!attribute [rw] condition_boost_specs + # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec>] + # Optional. 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] + # Optional. An expression which specifies a boost condition. The + # syntax and supported fields are the same as a filter expression. + # Examples: + # + # * To boost documents with document ID "doc_1" or "doc_2", and + # color + # "Red" or "Blue": + # * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) + # @!attribute [rw] boost + # @return [::Float] + # Optional. 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. + # @!attribute [rw] boost_control_spec + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec] + # Optional. 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] + # Optional. The name of the field whose value will be used to + # determine the boost amount. + # @!attribute [rw] attribute_type + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::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::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType] + # Optional. The interpolation type to be applied to connect the + # control points listed below. + # @!attribute [rw] control_points + # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::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 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] + # 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]]`. E.g. `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 + end + + # Filter specification for data store queries. + # @!attribute [rw] data_stores + # @return [::Array<::String>] + # Optional. The data store where the filter configuration is applied. + # Full resource name of data store, such as + # projects/\\{project}/locations/\\{location}/collections/\\{collectionId}/ + # dataStores/\\{dataStoreId}. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter expression to be applied. + # Expression syntax is documented at + # https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax + class FilterSpecs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The source of the query. We use QuerySource to distinguish queries directly + # entered by agents and suggested queries from + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist Participants.SuggestKnowledgeAssist}. + # If SUGGESTED_QUERY source is specified, we will treat it as a continuation + # of a SuggestKnowledgeAssist call. + module QuerySource + # Unknown query source. + QUERY_SOURCE_UNSPECIFIED = 0 + + # The query is from agents. + AGENT_QUERY = 1 + + # The query is a suggested query from + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist Participants.SuggestKnowledgeAssist}. + SUGGESTED_QUERY = 2 + end + end + + # Debug information related to SearchKnowledge feature. + # @!attribute [rw] datastore_response_reason + # @return [::Google::Cloud::Dialogflow::V2::DatastoreResponseReason] + # Response reason from datastore which indicates data serving status or + # answer quality degradation. + # @!attribute [rw] search_knowledge_behavior + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeDebugInfo::SearchKnowledgeBehavior] + # Configured behaviors for SearchKnowledge. + # @!attribute [rw] ingested_context_reference_debug_info + # @return [::Google::Cloud::Dialogflow::V2::IngestedContextReferenceDebugInfo] + # Information about parameters ingested for search knowledge. + # @!attribute [rw] service_latency + # @return [::Google::Cloud::Dialogflow::V2::ServiceLatency] + # The latency of the service. + class SearchKnowledgeDebugInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configured behaviors for SearchKnowledge. + # @!attribute [rw] answer_generation_rewriter_on + # @return [::Boolean] + # Whether data store agent rewriter was turned on for the request. + # @!attribute [rw] end_user_metadata_included + # @return [::Boolean] + # Whether end_user_metadata is included in the data store agent call. + # @!attribute [rw] third_party_connector_allowed + # @return [::Boolean] + # This field indicates whether third party connectors are enabled for the + # project. Note that this field only indicates if the project is + # allowlisted for connectors. + class SearchKnowledgeBehavior + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#search_knowledge Conversations.SearchKnowledge}. + # @!attribute [rw] answers + # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeAnswer>] + # Most relevant snippets extracted from articles in the given knowledge base, + # ordered by confidence. + # @!attribute [rw] rewritten_query + # @return [::String] + # The rewritten query used to search knowledge. + # @!attribute [rw] search_knowledge_debug_info + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeDebugInfo] + # Debug info for SearchKnowledge. + class SearchKnowledgeResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a SearchKnowledge answer. + # @!attribute [rw] answer + # @return [::String] + # The piece of text from the knowledge base documents that answers + # the search query + # @!attribute [rw] answer_type + # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeAnswer::AnswerType] + # The type of the answer. + # @!attribute [rw] answer_sources + # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeAnswer::AnswerSource>] + # All sources used to generate the answer. + # @!attribute [rw] answer_record + # @return [::String] + # The name of the answer record. + # Format: `projects//locations//answer + # Records/` + class SearchKnowledgeAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The sources of the answers. + # @!attribute [rw] title + # @return [::String] + # The title of the article. + # @!attribute [rw] uri + # @return [::String] + # The URI of the article. + # @!attribute [rw] snippet + # @return [::String] + # The relevant snippet of the article. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Metadata associated with the article. + class AnswerSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of the answer. + module AnswerType + # The answer has a unspecified type. + ANSWER_TYPE_UNSPECIFIED = 0 + + # The answer is from FAQ documents. + FAQ = 1 + + # The answer is from generative model. + GENERATIVE = 2 + + # The answer is from intent matching. + INTENT = 3 + + # The answer is from Playbook. + PLAYBOOK = 4 + + # The answer is from event. + EVENT = 5 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_suggestions Conversations.GenerateSuggestions}. + # @!attribute [rw] conversation + # @return [::String] + # Required. The conversation for which the suggestions are generated. Format: + # `projects//locations//conversations/`. + # + # The conversation must be created with a conversation profile which has + # generators configured in it to be able to get suggestions. + # @!attribute [rw] latest_message + # @return [::String] + # Optional. The name of the latest conversation message for which the request + # is triggered. Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] trigger_events + # @return [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] + # Optional. A list of trigger events. Only generators configured in the + # conversation_profile whose trigger_event is listed here will be triggered. + class GenerateSuggestionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_dataset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_dataset.rb new file mode 100644 index 000000000000..c419964fcac4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_dataset.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 Cloud + module Dialogflow + module V2 + # Represents metadata of a conversation. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language code of the conversation data within this dataset. + # See https://cloud.google.com/apis/design/standard_fields for more + # information. Supports all UTF-8 languages. + class ConversationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the configuration of importing a set of conversation files in + # Google Cloud Storage. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Dialogflow::V2::GcsSources] + # The Cloud Storage URI has the form gs:////agent*.json. Wildcards are allowed and will be expanded into all + # matched JSON files, which will be read as one conversation per file. + class InputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a conversation dataset that a user imports raw data into. + # The data inside ConversationDataset can not be changed after + # ImportConversationData finishes (and calling ImportConversationData on a + # dataset that already has data is not allowed). + # @!attribute [r] name + # @return [::String] + # Output only. ConversationDataset resource name. Format: + # `projects//locations//conversationDatasets/` + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the dataset. Maximum of 64 bytes. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the dataset. Maximum of 10000 bytes. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this dataset. + # @!attribute [r] input_config + # @return [::Google::Cloud::Dialogflow::V2::InputConfig] + # Output only. Input configurations set during conversation data import. + # @!attribute [r] conversation_info + # @return [::Google::Cloud::Dialogflow::V2::ConversationInfo] + # Output only. Metadata set during conversation data import. + # @!attribute [r] conversation_count + # @return [::Integer] + # Output only. The number of conversations this conversation dataset + # contains. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. A read only boolean field reflecting Zone Isolation status of + # the dataset. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. A read only boolean field reflecting Zone Separation status of + # the dataset. + class ConversationDataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#create_conversation_dataset ConversationDatasets.CreateConversationDataset}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project to create conversation dataset for. Format: + # `projects//locations/` + # @!attribute [rw] conversation_dataset + # @return [::Google::Cloud::Dialogflow::V2::ConversationDataset] + # Required. The conversation dataset to create. + class CreateConversationDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#get_conversation_dataset ConversationDatasets.GetConversationDataset}. + # @!attribute [rw] name + # @return [::String] + # Required. The conversation dataset to retrieve. Format: + # `projects//locations//conversationDatasets/` + class GetConversationDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets ConversationDatasets.ListConversationDatasets}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location name to list all conversation datasets + # for. Format: `projects//locations/` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of conversation datasets to return in a single + # page. By default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListConversationDatasetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets ConversationDatasets.ListConversationDatasets}. + # @!attribute [rw] conversation_datasets + # @return [::Array<::Google::Cloud::Dialogflow::V2::ConversationDataset>] + # The list of datasets to return. + # @!attribute [rw] next_page_token + # @return [::String] + # The token to use to retrieve the next page of results, or empty if there + # are no more results in the list. + class ListConversationDatasetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#delete_conversation_dataset ConversationDatasets.DeleteConversationDataset}. + # @!attribute [rw] name + # @return [::String] + # Required. The conversation dataset to delete. Format: + # `projects//locations//conversationDatasets/` + class DeleteConversationDatasetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data ConversationDatasets.ImportConversationData}. + # @!attribute [rw] name + # @return [::String] + # Required. Dataset resource name. Format: + # `projects//locations//conversationDatasets/` + # @!attribute [rw] input_config + # @return [::Google::Cloud::Dialogflow::V2::InputConfig] + # Required. Configuration describing where to import data from. + class ImportConversationDataRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for a + # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data ConversationDatasets.ImportConversationData} + # operation. + # @!attribute [rw] conversation_dataset + # @return [::String] + # The resource name of the imported conversation dataset. Format: + # `projects//locations//conversationDatasets/` + # @!attribute [rw] partial_failures + # @return [::Array<::Google::Rpc::Status>] + # Partial failures are failures that don't fail the whole long running + # operation, e.g. single files that couldn't be read. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when import conversation data request was created. The time is + # measured on server side. + class ImportConversationDataOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response used for + # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data ConversationDatasets.ImportConversationData} + # long running operation. + # @!attribute [rw] conversation_dataset + # @return [::String] + # The resource name of the imported conversation dataset. Format: + # `projects//locations//conversationDatasets/` + # @!attribute [rw] import_count + # @return [::Integer] + # Number of conversations imported successfully. + class ImportConversationDataOperationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for [CreateConversationDataset][]. + # @!attribute [rw] conversation_dataset + # @return [::String] + # The resource name of the conversation dataset that will be created. Format: + # `projects//locations//conversationDatasets/` + class CreateConversationDatasetOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for [DeleteConversationDataset][]. + class DeleteConversationDatasetOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb new file mode 100644 index 000000000000..4efde0548bbf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_event.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 Cloud + module Dialogflow + module V2 + # Represents a notification sent to Pub/Sub subscribers for conversation + # lifecycle events. + # @!attribute [rw] conversation + # @return [::String] + # The unique identifier of the conversation this notification + # refers to. + # Format: `projects//conversations/`. + # @!attribute [rw] type + # @return [::Google::Cloud::Dialogflow::V2::ConversationEvent::Type] + # The type of the event that this notification refers to. + # @!attribute [rw] error_status + # @return [::Google::Rpc::Status] + # More detailed information about an error. Only set for type + # UNRECOVERABLE_ERROR_IN_PHONE_CALL. + # @!attribute [rw] new_message_payload + # @return [::Google::Cloud::Dialogflow::V2::Message] + # Payload of NEW_MESSAGE event. + # + # Note: The following fields are mutually exclusive: `new_message_payload`, `new_recognition_result_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] new_recognition_result_payload + # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult] + # Payload of NEW_RECOGNITION_RESULT event. + # + # Note: The following fields are mutually exclusive: `new_recognition_result_payload`, `new_message_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ConversationEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumeration of the types of events available. + module Type + # Type not set. + TYPE_UNSPECIFIED = 0 + + # A new conversation has been opened. This is fired when a telephone call + # is answered, or a conversation is created via the API. + CONVERSATION_STARTED = 1 + + # An existing conversation has closed. This is fired when a telephone call + # is terminated, or a conversation is closed via the API. + # The event is fired for every CompleteConversation call, even if the + # conversation is already closed. + CONVERSATION_FINISHED = 2 + + # An existing conversation has received notification from Dialogflow that + # human intervention is required. + HUMAN_INTERVENTION_NEEDED = 3 + + # An existing conversation has received a new message, either from API or + # telephony. It is configured in + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#new_message_event_notification_config ConversationProfile.new_message_event_notification_config} + NEW_MESSAGE = 5 + + # An existing conversation has received a new speech recognition result. + # This is mainly for delivering intermediate transcripts. The notification + # is configured in + # [ConversationProfile.new_recognition_event_notification_config][]. + NEW_RECOGNITION_RESULT = 7 + + # Unrecoverable error during a telephone call. + # + # In general non-recoverable errors only occur if something was + # misconfigured in the ConversationProfile corresponding to the call. After + # a non-recoverable error, Dialogflow may stop responding. + # + # We don't fire this event: + # + # * in an API call because we can directly return the error, or, + # * when we can recover from an error. + UNRECOVERABLE_ERROR = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_model.rb new file mode 100644 index 000000000000..cd1b6212e069 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_model.rb @@ -0,0 +1,577 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Represents a conversation model. + # @!attribute [rw] name + # @return [::String] + # ConversationModel resource name. Format: + # `projects//conversationModels/` + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the model. At most 64 bytes long. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this model. + # @!attribute [rw] datasets + # @return [::Array<::Google::Cloud::Dialogflow::V2::InputDataset>] + # Required. Datasets used to create model. + # @!attribute [r] state + # @return [::Google::Cloud::Dialogflow::V2::ConversationModel::State] + # Output only. State of the model. A model can only serve prediction requests + # after it gets deployed. + # @!attribute [rw] language_code + # @return [::String] + # Language code for the conversation model. If not specified, the language + # is en-US. Language at ConversationModel should be set for all non en-us + # languages. + # This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag. Example: "en-US". + # @!attribute [rw] article_suggestion_model_metadata + # @return [::Google::Cloud::Dialogflow::V2::ArticleSuggestionModelMetadata] + # Metadata for article suggestion models. + # + # Note: The following fields are mutually exclusive: `article_suggestion_model_metadata`, `smart_reply_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] smart_reply_model_metadata + # @return [::Google::Cloud::Dialogflow::V2::SmartReplyModelMetadata] + # Metadata for smart reply models. + # + # Note: The following fields are mutually exclusive: `smart_reply_model_metadata`, `article_suggestion_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. A read only boolean field reflecting Zone Separation + # status of the model. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. A read only boolean field reflecting Zone Isolation status + # of the model. + class ConversationModel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the model. + module State + # Should not be used, an un-set enum has this value by default. + STATE_UNSPECIFIED = 0 + + # Model being created. + CREATING = 1 + + # Model is not deployed but ready to deploy. + UNDEPLOYED = 2 + + # Model is deploying. + DEPLOYING = 3 + + # Model is deployed and ready to use. + DEPLOYED = 4 + + # Model is undeploying. + UNDEPLOYING = 5 + + # Model is deleting. + DELETING = 6 + + # Model is in error state. Not ready to deploy and use. + FAILED = 7 + + # Model is being created but the training has not started, + # The model may remain in this state until there is enough capacity to + # start training. + PENDING = 8 + end + + # Model type. + module ModelType + # ModelType unspecified. + MODEL_TYPE_UNSPECIFIED = 0 + + # ModelType smart reply dual encoder model. + SMART_REPLY_DUAL_ENCODER_MODEL = 2 + + # ModelType smart reply bert model. + SMART_REPLY_BERT_MODEL = 6 + end + end + + # Represents evaluation result of a conversation model. + # @!attribute [rw] name + # @return [::String] + # The resource name of the evaluation. Format: + # `projects//conversationModels//evaluations/` + # @!attribute [rw] display_name + # @return [::String] + # Optional. The display name of the model evaluation. At most 64 bytes long. + # @!attribute [rw] evaluation_config + # @return [::Google::Cloud::Dialogflow::V2::EvaluationConfig] + # Optional. The configuration of the evaluation task. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this model. + # @!attribute [r] smart_reply_metrics + # @return [::Google::Cloud::Dialogflow::V2::SmartReplyMetrics] + # Output only. Only available when model is for smart reply. + # @!attribute [r] raw_human_eval_template_csv + # @return [::String] + # Output only. Human eval template in csv format. + # It takes real-world conversations provided through input dataset, generates + # example suggestions for customer to verify quality of the model. + # For Smart Reply, the generated csv file contains columns of + # Context, (Suggestions,Q1,Q2)*3, Actual reply. + # Context contains at most 10 latest messages in the conversation prior to + # the current suggestion. + # Q1: "Would you send it as the next message of agent?" + # Evaluated based on whether the suggest is appropriate to be sent by + # agent in current context. + # Q2: "Does the suggestion move the conversation closer to resolution?" + # Evaluated based on whether the suggestion provide solutions, or answers + # customer's question or collect information from customer to resolve the + # customer's issue. + # Actual reply column contains the actual agent reply sent in the context. + class ConversationModelEvaluation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The configuration for model evaluation. + # @!attribute [rw] datasets + # @return [::Array<::Google::Cloud::Dialogflow::V2::InputDataset>] + # Required. Datasets used for evaluation. + # @!attribute [rw] smart_reply_config + # @return [::Google::Cloud::Dialogflow::V2::EvaluationConfig::SmartReplyConfig] + # Configuration for smart reply model evaluation. + # + # Note: The following fields are mutually exclusive: `smart_reply_config`, `smart_compose_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] smart_compose_config + # @return [::Google::Cloud::Dialogflow::V2::EvaluationConfig::SmartComposeConfig] + # Configuration for smart compose model evaluation. + # + # Note: The following fields are mutually exclusive: `smart_compose_config`, `smart_reply_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class EvaluationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Smart reply specific configuration for evaluation job. + # @!attribute [rw] allowlist_document + # @return [::String] + # The allowlist document resource name. + # Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. + # @!attribute [rw] max_result_count + # @return [::Integer] + # Required. The model to be evaluated can return multiple results with + # confidence score on each query. These results will be sorted by the + # descending order of the scores and we only keep the first + # max_result_count results as the final results to evaluate. + class SmartReplyConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Smart compose specific configuration for evaluation job. + # @!attribute [rw] allowlist_document + # @return [::String] + # The allowlist document resource name. + # Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. + # @!attribute [rw] max_result_count + # @return [::Integer] + # Required. The model to be evaluated can return multiple results with + # confidence score on each query. These results will be sorted by the + # descending order of the scores and we only keep the first + # max_result_count results as the final results to evaluate. + class SmartComposeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # InputDataset used to create model or do evaluation. + # NextID:5 + # @!attribute [rw] dataset + # @return [::String] + # Required. ConversationDataset resource name. Format: + # `projects//locations//conversationDatasets/` + class InputDataset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for article suggestion models. + # @!attribute [rw] training_model_type + # @return [::Google::Cloud::Dialogflow::V2::ConversationModel::ModelType] + # Optional. Type of the article suggestion model. If not provided, model_type + # is used. + class ArticleSuggestionModelMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for smart reply models. + # @!attribute [rw] training_model_type + # @return [::Google::Cloud::Dialogflow::V2::ConversationModel::ModelType] + # Optional. Type of the smart reply model. If not provided, model_type is + # used. + class SmartReplyModelMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The evaluation metrics for smart reply model. + # @!attribute [rw] allowlist_coverage + # @return [::Float] + # Percentage of target participant messages in the evaluation dataset for + # which similar messages have appeared at least once in the allowlist. Should + # be [0, 1]. + # @!attribute [rw] top_n_metrics + # @return [::Array<::Google::Cloud::Dialogflow::V2::SmartReplyMetrics::TopNMetrics>] + # Metrics of top n smart replies, sorted by [TopNMetric.n][]. + # @!attribute [rw] conversation_count + # @return [::Integer] + # Total number of conversations used to generate this metric. + class SmartReplyMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Evaluation metrics when retrieving `n` smart replies with the model. + # @!attribute [rw] n + # @return [::Integer] + # Number of retrieved smart replies. For example, when `n` is 3, this + # evaluation contains metrics for when Dialogflow retrieves 3 smart replies + # with the model. + # @!attribute [rw] recall + # @return [::Float] + # Defined as `number of queries whose top n smart replies have at least one + # similar (token match similarity above the defined threshold) reply as the + # real reply` divided by `number of queries with at least one smart reply`. + # Value ranges from 0.0 to 1.0 inclusive. + class TopNMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model ConversationModels.CreateConversationModel} + # @!attribute [rw] parent + # @return [::String] + # The project to create conversation model for. Format: + # `projects/` + # @!attribute [rw] conversation_model + # @return [::Google::Cloud::Dialogflow::V2::ConversationModel] + # Required. The conversation model to create. + class CreateConversationModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model ConversationModels.GetConversationModel} + # @!attribute [rw] name + # @return [::String] + # Required. The conversation model to retrieve. Format: + # `projects//conversationModels/` + class GetConversationModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_models ConversationModels.ListConversationModels} + # @!attribute [rw] parent + # @return [::String] + # Required. The project to list all conversation models for. + # Format: `projects/` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of conversation models to return in a single + # page. By default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListConversationModelsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_models ConversationModels.ListConversationModels} + # @!attribute [rw] conversation_models + # @return [::Array<::Google::Cloud::Dialogflow::V2::ConversationModel>] + # The list of models to return. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListConversationModelsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#delete_conversation_model ConversationModels.DeleteConversationModel} + # @!attribute [rw] name + # @return [::String] + # Required. The conversation model to delete. Format: + # `projects//conversationModels/` + class DeleteConversationModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model ConversationModels.DeployConversationModel} + # @!attribute [rw] name + # @return [::String] + # Required. The conversation model to deploy. Format: + # `projects//conversationModels/` + class DeployConversationModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model ConversationModels.UndeployConversationModel} + # @!attribute [rw] name + # @return [::String] + # Required. The conversation model to undeploy. Format: + # `projects//conversationModels/` + class UndeployConversationModelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model_evaluation ConversationModels.GetConversationModelEvaluation} + # @!attribute [rw] name + # @return [::String] + # Required. The conversation model evaluation resource name. Format: + # `projects//conversationModels//evaluations/` + class GetConversationModelEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations ConversationModels.ListConversationModelEvaluations} + # @!attribute [rw] parent + # @return [::String] + # Required. The conversation model resource name. Format: + # `projects//conversationModels/` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of evaluations to return in a + # single page. By default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListConversationModelEvaluationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations ConversationModels.ListConversationModelEvaluations} + # @!attribute [rw] conversation_model_evaluations + # @return [::Array<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] + # The list of evaluations to return. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListConversationModelEvaluationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation ConversationModels.CreateConversationModelEvaluation} + # @!attribute [rw] parent + # @return [::String] + # Required. The conversation model resource name. Format: + # `projects//locations//conversationModels/` + # @!attribute [rw] conversation_model_evaluation + # @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] + # Required. The conversation model evaluation to be created. + class CreateConversationModelEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for a + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model ConversationModels.CreateConversationModel} + # operation. + # @!attribute [rw] conversation_model + # @return [::String] + # The resource name of the conversation model. Format: + # `projects//conversationModels/` + # @!attribute [rw] state + # @return [::Google::Cloud::Dialogflow::V2::CreateConversationModelOperationMetadata::State] + # State of CreateConversationModel operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when the request to create conversation model is submitted. The + # time is measured on server side. + # @!attribute [rw] done_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation finished. + class CreateConversationModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of CreateConversationModel operation. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is submitted, but training has not started yet. + # The model may remain in this state until there is enough capacity to + # start training. + PENDING = 1 + + # The training has succeeded. + SUCCEEDED = 2 + + # The training has succeeded. + FAILED = 3 + + # The training has been cancelled. + CANCELLED = 4 + + # The training is in cancelling state. + CANCELLING = 5 + + # Custom model is training. + TRAINING = 6 + end + end + + # Metadata for a + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model ConversationModels.DeployConversationModel} + # operation. + # @!attribute [rw] conversation_model + # @return [::String] + # The resource name of the conversation model. Format: + # `projects//conversationModels/` + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when request to deploy conversation model was submitted. The time + # is measured on server side. + # @!attribute [rw] done_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation finished. + class DeployConversationModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for a + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model ConversationModels.UndeployConversationModel} + # operation. + # @!attribute [rw] conversation_model + # @return [::String] + # The resource name of the conversation model. Format: + # `projects//conversationModels/` + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when the request to undeploy conversation model was submitted. + # The time is measured on server side. + # @!attribute [rw] done_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation finished. + class UndeployConversationModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for a + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#delete_conversation_model ConversationModels.DeleteConversationModel} + # operation. + # @!attribute [rw] conversation_model + # @return [::String] + # The resource name of the conversation model. Format: + # `projects//conversationModels/` + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when delete conversation model request was created. The time is + # measured on server side. + # @!attribute [rw] done_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation finished. + class DeleteConversationModelOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for a + # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation ConversationModels.CreateConversationModelEvaluation} + # operation. + # @!attribute [rw] conversation_model_evaluation + # @return [::String] + # The resource name of the conversation model. Format: + # `projects//locations//conversationModels//evaluations/` + # @!attribute [rw] conversation_model + # @return [::String] + # The resource name of the conversation model. Format: + # `projects//locations//conversationModels/` + # @!attribute [rw] state + # @return [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationOperationMetadata::State] + # State of CreateConversationModel operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when the request to create conversation model was submitted. The + # time is measured on server side. + class CreateConversationModelEvaluationOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of CreateConversationModel operation. + module State + # Operation status not specified. + STATE_UNSPECIFIED = 0 + + # The operation is being prepared. + INITIALIZING = 1 + + # The operation is running. + RUNNING = 2 + + # The operation is cancelled. + CANCELLED = 3 + + # The operation has succeeded. + SUCCEEDED = 4 + + # The operation has failed. + FAILED = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb new file mode 100644 index 000000000000..b539f225fc25 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb @@ -0,0 +1,923 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Defines the services to connect to incoming Dialogflow conversations. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of this conversation profile. + # Format: `projects//locations//conversationProfiles/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. Human readable name for this profile. Max length 1024 bytes. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time of the conversation profile. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time of the conversation profile. + # @!attribute [rw] automated_agent_config + # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentConfig] + # Configuration for an automated agent to use with this profile. + # @!attribute [rw] human_agent_assistant_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig] + # Configuration for agent assistance to use with this profile. + # @!attribute [rw] human_agent_handoff_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentHandoffConfig] + # Configuration for connecting to a live agent. + # + # Currently, this feature is not general available, please contact Google + # to get access. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig] + # Configuration for publishing conversation lifecycle events. + # @!attribute [rw] logging_config + # @return [::Google::Cloud::Dialogflow::V2::LoggingConfig] + # Configuration for logging conversation lifecycle events. + # @!attribute [rw] new_message_event_notification_config + # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig] + # Configuration for publishing new message events. Event will be sent in + # format of {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent} + # @!attribute [rw] new_recognition_result_notification_config + # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig] + # Optional. Configuration for publishing transcription intermediate results. + # Event will be sent in format of + # {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent}. If + # configured, the following information will be populated as + # {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent} Pub/Sub + # message attributes: + # - "participant_id" + # - "participant_role" + # - "message_id" + # @!attribute [rw] stt_config + # @return [::Google::Cloud::Dialogflow::V2::SpeechToTextConfig] + # Settings for speech transcription. + # @!attribute [rw] language_code + # @return [::String] + # Language code for the conversation profile. If not specified, the language + # is en-US. Language at ConversationProfile should be set for all non en-US + # languages. + # This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag. Example: "en-US". + # @!attribute [rw] sip_config + # @return [::Google::Cloud::Dialogflow::V2::SipConfig] + # Optional. Configuration for SIP connections. + # @!attribute [rw] time_zone + # @return [::String] + # The time zone of this conversational profile from the + # [time zone database](https://www.iana.org/time-zones), e.g., + # America/New_York, Europe/Paris. Defaults to America/New_York. + # @!attribute [rw] security_settings + # @return [::String] + # Name of the CX SecuritySettings reference for the agent. + # Format: `projects//locations//securitySettings/`. + # @!attribute [rw] tts_config + # @return [::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig] + # Configuration for Text-to-Speech synthesization. + # + # Used by Phone Gateway to specify synthesization options. If agent defines + # synthesization options as well, agent settings overrides the option here. + class ConversationProfile + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles ConversationProfiles.ListConversationProfiles}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project to list all conversation profiles from. + # Format: `projects//locations/`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous list request. + class ListConversationProfilesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles ConversationProfiles.ListConversationProfiles}. + # @!attribute [rw] conversation_profiles + # @return [::Array<::Google::Cloud::Dialogflow::V2::ConversationProfile>] + # The list of project conversation profiles. There is a maximum number + # of items returned based on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListConversationProfilesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile ConversationProfiles.GetConversationProfile}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the conversation profile. + # Format: `projects//locations//conversationProfiles/`. + class GetConversationProfileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#create_conversation_profile ConversationProfiles.CreateConversationProfile}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project to create a conversation profile for. + # Format: `projects//locations/`. + # @!attribute [rw] conversation_profile + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # Required. The conversation profile to create. + class CreateConversationProfileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#update_conversation_profile ConversationProfiles.UpdateConversationProfile}. + # @!attribute [rw] conversation_profile + # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] + # Required. The conversation profile to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to control which fields to update. + class UpdateConversationProfileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#delete_conversation_profile ConversationProfiles.DeleteConversationProfile}. + # + # This operation fails if the conversation profile is still referenced from + # a phone number. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the conversation profile to delete. + # Format: `projects//locations//conversationProfiles/`. + class DeleteConversationProfileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the Automated Agent to connect to a conversation. + # @!attribute [rw] agent + # @return [::String] + # Required. ID of the Dialogflow agent environment to use. + # + # This project needs to either be the same project as the conversation or you + # need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API + # Service Agent` role in this project. + # + # - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not + # specified, the default `draft` environment is used. Refer to + # [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) + # for more details. + # + # - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + # is used. + # @!attribute [rw] session_ttl + # @return [::Google::Protobuf::Duration] + # Optional. Configure lifetime of the Dialogflow session. + # By default, a Dialogflow CX session remains active and its data is stored + # for 30 minutes after the last request is sent for the session. + # This value should be no longer than 1 day. + class AutomatedAgentConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the Human Agent Assist to connect to a conversation. + # @!attribute [rw] notification_config + # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig] + # Pub/Sub topic on which to publish new agent assistant events. + # @!attribute [rw] human_agent_suggestion_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig] + # Configuration for agent assistance of human agent participant. + # @!attribute [rw] end_user_suggestion_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig] + # Configuration for agent assistance of end user participant. + # + # Currently, this feature is not general available, please contact Google + # to get access. + # @!attribute [rw] message_analysis_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::MessageAnalysisConfig] + # Configuration for message analysis. + class HumanAgentAssistantConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Settings of suggestion trigger. + # @!attribute [rw] no_smalltalk + # @return [::Boolean] + # Do not trigger if last utterance is small talk. + # @!attribute [rw] only_end_user + # @return [::Boolean] + # Only trigger suggestion if participant role of last utterance is + # END_USER. + class SuggestionTriggerSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config for suggestion features. + # @!attribute [rw] suggestion_feature + # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature] + # The suggestion feature. + # @!attribute [rw] enable_event_based_suggestion + # @return [::Boolean] + # Automatically iterates all participants and tries to compile + # suggestions. + # + # Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, + # KNOWLEDGE_ASSIST. + # @!attribute [rw] disable_agent_query_logging + # @return [::Boolean] + # Optional. Disable the logging of search queries sent by human agents. It + # can prevent those queries from being stored at answer records. + # + # Supported features: KNOWLEDGE_SEARCH. + # @!attribute [rw] enable_query_suggestion_when_no_answer + # @return [::Boolean] + # Optional. Enable query suggestion even if we can't find its answer. + # By default, queries are suggested only if we find its answer. + # Supported features: KNOWLEDGE_ASSIST + # @!attribute [rw] enable_conversation_augmented_query + # @return [::Boolean] + # Optional. Enable including conversation context during query answer + # generation. Supported features: KNOWLEDGE_SEARCH. + # @!attribute [rw] enable_query_suggestion_only + # @return [::Boolean] + # Optional. Enable query suggestion only. + # Supported features: KNOWLEDGE_ASSIST + # @!attribute [rw] enable_response_debug_info + # @return [::Boolean] + # Optional. Enable returning detailed reasons for suggestion results. + # + # For example, with this field disabled, Knowledge Search feature returns + # NotFound error when no answer is found for the input query. Enabling this + # field will change the behavior to return an OK response with + # detailed information indicating the lack of results. + # + # Supported features: KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST + # @!attribute [rw] rai_settings + # @return [::Google::Cloud::Dialogflow::V2::RaiSettings] + # Optional. Settings for Responsible AI checks. + # Supported features: KNOWLEDGE_ASSIST + # @!attribute [rw] suggestion_trigger_event + # @return [::Google::Cloud::Dialogflow::V2::TriggerEvent] + # Optional. The trigger event for suggestion. + # If unspecified, it will be `CUSTOMER_MESSAGE`. + # Supported features: KNOWLEDGE_ASSIST + # For KNOWLEDGE_ASSIST, these four trigger events are supported: + # 1. TRIGGER_EVENT_UNSPECIFIED + # 2. END_OF_UTTERANCE + # 3. CUSTOMER_MESSAGE + # 4. AGENT_MESSAGE + # @!attribute [rw] disable_query_search_context + # @return [::Boolean] + # Optional. If true, disable appending available search context to the + # search query. Supported features: KNOWLEDGE_ASSIST + # @!attribute [rw] suggestion_trigger_settings + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionTriggerSettings] + # Settings of suggestion trigger. + # + # Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + # @!attribute [rw] query_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig] + # Configs of query. + # @!attribute [rw] conversation_model_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::ConversationModelConfig] + # Configs of custom conversation model. + # @!attribute [rw] conversation_process_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::ConversationProcessConfig] + # Configs for processing conversation. + class SuggestionFeatureConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detail human agent assistant config. + # @!attribute [rw] feature_configs + # @return [::Array<::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig>] + # Configuration of different suggestion features. One feature can have only + # one config. + # @!attribute [rw] group_suggestion_responses + # @return [::Boolean] + # If `group_suggestion_responses` is false, and there are multiple + # `feature_configs` in `event based suggestion` or + # StreamingAnalyzeContent, we will try to deliver suggestions to customers + # as soon as we get new suggestion. Different type of suggestions based on + # the same context will be in separate Pub/Sub event or + # `StreamingAnalyzeContentResponse`. + # + # If `group_suggestion_responses` set to true. All the suggestions to the + # same participant based on the same context will be grouped into a single + # Pub/Sub event or StreamingAnalyzeContentResponse. + # @!attribute [rw] generators + # @return [::Array<::String>] + # Optional. List of various generator resource names used in the + # conversation profile. + # @!attribute [rw] disable_high_latency_features_sync_delivery + # @return [::Boolean] + # Optional. When disable_high_latency_features_sync_delivery is true and + # using the AnalyzeContent API, we will not deliver the responses from high + # latency features in the API response. The + # human_agent_assistant_config.notification_config must be configured and + # enable_event_based_suggestion must be set to true to receive the + # responses from high latency features in Pub/Sub. High latency feature(s): + # KNOWLEDGE_ASSIST + # @!attribute [rw] skip_empty_event_based_suggestion + # @return [::Boolean] + # Optional. Enable skipping event based suggestion if the suggestion is + # empty. + # + # For example, with this field disabled, Knowledge Assist feature sends + # a Pub/Sub message when there are no suggestions. Enabling this field + # will change the behavior to skip the Pub/Sub message in this situation. + # @!attribute [rw] use_unredacted_conversation_data + # @return [::Boolean] + # Optional. If true, + # use unredacted transcript data (Supported features: AI_COACH) and + # use unredacted ingested context (Supported features: All Agent Assist + # features) + # @!attribute [rw] enable_async_tool_call + # @return [::Boolean] + # Optional. If true, enable asynchronous execution of tools. + class SuggestionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config for suggestion query. + # @!attribute [rw] knowledge_base_query_source + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::KnowledgeBaseQuerySource] + # Query from knowledgebase. It is used by: + # ARTICLE_SUGGESTION, FAQ. + # + # Note: The following fields are mutually exclusive: `knowledge_base_query_source`, `document_query_source`, `dialogflow_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] document_query_source + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::DocumentQuerySource] + # Query from knowledge base document. It is used by: + # SMART_REPLY, SMART_COMPOSE. + # + # Note: The following fields are mutually exclusive: `document_query_source`, `knowledge_base_query_source`, `dialogflow_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] dialogflow_query_source + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::DialogflowQuerySource] + # Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + # + # Note: The following fields are mutually exclusive: `dialogflow_query_source`, `knowledge_base_query_source`, `document_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] max_results + # @return [::Integer] + # Maximum number of results to return. Currently, if unset, defaults to 10. + # And the max number is 20. + # @!attribute [rw] confidence_threshold + # @return [::Float] + # Confidence threshold of query result. + # + # Agent Assist gives each suggestion a score in the range [0.0, 1.0], based + # on the relevance between the suggestion and the current conversation + # context. A score of 0.0 has no relevance, while a score of 1.0 has high + # relevance. Only suggestions with a score greater than or equal to the + # value of this field are included in the results. + # + # For a baseline model (the default), the recommended value is in the range + # [0.05, 0.1]. + # + # For a custom model, there is no recommended value. Tune this value by + # starting from a very low value and slowly increasing until you have + # desired results. + # + # If this field is not set, it defaults to 0.0, which means that all + # suggestions are returned. + # + # Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, + # KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. + # @!attribute [rw] context_filter_settings + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::ContextFilterSettings] + # Determines how recent conversation context is filtered when generating + # suggestions. If unspecified, no messages will be dropped. + # @!attribute [rw] sections + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::Sections] + # Optional. The customized sections chosen to return when requesting a + # summary of a conversation. + # @!attribute [rw] context_size + # @return [::Integer] + # Optional. The number of recent messages to include in the context. + # Supported features: KNOWLEDGE_ASSIST. + class SuggestionQueryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Knowledge base source settings. + # + # Supported features: ARTICLE_SUGGESTION, FAQ. + # @!attribute [rw] knowledge_bases + # @return [::Array<::String>] + # Required. Knowledge bases to query. Format: + # `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + # bases are supported. + class KnowledgeBaseQuerySource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Document source settings. + # + # Supported features: SMART_REPLY, SMART_COMPOSE. + # @!attribute [rw] documents + # @return [::Array<::String>] + # Required. Knowledge documents to query from. Format: + # `projects//locations//knowledgeBases//documents/`. + # Currently, at most 5 documents are supported. + class DocumentQuerySource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Dialogflow source setting. + # + # Supported feature: DIALOGFLOW_ASSIST. + # @!attribute [rw] agent + # @return [::String] + # Required. The name of a Dialogflow virtual agent used for end user side + # intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in + # the same Dialogflow project. + # @!attribute [rw] human_agent_side_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::DialogflowQuerySource::HumanAgentSideConfig] + # Optional. The Dialogflow assist configuration for human agent. + class DialogflowQuerySource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The configuration used for human agent side Dialogflow assist + # suggestion. + # @!attribute [rw] agent + # @return [::String] + # Optional. The name of a dialogflow virtual agent used for intent + # detection and suggestion triggered by human agent. + # Format: `projects//locations//agent`. + class HumanAgentSideConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings that determine how to filter recent conversation context when + # generating suggestions. + # @!attribute [rw] drop_handoff_messages + # @return [::Boolean] + # If set to true, the last message from virtual agent (hand off message) + # and the message before it (trigger message of hand off) are dropped. + # @!attribute [rw] drop_virtual_agent_messages + # @return [::Boolean] + # If set to true, all messages from virtual agent are dropped. + # @!attribute [rw] drop_ivr_messages + # @return [::Boolean] + # If set to true, all messages from ivr stage are dropped. + class ContextFilterSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Custom sections to return when requesting a summary of a conversation. + # This is only supported when `baseline_model_version` == '2.0'. + # + # Supported features: CONVERSATION_SUMMARIZATION, + # CONVERSATION_SUMMARIZATION_VOICE. + # @!attribute [rw] section_types + # @return [::Array<::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::Sections::SectionType>] + # The selected sections chosen to return when requesting a summary of a + # conversation. A duplicate selected section will be treated as a single + # selected section. If section types are not provided, the default will + # be \\{SITUATION, ACTION, RESULT}. + class Sections + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Selectable sections to return when requesting a summary of a + # conversation. + module SectionType + # Undefined section type, does not return anything. + SECTION_TYPE_UNSPECIFIED = 0 + + # What the customer needs help with or has question about. + # Section name: "situation". + SITUATION = 1 + + # What the agent does to help the customer. + # Section name: "action". + ACTION = 2 + + # Result of the customer service. A single word describing the result + # of the conversation. + # Section name: "resolution". + RESOLUTION = 3 + + # Reason for cancellation if the customer requests for a cancellation. + # "N/A" otherwise. + # Section name: "reason_for_cancellation". + REASON_FOR_CANCELLATION = 4 + + # "Unsatisfied" or "Satisfied" depending on the customer's feelings at + # the end of the conversation. + # Section name: "customer_satisfaction". + CUSTOMER_SATISFACTION = 5 + + # Key entities extracted from the conversation, such as ticket number, + # order number, dollar amount, etc. + # Section names are prefixed by "entities/". + ENTITIES = 6 + end + end + end + + # Custom conversation models used in agent assist feature. + # + # Supported feature: ARTICLE_SUGGESTION, SMART_COMPOSE, SMART_REPLY, + # CONVERSATION_SUMMARIZATION + # @!attribute [rw] model + # @return [::String] + # Conversation model resource name. Format: `projects//conversationModels/`. + # @!attribute [rw] baseline_model_version + # @return [::String] + # Version of current baseline model. It will be ignored if + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::ConversationModelConfig#model model} + # is set. Valid versions are: + # + # - Article Suggestion baseline model: + # - 0.9 + # - 1.0 (default) + # - Summarization baseline model: + # - 1.0 + class ConversationModelConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config to process conversation. + # @!attribute [rw] recent_sentences_count + # @return [::Integer] + # Number of recent non-small-talk sentences to use as context for article + # and FAQ suggestion + class ConversationProcessConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for analyses to run on each conversation message. + # @!attribute [rw] enable_entity_extraction + # @return [::Boolean] + # Enable entity extraction in conversation messages on [agent assist + # stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + # If unspecified, defaults to false. + # + # Currently, this feature is not general available, please contact Google + # to get access. + # @!attribute [rw] enable_sentiment_analysis + # @return [::Boolean] + # Enable sentiment analysis in conversation messages on [agent assist + # stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). + # If unspecified, defaults to false. Sentiment analysis inspects user input + # and identifies the prevailing subjective opinion, especially to determine + # a user's attitude as positive, negative, or neutral: + # https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + # For + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} + # method, result will be in + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#message StreamingAnalyzeContentResponse.message.SentimentAnalysisResult}. + # For + # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} + # method, result will be in + # {::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse#message AnalyzeContentResponse.message.SentimentAnalysisResult} + # For + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages} + # method, result will be in + # {::Google::Cloud::Dialogflow::V2::ListMessagesResponse#messages ListMessagesResponse.messages.SentimentAnalysisResult} + # If Pub/Sub notification is configured, result will be in + # {::Google::Cloud::Dialogflow::V2::ConversationEvent#new_message_payload ConversationEvent.new_message_payload.SentimentAnalysisResult}. + # @!attribute [rw] enable_sentiment_analysis_v3 + # @return [::Boolean] + # Optional. Enables sentiment analysis for audio input and conversation + # messages. If unspecified, defaults to false. If this flag is set to true, + # other 'enable_sentiment_analysis' fields will be ignored. + # + # Sentiment analysis inspects user input and identifies the prevailing + # subjective opinion, especially to determine a user's attitude as + # positive, negative, or neutral. + # https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + # For + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} + # method, result will be in + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#message StreamingAnalyzeContentResponse.message.SentimentAnalysisResult}. + # For + # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} + # method, result will be in + # {::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse#message AnalyzeContentResponse.message.SentimentAnalysisResult} + # For + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages} + # method, result will be in + # {::Google::Cloud::Dialogflow::V2::ListMessagesResponse#messages ListMessagesResponse.messages.SentimentAnalysisResult} + # If Pub/Sub notification is configured, result will be in + # {::Google::Cloud::Dialogflow::V2::ConversationEvent#new_message_payload ConversationEvent.new_message_payload.SentimentAnalysisResult}. + class MessageAnalysisConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Defines the hand off to a live agent, typically on which external agent + # service provider to connect to a conversation. + # + # Currently, this feature is not general available, please contact Google + # to get access. + # @!attribute [rw] live_person_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentHandoffConfig::LivePersonConfig] + # Uses [LivePerson](https://www.liveperson.com). + # + # Note: The following fields are mutually exclusive: `live_person_config`, `salesforce_live_agent_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] salesforce_live_agent_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentHandoffConfig::SalesforceLiveAgentConfig] + # Uses Salesforce Live Agent. + # + # Note: The following fields are mutually exclusive: `salesforce_live_agent_config`, `live_person_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class HumanAgentHandoffConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration specific to [LivePerson](https://www.liveperson.com). + # @!attribute [rw] account_number + # @return [::String] + # Required. Account number of the LivePerson account to connect. This is + # the account number you input at the login page. + class LivePersonConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration specific to Salesforce Live Agent. + # @!attribute [rw] organization_id + # @return [::String] + # Required. The organization ID of the Salesforce account. + # @!attribute [rw] deployment_id + # @return [::String] + # Required. Live Agent deployment ID. + # @!attribute [rw] button_id + # @return [::String] + # Required. Live Agent chat button ID. + # @!attribute [rw] endpoint_domain + # @return [::String] + # Required. Domain of the Live Agent endpoint for this agent. You can find + # the endpoint URL in the `Live Agent settings` page. For example if URL + # has the form https://d.la4-c2-phx.salesforceliveagent.com/..., + # you should fill in d.la4-c2-phx.salesforceliveagent.com. + class SalesforceLiveAgentConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Defines notification behavior. + # @!attribute [rw] topic + # @return [::String] + # Name of the Pub/Sub topic to publish conversation + # events like + # {::Google::Cloud::Dialogflow::V2::ConversationEvent::Type::CONVERSATION_STARTED CONVERSATION_STARTED} + # as serialized + # {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent} protos. + # + # For telephony integration to receive notification, make sure either this + # topic is in the same project as the conversation or you grant + # `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service + # Agent` role in the topic project. + # + # For chat integration to receive notification, make sure API caller has been + # granted the `Dialogflow Service Agent` role for the topic. + # + # Format: `projects//locations//topics/`. + # @!attribute [rw] message_format + # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig::MessageFormat] + # Format of message. + class NotificationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Format of cloud pub/sub message. + module MessageFormat + # If it is unspecified, PROTO will be used. + MESSAGE_FORMAT_UNSPECIFIED = 0 + + # Pub/Sub message will be serialized proto. + PROTO = 1 + + # Pub/Sub message will be json. + JSON = 2 + end + end + + # Defines logging behavior for conversation lifecycle events. + # @!attribute [rw] enable_stackdriver_logging + # @return [::Boolean] + # Whether to log conversation events like + # {::Google::Cloud::Dialogflow::V2::ConversationEvent::Type::CONVERSATION_STARTED CONVERSATION_STARTED} + # to Stackdriver in the conversation project as JSON format + # {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent} protos. + class LoggingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the SIP configuration. + # @!attribute [rw] create_conversation_on_the_fly + # @return [::Boolean] + # Asks Dialogflow Telephony to create the conversation provided in the SIP + # header on the fly when the call comes in. + # @!attribute [rw] inactive_start + # @return [::Boolean] + # Starts the conversation with inactive SDP directives + # @!attribute [rw] max_audio_recording_duration + # @return [::Google::Protobuf::Duration] + # Max duration for audio recording. + # Overrides the default value of 15 min. + # Max value is 8 hours. + # @!attribute [rw] allow_virtual_agent_interaction + # @return [::Boolean] + # Allows interactions with a Dialogflow virtual agent even if the call is + # connected for SIPREC purposes. + # @!attribute [rw] keep_conversation_running + # @return [::Boolean] + # Keeps the conversation running even if the call is disconnected. + # @!attribute [rw] copy_inbound_call_leg_headers + # @return [::Array<::String>] + # List of inbound call leg headers to be copied to outbound call legs created + # later. + # @!attribute [rw] ignore_reinvite_media_direction + # @return [::Boolean] + # Ignores any media direction in the reINVITE SDP offer. Reuse the previous + # media direction. + class SipConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of Human Agent Assistant API suggestion to perform, and the maximum + # number of results to return for that type. Multiple `Feature` objects can + # be specified in the `features` list. + # @!attribute [rw] type + # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] + # Type of Human Agent Assistant API feature to request. + class SuggestionFeature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines the type of Human Agent Assistant feature. + module Type + # Unspecified feature type. + TYPE_UNSPECIFIED = 0 + + # Run article suggestion model for chat. + ARTICLE_SUGGESTION = 1 + + # Run FAQ model for chat. + FAQ = 2 + + # Run smart reply model for chat. + SMART_REPLY = 3 + + # Run conversation summarization model for chat. + CONVERSATION_SUMMARIZATION = 8 + + # Run knowledge search with text input from agent or text generated query. + KNOWLEDGE_SEARCH = 14 + + # Run knowledge assist with automatic query generation. + KNOWLEDGE_ASSIST = 15 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config ConversationProfiles.SetSuggestionFeatureConfig}. + # @!attribute [rw] conversation_profile + # @return [::String] + # Required. The Conversation Profile to add or update the suggestion feature + # config. Format: `projects//locations//conversationProfiles/`. + # @!attribute [rw] participant_role + # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Required. The participant role to add or update the suggestion feature + # config. Only HUMAN_AGENT or END_USER can be used. + # @!attribute [rw] suggestion_feature_config + # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig] + # Required. The suggestion feature config to add or update. + class SetSuggestionFeatureConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config ConversationProfiles.ClearSuggestionFeatureConfig}. + # @!attribute [rw] conversation_profile + # @return [::String] + # Required. The Conversation Profile to add or update the suggestion feature + # config. Format: `projects//locations//conversationProfiles/`. + # @!attribute [rw] participant_role + # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Required. The participant role to remove the suggestion feature + # config. Only HUMAN_AGENT or END_USER can be used. + # @!attribute [rw] suggestion_feature_type + # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] + # Required. The type of the suggestion feature to remove. + class ClearSuggestionFeatureConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for a + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config ConversationProfiles.SetSuggestionFeatureConfig} + # operation. + # @!attribute [rw] conversation_profile + # @return [::String] + # The resource name of the conversation profile. Format: + # `projects//locations//conversationProfiles/` + # @!attribute [rw] participant_role + # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Required. The participant role to add or update the suggestion feature + # config. Only HUMAN_AGENT or END_USER can be used. + # @!attribute [rw] suggestion_feature_type + # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] + # Required. The type of the suggestion feature to add or update. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp whe the request was created. The time is measured on server side. + class SetSuggestionFeatureConfigOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for a + # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config ConversationProfiles.ClearSuggestionFeatureConfig} + # operation. + # @!attribute [rw] conversation_profile + # @return [::String] + # The resource name of the conversation profile. Format: + # `projects//locations//conversationProfiles/` + # @!attribute [rw] participant_role + # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Required. The participant role to remove the suggestion feature + # config. Only HUMAN_AGENT or END_USER can be used. + # @!attribute [rw] suggestion_feature_type + # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] + # Required. The type of the suggestion feature to remove. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp whe the request was created. The time is measured on server side. + class ClearSuggestionFeatureConfigOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/document.rb new file mode 100644 index 000000000000..7221bf0ccc7e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/document.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! + + +module Google + module Cloud + module Dialogflow + module V2 + # A knowledge document to be used by a + # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBase}. + # + # For more information, see the [knowledge base + # guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). + # + # Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + # only use `projects.knowledgeBases.documents`. + # @!attribute [rw] name + # @return [::String] + # Optional. The document resource name. + # The name must be empty when creating a document. + # Format: `projects//locations//knowledgeBases//documents/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the document. The name must be 1024 bytes or + # less; otherwise, the creation request fails. + # @!attribute [rw] mime_type + # @return [::String] + # Required. The MIME type of this document. + # @!attribute [rw] knowledge_types + # @return [::Array<::Google::Cloud::Dialogflow::V2::Document::KnowledgeType>] + # Required. The knowledge type of document content. + # @!attribute [rw] content_uri + # @return [::String] + # The URI where the file content is located. + # + # For documents stored in Google Cloud Storage, these URIs must have + # the form `gs:///`. + # + # NOTE: External URLs must correspond to public webpages, i.e., they must + # be indexed by Google Search. In particular, URLs for showing documents in + # Google Cloud Storage (i.e. the URL in your browser) are not supported. + # Instead use the `gs://` format URI described above. + # + # Note: The following fields are mutually exclusive: `content_uri`, `raw_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] raw_content + # @return [::String] + # The raw content of the document. This field is only permitted for + # EXTRACTIVE_QA and FAQ knowledge types. + # + # Note: The following fields are mutually exclusive: `raw_content`, `content_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] enable_auto_reload + # @return [::Boolean] + # Optional. If true, we try to automatically reload the document every day + # (at a time picked by the system). If false or unspecified, we don't try + # to automatically reload the document. + # + # Currently you can only enable automatic reload for documents sourced from + # a public url, see `source` field for the source types. + # + # Reload status can be tracked in `latest_reload_status`. If a reload + # fails, we will keep the document unchanged. + # + # If a reload fails with internal errors, the system will try to reload the + # document on the next day. + # If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the + # system will not try to reload the document anymore. You need to manually + # reload the document successfully by calling `ReloadDocument` and clear the + # errors. + # @!attribute [r] latest_reload_status + # @return [::Google::Cloud::Dialogflow::V2::Document::ReloadStatus] + # Output only. The time and status of the latest reload. + # This reload may have been triggered automatically or manually + # and may not have succeeded. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Metadata for the document. The metadata supports arbitrary + # key-value pairs. Suggested use cases include storing a document's title, + # an external URL distinct from the document's content_uri, etc. + # The max size of a `key` or a `value` of the metadata is 1024 bytes. + # @!attribute [r] state + # @return [::Google::Cloud::Dialogflow::V2::Document::State] + # Output only. The current state of the document. + class Document + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of a reload attempt. + # @!attribute [rw] time + # @return [::Google::Protobuf::Timestamp] + # The time of a reload attempt. + # This reload may have been triggered automatically or manually and may + # not have succeeded. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # The status of a reload attempt or the initial load. + class ReloadStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The knowledge type of document content. + module KnowledgeType + # The type is unspecified or arbitrary. + KNOWLEDGE_TYPE_UNSPECIFIED = 0 + + # The document content contains question and answer pairs as either HTML or + # CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats + # may fail to be parsed. + # + # CSV must have questions in the first column and answers in the second, + # with no header. Because of this explicit format, they are always parsed + # accurately. + FAQ = 1 + + # Documents for which unstructured text is extracted and used for + # question answering. + EXTRACTIVE_QA = 2 + + # The entire document content as a whole can be used for query results. + # Only for Contact Center Solutions on Dialogflow. + ARTICLE_SUGGESTION = 3 + + # The document contains agent-facing Smart Reply entries. + AGENT_FACING_SMART_REPLY = 4 + end + + # Possible states of the document + module State + # The document state is unspecified. + STATE_UNSPECIFIED = 0 + + # The document creation is in progress. + CREATING = 1 + + # The document is active and ready to use. + ACTIVE = 2 + + # The document updation is in progress. + UPDATING = 3 + + # The document is reloading. + RELOADING = 4 + + # The document deletion is in progress. + DELETING = 5 + end + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#get_document Documents.GetDocument}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the document to retrieve. + # Format `projects//locations//knowledgeBases//documents/`. + class GetDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#list_documents Documents.ListDocuments}. + # @!attribute [rw] parent + # @return [::String] + # Required. The knowledge base to list all documents for. + # Format: `projects//locations//knowledgeBases/`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return in a single page. By + # default 10 and at most 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous list request. + # @!attribute [rw] filter + # @return [::String] + # The filter expression used to filter documents returned by the list method. + # The expression has the following syntax: + # + # [AND ] ... + # + # The following fields and operators are supported: + # + # * knowledge_types with has(:) operator + # * display_name with has(:) operator + # * state with equals(=) operator + # + # Examples: + # + # * "knowledge_types:FAQ" matches documents with FAQ knowledge type. + # * "display_name:customer" matches documents whose display name contains + # "customer". + # * "state=ACTIVE" matches documents with ACTIVE state. + # * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + class ListDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#list_documents Documents.ListDocuments}. + # @!attribute [rw] documents + # @return [::Array<::Google::Cloud::Dialogflow::V2::Document>] + # The list of documents. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#create_document Documents.CreateDocument}. + # @!attribute [rw] parent + # @return [::String] + # Required. The knowledge base to create a document for. + # Format: `projects//locations//knowledgeBases/`. + # @!attribute [rw] document + # @return [::Google::Cloud::Dialogflow::V2::Document] + # Required. The document to create. + class CreateDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#import_documents Documents.ImportDocuments}. + # @!attribute [rw] parent + # @return [::String] + # Required. The knowledge base to import documents into. + # Format: `projects//locations//knowledgeBases/`. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Dialogflow::V2::GcsSources] + # Optional. The Google Cloud Storage location for the documents. + # The path can include a wildcard. + # + # These URIs may have the forms + # `gs:///`. + # `gs:////*.`. + # @!attribute [rw] document_template + # @return [::Google::Cloud::Dialogflow::V2::ImportDocumentTemplate] + # Required. Document template used for importing all the documents. + # @!attribute [rw] import_gcs_custom_metadata + # @return [::Boolean] + # Whether to import custom metadata from Google Cloud Storage. + # Only valid when the document source is Google Cloud Storage URI. + class ImportDocumentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The template used for importing documents. + # @!attribute [rw] mime_type + # @return [::String] + # Required. The MIME type of the document. + # @!attribute [rw] knowledge_types + # @return [::Array<::Google::Cloud::Dialogflow::V2::Document::KnowledgeType>] + # Required. The knowledge type of document content. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # Metadata for the document. The metadata supports arbitrary + # key-value pairs. Suggested use cases include storing a document's title, + # an external URL distinct from the document's content_uri, etc. + # The max size of a `key` or a `value` of the metadata is 1024 bytes. + class ImportDocumentTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#import_documents Documents.ImportDocuments}. + # @!attribute [rw] warnings + # @return [::Array<::Google::Rpc::Status>] + # Includes details about skipped documents or any other warnings. + class ImportDocumentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#delete_document Documents.DeleteDocument}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the document to delete. + # Format: `projects//locations//knowledgeBases//documents/`. + class DeleteDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#update_document Documents.UpdateDocument}. + # @!attribute [rw] document + # @return [::Google::Cloud::Dialogflow::V2::Document] + # Required. The document to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Not specified means `update all`. + # Currently, only `display_name` can be updated, an InvalidArgument will be + # returned for attempting to update other fields. + class UpdateDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#reload_document Documents.ReloadDocument}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the document to reload. + # Format: `projects//locations//knowledgeBases//documents/` + # @!attribute [rw] content_uri + # @return [::String] + # Optional. The path of gcs source file for reloading document content. For + # now, only gcs uri is supported. + # + # For documents stored in Google Cloud Storage, these URIs must have + # the form `gs:///`. + # @!attribute [rw] import_gcs_custom_metadata + # @return [::Boolean] + # Optional. Whether to import custom metadata from Google Cloud Storage. + # Only valid when the document source is Google Cloud Storage URI. + # @!attribute [rw] smart_messaging_partial_update + # @return [::Boolean] + # Optional. When enabled, the reload request is to apply partial update to + # the smart messaging allowlist. + class ReloadDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::Documents::Client#export_document Documents.ExportDocument}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the document to export. + # Format: `projects//locations//knowledgeBases//documents/`. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Dialogflow::V2::GcsDestination] + # Cloud Storage file path to export the document. + # @!attribute [rw] export_full_content + # @return [::Boolean] + # When enabled, export the full content of the document including empirical + # probability. + # @!attribute [rw] smart_messaging_partial_update + # @return [::Boolean] + # When enabled, export the smart messaging allowlist document for partial + # update. + class ExportDocumentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata related to the Export Data Operations (e.g. ExportDocument). + # @!attribute [rw] exported_gcs_destination + # @return [::Google::Cloud::Dialogflow::V2::GcsDestination] + # Cloud Storage file path of the exported data. + class ExportOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata in google::longrunning::Operation for Knowledge operations. + # @!attribute [r] state + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata::State] + # Output only. The current state of this operation. + # @!attribute [rw] knowledge_base + # @return [::String] + # The name of the knowledge base interacted with during the operation. + # @!attribute [rw] export_operation_metadata + # @return [::Google::Cloud::Dialogflow::V2::ExportOperationMetadata] + # Metadata for the Export Data Operation such as the destination of export. + # @!attribute [rw] done_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation finished. + class KnowledgeOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # States of the operation. + module State + # State unspecified. + STATE_UNSPECIFIED = 0 + + # The operation has been created. + PENDING = 1 + + # The operation is currently running. + RUNNING = 2 + + # The operation is done, either cancelled or completed. + DONE = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/encryption_spec.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/encryption_spec.rb new file mode 100644 index 000000000000..36bb0b039413 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/encryption_spec.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 Dialogflow + module V2 + # The request to get location-level encryption specification. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the encryption spec resource to get. + class GetEncryptionSpecRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A customer-managed encryption key specification that can be applied to all + # created resources (e.g. Conversation). + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name of the encryption key specification resource. + # Format: + # projects/\\{project}/locations/\\{location}/encryptionSpec + # @!attribute [rw] kms_key + # @return [::String] + # Required. The name of customer-managed encryption key that is used to + # secure a resource and its sub-resources. If empty, the resource is secured + # by the default Google encryption key. Only the key in the same location as + # this resource is allowed to be used for encryption. Format: + # `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` + class EncryptionSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request to initialize a location-level encryption specification. + # @!attribute [rw] encryption_spec + # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpec] + # Required. The encryption spec used for CMEK encryption. It is required that + # the kms key is in the same region as the endpoint. The same key will be + # used for all provisioned resources, if encryption is available. If the + # kms_key_name is left empty, no encryption will be enforced. + class InitializeEncryptionSpecRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response to initialize a location-level encryption specification. + class InitializeEncryptionSpecResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for initializing a location-level encryption specification. + # @!attribute [r] request + # @return [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest] + # Output only. The original request for initialization. + class InitializeEncryptionSpecMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/entity_type.rb new file mode 100644 index 000000000000..54d6bdf8d324 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/entity_type.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! + + +module Google + module Cloud + module Dialogflow + module V2 + # Each intent parameter has a type, called the entity type, which dictates + # exactly how data from an end-user expression is extracted. + # + # Dialogflow provides predefined system entities that can match many common + # types of data. For example, there are system entities for matching dates, + # times, colors, email addresses, and so on. You can also create your own + # custom entities for matching custom data. For example, you could define a + # vegetable entity that can match the types of vegetables available for + # purchase with a grocery store agent. + # + # For more information, see the + # [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview). + # @!attribute [rw] name + # @return [::String] + # The unique identifier of the entity type. + # Required for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#update_entity_type EntityTypes.UpdateEntityType} + # and + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types EntityTypes.BatchUpdateEntityTypes} + # methods. Format: `projects//agent/entityTypes/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The name of the entity type. + # @!attribute [rw] kind + # @return [::Google::Cloud::Dialogflow::V2::EntityType::Kind] + # Required. Indicates the kind of entity type. + # @!attribute [rw] auto_expansion_mode + # @return [::Google::Cloud::Dialogflow::V2::EntityType::AutoExpansionMode] + # Optional. Indicates whether the entity type can be automatically + # expanded. + # @!attribute [rw] entities + # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity>] + # Optional. The collection of entity entries associated with the entity type. + # @!attribute [rw] enable_fuzzy_extraction + # @return [::Boolean] + # Optional. Enables fuzzy entity extraction during classification. + class EntityType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An **entity entry** for an associated entity type. + # @!attribute [rw] value + # @return [::String] + # Required. The primary value associated with this entity entry. + # For example, if the entity type is *vegetable*, the value could be + # *scallions*. + # + # For `KIND_MAP` entity types: + # + # * A reference value to be used in place of synonyms. + # + # For `KIND_LIST` entity types: + # + # * A string that can contain references to other entity types (with or + # without aliases). + # @!attribute [rw] synonyms + # @return [::Array<::String>] + # Required. A collection of value synonyms. For example, if the entity type + # is *vegetable*, and `value` is *scallions*, a synonym could be *green + # onions*. + # + # For `KIND_LIST` entity types: + # + # * This collection must contain exactly one synonym equal to `value`. + class Entity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents kinds of entities. + module Kind + # Not specified. This value should be never used. + KIND_UNSPECIFIED = 0 + + # Map entity types allow mapping of a group of synonyms to a reference + # value. + KIND_MAP = 1 + + # List entity types contain a set of entries that do not map to reference + # values. However, list entity types can contain references to other entity + # types (with or without aliases). + KIND_LIST = 2 + + # Regexp entity types allow to specify regular expressions in entries + # values. + KIND_REGEXP = 3 + end + + # Represents different entity type expansion modes. Automated expansion + # allows an agent to recognize values that have not been explicitly listed in + # the entity (for example, new kinds of shopping list items). + module AutoExpansionMode + # Auto expansion disabled for the entity. + AUTO_EXPANSION_MODE_UNSPECIFIED = 0 + + # Allows an agent to recognize values that have not been explicitly + # listed in the entity. + AUTO_EXPANSION_MODE_DEFAULT = 1 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#list_entity_types EntityTypes.ListEntityTypes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list all entity types from. + # Format: `projects//agent`. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListEntityTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#list_entity_types EntityTypes.ListEntityTypes}. + # @!attribute [rw] entity_types + # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType>] + # The list of agent entity types. There will be a maximum number of items + # returned based on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListEntityTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#get_entity_type EntityTypes.GetEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entity type. + # Format: `projects//agent/entityTypes/`. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + class GetEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#create_entity_type EntityTypes.CreateEntityType}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create a entity type for. + # Format: `projects//agent`. + # @!attribute [rw] entity_type + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # Required. The entity type to create. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + class CreateEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#update_entity_type EntityTypes.UpdateEntityType}. + # @!attribute [rw] entity_type + # @return [::Google::Cloud::Dialogflow::V2::EntityType] + # Required. The entity type to update. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields get updated. + class UpdateEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#delete_entity_type EntityTypes.DeleteEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entity type to delete. + # Format: `projects//agent/entityTypes/`. + class DeleteEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types EntityTypes.BatchUpdateEntityTypes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the agent to update or create entity types in. + # Format: `projects//agent`. + # @!attribute [rw] entity_type_batch_uri + # @return [::String] + # The URI to a Google Cloud Storage file containing entity types to update + # or create. The file format can either be a serialized proto (of + # EntityBatch type) or a JSON object. Note: The URI must start with + # "gs://". + # + # Note: The following fields are mutually exclusive: `entity_type_batch_uri`, `entity_type_batch_inline`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] entity_type_batch_inline + # @return [::Google::Cloud::Dialogflow::V2::EntityTypeBatch] + # The collection of entity types to update or create. + # + # Note: The following fields are mutually exclusive: `entity_type_batch_inline`, `entity_type_batch_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields get updated. + class BatchUpdateEntityTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types EntityTypes.BatchUpdateEntityTypes}. + # @!attribute [rw] entity_types + # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType>] + # The collection of updated or created entity types. + class BatchUpdateEntityTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entity_types EntityTypes.BatchDeleteEntityTypes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the agent to delete all entities types for. Format: + # `projects//agent`. + # @!attribute [rw] entity_type_names + # @return [::Array<::String>] + # Required. The names entity types to delete. All names must point to the + # same agent as `parent`. + class BatchDeleteEntityTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_create_entities EntityTypes.BatchCreateEntities}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the entity type to create entities in. Format: + # `projects//agent/entityTypes/`. + # @!attribute [rw] entities + # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity>] + # Required. The entities to create. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + class BatchCreateEntitiesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entities EntityTypes.BatchUpdateEntities}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the entity type to update or create entities in. + # Format: `projects//agent/entityTypes/`. + # @!attribute [rw] entities + # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity>] + # Required. The entities to update or create. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields get updated. + class BatchUpdateEntitiesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entities EntityTypes.BatchDeleteEntities}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the entity type to delete entries for. Format: + # `projects//agent/entityTypes/`. + # @!attribute [rw] entity_values + # @return [::Array<::String>] + # Required. The reference `values` of the entities to delete. Note that + # these are not fully-qualified names, i.e. they don't start with + # `projects/`. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + class BatchDeleteEntitiesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message is a wrapper around a collection of entity types. + # @!attribute [rw] entity_types + # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType>] + # A collection of entity types. + class EntityTypeBatch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/environment.rb new file mode 100644 index 000000000000..42133bbd059d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/environment.rb @@ -0,0 +1,311 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # You can create multiple versions of your agent and publish them to separate + # environments. + # + # When you edit an agent, you are editing the draft agent. At any point, you + # can save the draft agent as an agent version, which is an immutable snapshot + # of your agent. + # + # When you save the draft agent, it is published to the default environment. + # When you create agent versions, you can publish them to custom environments. + # You can create a variety of custom environments for: + # + # - testing + # - development + # - production + # - etc. + # + # For more information, see the [versions and environments + # guide](https://cloud.google.com/dialogflow/docs/agents-versions). + # @!attribute [r] name + # @return [::String] + # Output only. The unique identifier of this agent environment. + # Supported formats: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + # @!attribute [rw] description + # @return [::String] + # Optional. The developer-provided description for this environment. + # The maximum length is 500 characters. If exceeded, the request is rejected. + # @!attribute [rw] agent_version + # @return [::String] + # Optional. The agent version loaded into this environment. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + # @!attribute [r] state + # @return [::Google::Cloud::Dialogflow::V2::Environment::State] + # Output only. The state of this environment. This field is read-only, i.e., + # it cannot be set by create and update methods. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last update time of this environment. This field is + # read-only, i.e., it cannot be set by create and update methods. + # @!attribute [rw] text_to_speech_settings + # @return [::Google::Cloud::Dialogflow::V2::TextToSpeechSettings] + # Optional. Text to speech settings for this environment. + # @!attribute [rw] fulfillment + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] + # Optional. The fulfillment settings to use for this environment. + class Environment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents an environment state. When an environment is pointed to a new + # agent version, the environment is temporarily set to the `LOADING` state. + # During that time, the environment keeps on serving the previous version of + # the agent. After the new agent version is done loading, the environment is + # set back to the `RUNNING` state. + module State + # Not specified. This value is not used. + STATE_UNSPECIFIED = 0 + + # Stopped. + STOPPED = 1 + + # Loading. + LOADING = 2 + + # Running. + RUNNING = 3 + end + end + + # Instructs the speech synthesizer on how to generate the output audio content. + # @!attribute [rw] enable_text_to_speech + # @return [::Boolean] + # Optional. Indicates whether text to speech is enabled. Even when this field + # is false, other settings in this proto are still retained. + # @!attribute [rw] output_audio_encoding + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioEncoding] + # Required. Audio encoding of the synthesized audio content. + # @!attribute [rw] sample_rate_hertz + # @return [::Integer] + # Optional. The synthesis sample rate (in hertz) for this audio. If not + # provided, then the synthesizer will use the default sample rate based on + # the audio encoding. If this is different from the voice's natural sample + # rate, then the synthesizer will honor this request by converting to the + # desired sample rate (which might result in worse audio quality). + # @!attribute [rw] synthesize_speech_configs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig}] + # Optional. Configuration of how speech should be synthesized, mapping from + # language (https://cloud.google.com/dialogflow/docs/reference/language) to + # SynthesizeSpeechConfig. + class TextToSpeechSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig] + class SynthesizeSpeechConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Environments::Client#list_environments Environments.ListEnvironments}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list all environments from. + # Format: + # + # - `projects//agent` + # - `projects//locations//agent` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListEnvironmentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Environments::Client#list_environments Environments.ListEnvironments}. + # @!attribute [rw] environments + # @return [::Array<::Google::Cloud::Dialogflow::V2::Environment>] + # The list of agent environments. There will be a maximum number of items + # returned based on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListEnvironmentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment Environments.GetEnvironment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the environment. + # Supported formats: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + class GetEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Environments::Client#create_environment Environments.CreateEnvironment}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create an environment for. + # Supported formats: + # + # - `projects//agent` + # - `projects//locations//agent` + # @!attribute [rw] environment + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # Required. The environment to create. + # @!attribute [rw] environment_id + # @return [::String] + # Required. The unique id of the new environment. + class CreateEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Environments::Client#update_environment Environments.UpdateEnvironment}. + # @!attribute [rw] environment + # @return [::Google::Cloud::Dialogflow::V2::Environment] + # Required. The environment to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to control which fields get updated. + # @!attribute [rw] allow_load_to_draft_and_discard_changes + # @return [::Boolean] + # Optional. This field is used to prevent accidental overwrite of the default + # environment, which is an operation that cannot be undone. To confirm that + # the caller desires this overwrite, this field must be explicitly set to + # true when updating the default environment (environment ID = `-`). + class UpdateEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Environments::Client#delete_environment Environments.DeleteEnvironment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the environment to delete. + # / Format: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + class DeleteEnvironmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment_history Environments.GetEnvironmentHistory}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the environment to retrieve history for. + # Supported formats: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class GetEnvironmentHistoryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment_history Environments.GetEnvironmentHistory}. + # @!attribute [r] parent + # @return [::String] + # Output only. The name of the environment this history is for. + # Supported formats: + # + # - `projects//agent/environments/` + # - `projects//locations//agent/environments/` + # + # The environment ID for the default environment is `-`. + # @!attribute [r] entries + # @return [::Array<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] + # Output only. The list of agent environments. There will be a maximum number + # of items returned based on the page_size field in the request. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. Token to retrieve the next page of results, or empty if there + # are no more results in the list. + class EnvironmentHistory + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents an environment history entry. + # @!attribute [rw] agent_version + # @return [::String] + # The agent version loaded into this environment history entry. + # @!attribute [rw] description + # @return [::String] + # The developer-provided description for this environment history entry. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The creation time of this environment history entry. + class Entry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb new file mode 100644 index 000000000000..7dcce6bd1fac --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/fulfillment.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 Dialogflow + module V2 + # By default, your agent responds to a matched intent with a static response. + # As an alternative, you can provide a more dynamic response by using + # fulfillment. When you enable fulfillment for an intent, Dialogflow responds + # to that intent by calling a service that you define. For example, if an + # end-user wants to schedule a haircut on Friday, your service can check your + # database and respond to the end-user with availability information for + # Friday. + # + # For more information, see the [fulfillment + # guide](https://cloud.google.com/dialogflow/docs/fulfillment-overview). + # @!attribute [rw] name + # @return [::String] + # Required. The unique identifier of the fulfillment. + # Supported formats: + # + # - `projects//agent/fulfillment` + # - `projects//locations//agent/fulfillment` + # + # This field is not used for Fulfillment in an Environment. + # @!attribute [rw] display_name + # @return [::String] + # Optional. The human-readable name of the fulfillment, unique within the + # agent. + # + # This field is not used for Fulfillment in an Environment. + # @!attribute [rw] generic_web_service + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment::GenericWebService] + # Configuration for a generic web service. + # @!attribute [rw] enabled + # @return [::Boolean] + # Optional. Whether fulfillment is enabled. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::Dialogflow::V2::Fulfillment::Feature>] + # Optional. The field defines whether the fulfillment is enabled for certain + # features. + class Fulfillment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents configuration for a generic web service. + # Dialogflow supports two mechanisms for authentications: + # + # - Basic authentication with username and password. + # - Authentication with additional authentication headers. + # + # More information could be found at: + # https://cloud.google.com/dialogflow/docs/fulfillment-configure. + # @!attribute [rw] uri + # @return [::String] + # Required. The fulfillment URI for receiving POST requests. + # It must use https protocol. + # @!attribute [rw] username + # @return [::String] + # Optional. The user name for HTTP Basic authentication. + # @!attribute [rw] password + # @return [::String] + # Optional. The password for HTTP Basic authentication. + # @!attribute [rw] request_headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The HTTP request headers to send together with fulfillment + # requests. + # @!attribute [rw] is_cloud_function + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Indicates if generic web service is created through Cloud + # Functions integration. Defaults to false. + # + # is_cloud_function is deprecated. Cloud functions can be configured by + # its uri as a regular web service now. + class GenericWebService + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RequestHeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Whether fulfillment is enabled for the specific feature. + # @!attribute [rw] type + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment::Feature::Type] + # The type of the feature that enabled for fulfillment. + class Feature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the feature. + module Type + # Feature type not specified. + TYPE_UNSPECIFIED = 0 + + # Fulfillment is enabled for SmallTalk. + SMALLTALK = 1 + end + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Fulfillments::Client#get_fulfillment Fulfillments.GetFulfillment}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the fulfillment. + # Format: `projects//agent/fulfillment`. + class GetFulfillmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Fulfillments::Client#update_fulfillment Fulfillments.UpdateFulfillment}. + # @!attribute [rw] fulfillment + # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] + # Required. The fulfillment to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to control which fields get updated. If the mask is not + # present, all fields will be updated. + class UpdateFulfillmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/gcs.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/gcs.rb new file mode 100644 index 000000000000..e1029b9b2023 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/gcs.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! + + +module Google + module Cloud + module Dialogflow + module V2 + # Google Cloud Storage location for the inputs. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Required. Google Cloud Storage URIs for the inputs. A URI is of the form: + # `gs://bucket/object-prefix-or-name` + # Whether a prefix or name is used depends on the use case. + class GcsSources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Google Cloud Storage location for the output. + # @!attribute [rw] uri + # @return [::String] + # The Google Cloud Storage URIs for the output. A URI is of the + # form: + # `gs://bucket/object-prefix-or-name` + # Whether a prefix or name is used depends on the use case. The requesting + # user must have "write-permission" to the bucket. + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator.rb new file mode 100644 index 000000000000..133a538f5be0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator.rb @@ -0,0 +1,659 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Request message of CreateGenerator. + # @!attribute [rw] parent + # @return [::String] + # Required. The project/location to create generator for. Format: + # `projects//locations/` + # @!attribute [rw] generator + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # Required. The generator to create. + # @!attribute [rw] generator_id + # @return [::String] + # Optional. The ID to use for the generator, which will become the final + # component of the generator's resource name. + # + # The generator ID must be compliant with the regression formula + # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + # If the field is not provided, an Id will be auto-generated. + # If the field is provided, the caller is responsible for + # 1. the uniqueness of the ID, otherwise the request will be rejected. + # 2. the consistency for whether to use custom ID or not under a project to + # better ensure uniqueness. + class CreateGeneratorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message of GetGenerator. + # @!attribute [rw] name + # @return [::String] + # Required. The generator resource name to retrieve. Format: + # `projects//locations//generators/` + class GetGeneratorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message of ListGenerators. + # @!attribute [rw] parent + # @return [::String] + # Required. The project/location to list generators for. Format: + # `projects//locations/` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of conversation models to return in a single page. + # Default to 10. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListGeneratorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of ListGenerators. + # @!attribute [rw] generators + # @return [::Array<::Google::Cloud::Dialogflow::V2::Generator>] + # List of generators retrieved. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListGeneratorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request of DeleteGenerator. + # @!attribute [rw] name + # @return [::String] + # Required. The generator resource name to delete. Format: + # `projects//locations//generators/` + class DeleteGeneratorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request of UpdateGenerator. + # @!attribute [rw] generator + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # Required. The generator to update. + # The name field of generator is to identify the generator to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The list of fields to update. + class UpdateGeneratorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a message entry of a conversation. + # @!attribute [rw] role + # @return [::Google::Cloud::Dialogflow::V2::MessageEntry::Role] + # Optional. Participant role of the message. + # @!attribute [rw] text + # @return [::String] + # Optional. Transcript content of the message. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language of the text. See [Language + # Support](https://cloud.google.com/dialogflow/docs/reference/language) for a + # list of the currently supported language codes. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Create time of the message entry. + class MessageEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumeration of the roles a participant can play in a conversation. + module Role + # Participant role not set. + ROLE_UNSPECIFIED = 0 + + # Participant is a human agent. + HUMAN_AGENT = 1 + + # Participant is an automated agent, such as a Dialogflow agent. + AUTOMATED_AGENT = 2 + + # Participant is an end user that has called or chatted with + # Dialogflow services. + END_USER = 3 + end + end + + # Context of the conversation, including transcripts. + # @!attribute [rw] message_entries + # @return [::Array<::Google::Cloud::Dialogflow::V2::MessageEntry>] + # Optional. List of message transcripts in the conversation. + class ConversationContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List of summarization sections. + # @!attribute [rw] summarization_sections + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationSection>] + # Optional. Summarization sections. + class SummarizationSectionList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Providing examples in the generator (i.e. building a few-shot generator) + # helps convey the desired format of the LLM response. + # @!attribute [rw] conversation_context + # @return [::Google::Cloud::Dialogflow::V2::ConversationContext] + # Optional. Conversation transcripts. + # @!attribute [rw] extra_info + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Key is the placeholder field name in input, value is the value of + # the placeholder. E.g. instruction contains "@price", and ingested data has + # <"price", "10"> + # @!attribute [rw] summarization_section_list + # @return [::Google::Cloud::Dialogflow::V2::SummarizationSectionList] + # Summarization sections. + # @!attribute [rw] output + # @return [::Google::Cloud::Dialogflow::V2::GeneratorSuggestion] + # Required. Example output of the model. + class FewShotExample + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ExtraInfoEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The parameters of inference. + # @!attribute [rw] max_output_tokens + # @return [::Integer] + # Optional. Maximum number of the output tokens for the generator. + # @!attribute [rw] temperature + # @return [::Float] + # Optional. Controls the randomness of LLM predictions. + # Low temperature = less random. High temperature = more random. + # If unset (or 0), uses a default value of 0. + # @!attribute [rw] top_k + # @return [::Integer] + # Optional. Top-k changes how the model selects tokens for output. A top-k of + # 1 means the selected token is the most probable among all tokens in the + # model's vocabulary (also called greedy decoding), while a top-k of 3 means + # that the next token is selected from among the 3 most probable tokens + # (using temperature). For each token selection step, the top K tokens with + # the highest probabilities are sampled. Then tokens are further filtered + # based on topP with the final token selected using temperature sampling. + # Specify a lower value for less random responses and a higher value for more + # random responses. Acceptable value is [1, 40], default to 40. + # @!attribute [rw] top_p + # @return [::Float] + # Optional. Top-p changes how the model selects tokens for output. Tokens are + # selected from most K (see topK parameter) probable to least until the sum + # of their probabilities equals the top-p value. For example, if tokens A, B, + # and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, + # then the model will select either A or B as the next token (using + # temperature) and doesn't consider C. The default top-p value is 0.95. + # Specify a lower value for less random responses and a higher value for more + # random responses. Acceptable value is [0.0, 1.0], default to 0.95. + class InferenceParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Agent Coaching context that customer can configure. + # @!attribute [rw] overarching_guidance + # @return [::String] + # Optional. The overarching guidance for the agent coaching. This should be + # set only for v1.5 and later versions. + # @!attribute [rw] instructions + # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction>] + # Optional. Customized instructions for agent coaching. + # @!attribute [rw] version + # @return [::String] + # Optional. Version of the feature. If not set, default to latest version. + # Current candidates are ["1.2"]. + # @!attribute [rw] output_language_code + # @return [::String] + # Optional. Output language code. + class AgentCoachingContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the section of summarization. + # @!attribute [rw] key + # @return [::String] + # Optional. Name of the section, for example, "situation". + # @!attribute [rw] definition + # @return [::String] + # Optional. Definition of the section, for example, "what the customer needs + # help with or has question about." + # @!attribute [rw] type + # @return [::Google::Cloud::Dialogflow::V2::SummarizationSection::Type] + # Optional. Type of the summarization section. + class SummarizationSection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type enum of the summarization sections. + module Type + # Undefined section type, does not return anything. + TYPE_UNSPECIFIED = 0 + + # What the customer needs help with or has question about. + # Section name: "situation". + SITUATION = 1 + + # What the agent does to help the customer. + # Section name: "action". + ACTION = 2 + + # Result of the customer service. A single word describing the result + # of the conversation. + # Section name: "resolution". + RESOLUTION = 3 + + # Reason for cancellation if the customer requests for a cancellation. + # "N/A" otherwise. + # Section name: "reason_for_cancellation". + REASON_FOR_CANCELLATION = 4 + + # "Unsatisfied" or "Satisfied" depending on the customer's feelings at + # the end of the conversation. + # Section name: "customer_satisfaction". + CUSTOMER_SATISFACTION = 5 + + # Key entities extracted from the conversation, such as ticket number, + # order number, dollar amount, etc. + # Section names are prefixed by "entities/". + ENTITIES = 6 + + # Customer defined sections. + CUSTOMER_DEFINED = 7 + + # Concise version of the situation section. This type is only available if + # type SITUATION is not selected. + SITUATION_CONCISE = 9 + + # Concise version of the action section. This type is only available if + # type ACTION is not selected. + ACTION_CONCISE = 10 + end + end + + # Summarization context that customer can configure. + # @!attribute [rw] summarization_sections + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationSection>] + # Optional. List of sections. Note it contains both predefined section sand + # customer defined sections. + # @!attribute [rw] few_shot_examples + # @return [::Array<::Google::Cloud::Dialogflow::V2::FewShotExample>] + # Optional. List of few shot examples. + # @!attribute [rw] version + # @return [::String] + # Optional. Version of the feature. If not set, default to latest version. + # Current candidates are ["1.0"]. + # @!attribute [rw] output_language_code + # @return [::String] + # Optional. The target language of the generated summary. The language code + # for conversation will be used if this field is empty. Supported 2.0 and + # later versions. + class SummarizationContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Free form generator context that customer can configure. + # @!attribute [rw] text + # @return [::String] + # Optional. Free form text input to LLM. + class FreeFormContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # LLM generator. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the generator. Format: + # `projects//locations//generators/` + # @!attribute [rw] description + # @return [::String] + # Optional. Human readable description of the generator. + # @!attribute [rw] free_form_context + # @return [::Google::Cloud::Dialogflow::V2::FreeFormContext] + # Input of free from generator to LLM. + # + # Note: The following fields are mutually exclusive: `free_form_context`, `agent_coaching_context`, `summarization_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] agent_coaching_context + # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingContext] + # Input of prebuilt Agent Coaching feature. + # + # Note: The following fields are mutually exclusive: `agent_coaching_context`, `free_form_context`, `summarization_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] summarization_context + # @return [::Google::Cloud::Dialogflow::V2::SummarizationContext] + # Input of prebuilt Summarization feature. + # + # Note: The following fields are mutually exclusive: `summarization_context`, `free_form_context`, `agent_coaching_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] inference_parameter + # @return [::Google::Cloud::Dialogflow::V2::InferenceParameter] + # Optional. Inference parameters for this generator. + # @!attribute [rw] trigger_event + # @return [::Google::Cloud::Dialogflow::V2::TriggerEvent] + # Optional. The trigger event of the generator. It defines when the generator + # is triggered in a conversation. + # @!attribute [rw] published_model + # @return [::String] + # Optional. The published Large Language Model name. + # * To use the latest model version, specify the model name without version + # number. Example: `text-bison` + # * To use a stable model version, specify the version number as well. + # Example: `text-bison@002`. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this generator. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time of this generator. + # @!attribute [rw] tools + # @return [::Array<::String>] + # Optional. Resource names of the tools that the generator can choose from. + # Format: `projects//locations//tools/`. + # @!attribute [rw] suggestion_deduping_config + # @return [::Google::Cloud::Dialogflow::V2::SuggestionDedupingConfig] + # Optional. Configuration for suggestion deduping. This is only applicable to + # AI Coach feature. + # @!attribute [rw] toolset_tools + # @return [::Array<::Google::Cloud::Dialogflow::V2::ToolsetTool>] + # Optional. List of CES toolset specs that the generator can choose from. + # @!attribute [rw] ces_tool_specs + # @return [::Array<::Google::Cloud::Dialogflow::V2::CesToolSpec>] + # Optional. List of CES tool specs that the generator can choose from. + # @!attribute [rw] ces_app_specs + # @return [::Array<::Google::Cloud::Dialogflow::V2::CesAppSpec>] + # Optional. List of CES app specs that the generator can choose from. + class Generator + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Suggestion generated using free form generator. + # @!attribute [rw] response + # @return [::String] + # Required. Free form suggestion. + class FreeFormSuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Suggested summary of the conversation. + # @!attribute [rw] summary_sections + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarySuggestion::SummarySection>] + # Required. All the parts of generated summary. + class SummarySuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A component of the generated summary. + # @!attribute [rw] section + # @return [::String] + # Required. Name of the section. + # @!attribute [rw] summary + # @return [::String] + # Required. Summary text for the section. + class SummarySection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Suggestion for coaching agents. + # @!attribute [rw] applicable_instructions + # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction>] + # Optional. Instructions applicable based on the current context. + # @!attribute [rw] agent_action_suggestions + # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::AgentActionSuggestion>] + # Optional. Suggested actions for the agent to take. + # @!attribute [rw] sample_responses + # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::SampleResponse>] + # Optional. Sample response for the Agent. + class AgentCoachingSuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Sources for the suggestion. + # @!attribute [r] instruction_indexes + # @return [::Array<::Integer>] + # Output only. Source instruction indexes for the suggestion. This is the + # index of the applicable_instructions field. + class Sources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Duplication check for the suggestion. + # @!attribute [r] duplicate_suggestions + # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::DuplicateCheckResult::DuplicateSuggestion>] + # Output only. The duplicate suggestions. + class DuplicateCheckResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The duplicate suggestion details. + # Keeping answer_record and sources together as they are identifiers for + # duplicate suggestions. + # @!attribute [r] answer_record + # @return [::String] + # Output only. The answer record id of the past duplicate suggestion. + # @!attribute [r] sources + # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::Sources] + # Output only. Sources for the suggestion. + # @!attribute [r] suggestion_index + # @return [::Integer] + # Output only. The index of the duplicate suggestion in the past + # suggestion list. + # @!attribute [r] similarity_score + # @return [::Float] + # Output only. The similarity score of between the past and current + # suggestion. + class DuplicateSuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Actions suggested for the agent. This is based on applicable instructions. + # @!attribute [rw] agent_action + # @return [::String] + # Optional. The suggested action for the agent. + # @!attribute [r] sources + # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::Sources] + # Output only. Sources for the agent action suggestion. + # @!attribute [r] duplicate_check_result + # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::DuplicateCheckResult] + # Output only. Duplicate check result for the agent action suggestion. + class AgentActionSuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sample response that the agent can use. This could be based on applicable + # instructions and ingested data from other systems. + # @!attribute [rw] response_text + # @return [::String] + # Optional. Sample response for Agent in text. + # @!attribute [r] sources + # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::Sources] + # Output only. Sources for the Sample Response. + # @!attribute [r] duplicate_check_result + # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::DuplicateCheckResult] + # Output only. Duplicate check result for the sample response. + class SampleResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Suggestion generated using a Generator. + # @!attribute [rw] free_form_suggestion + # @return [::Google::Cloud::Dialogflow::V2::FreeFormSuggestion] + # Optional. Free form suggestion. + # + # Note: The following fields are mutually exclusive: `free_form_suggestion`, `summary_suggestion`, `agent_coaching_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] summary_suggestion + # @return [::Google::Cloud::Dialogflow::V2::SummarySuggestion] + # Optional. Suggested summary. + # + # Note: The following fields are mutually exclusive: `summary_suggestion`, `free_form_suggestion`, `agent_coaching_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] agent_coaching_suggestion + # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion] + # Optional. Suggestion to coach the agent. + # + # Note: The following fields are mutually exclusive: `agent_coaching_suggestion`, `free_form_suggestion`, `summary_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] tool_call_info + # @return [::Array<::Google::Cloud::Dialogflow::V2::GeneratorSuggestion::ToolCallInfo>] + # Optional. List of request and response for tool calls executed. + class GeneratorSuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Request and response for a tool call. + # @!attribute [rw] tool_call + # @return [::Google::Cloud::Dialogflow::V2::ToolCall] + # Required. Request for a tool call. + # @!attribute [rw] tool_call_result + # @return [::Google::Cloud::Dialogflow::V2::ToolCallResult] + # Required. Response for a tool call. + class ToolCallInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Config for suggestion deduping. + # NEXT_ID: 3 + # @!attribute [rw] enable_deduping + # @return [::Boolean] + # Optional. Whether to enable suggestion deduping. + # @!attribute [rw] similarity_threshold + # @return [::Float] + # Optional. The threshold for similarity between two suggestions. + # Acceptable value is [0.0, 1.0], default to 0.8 + class SuggestionDedupingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Responsible AI checks. + # @!attribute [rw] rai_category_configs + # @return [::Array<::Google::Cloud::Dialogflow::V2::RaiSettings::RaiCategoryConfig>] + # Configuration for a set of RAI categories. + class RaiSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for a specific RAI category. + # @!attribute [rw] category + # @return [::Google::Cloud::Dialogflow::V2::RaiSettings::RaiCategoryConfig::RaiCategory] + # Optional. The RAI category. + # @!attribute [rw] sensitivity_level + # @return [::Google::Cloud::Dialogflow::V2::RaiSettings::RaiCategoryConfig::SensitivityLevel] + # Optional. The sensitivity level for this category. + class RaiCategoryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum for RAI category. + module RaiCategory + # Default value. + RAI_CATEGORY_UNSPECIFIED = 0 + + # Dangerous content. + DANGEROUS_CONTENT = 1 + + # Sexually explicit content. + SEXUALLY_EXPLICIT = 2 + + # Harassment content. + HARASSMENT = 3 + + # Hate speech content. + HATE_SPEECH = 4 + end + + # Enum for user-configurable sensitivity levels. + module SensitivityLevel + # Default value. + # If unspecified, the default behavior is: + # - DANGEROUS_CONTENT: BLOCK_FEW + # - SEXUALLY_EXPLICIT: BLOCK_SOME + # - HARASSMENT: BLOCK_SOME + # - HATE_SPEECH: BLOCK_SOME + SENSITIVITY_LEVEL_UNSPECIFIED = 0 + + # Block most potentially sensitive responses. + BLOCK_MOST = 1 + + # Block some potentially sensitive responses. + BLOCK_SOME = 2 + + # Block a few potentially sensitive responses. + BLOCK_FEW = 3 + + # No filtering for this category. + BLOCK_NONE = 4 + end + end + end + + # The event that triggers the generator and LLM execution. + module TriggerEvent + # Default value for TriggerEvent. + TRIGGER_EVENT_UNSPECIFIED = 0 + + # Triggers when each chat message or voice utterance ends. + END_OF_UTTERANCE = 1 + + # Triggers on the conversation manually by API calls, such as + # Conversations.GenerateStatelessSuggestion and + # Conversations.GenerateSuggestions. + MANUAL_CALL = 2 + + # Triggers after each customer message only. + CUSTOMER_MESSAGE = 3 + + # Triggers after each agent message only. + AGENT_MESSAGE = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator_evaluation.rb new file mode 100644 index 000000000000..e317542a668e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator_evaluation.rb @@ -0,0 +1,539 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Request of CreateGeneratorEvaluation. + # @!attribute [rw] parent + # @return [::String] + # Required. The generator resource name. Format: + # `projects//locations//generators/` + # @!attribute [rw] generator_evaluation + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] + # Required. The generator evaluation to be created. + class CreateGeneratorEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request of GetGeneratorEvaluation. + # @!attribute [rw] name + # @return [::String] + # Required. The generator evaluation resource name. Format: + # `projects//locations//generators//evaluations/` + class GetGeneratorEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request of ListGeneratorEvaluations. + # @!attribute [rw] parent + # @return [::String] + # Required. The generator resource name. Format: + # `projects//locations//generators/` + # Wildcard value `-` is supported on generator_id to list evaluations across + # all generators under same project. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of evaluations to return in a + # single page. By default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListGeneratorEvaluationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of ListGeneratorEvaluations. + # @!attribute [rw] generator_evaluations + # @return [::Array<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] + # The list of evaluations to return. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListGeneratorEvaluationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request of DeleteGeneratorEvaluation. + # @!attribute [rw] name + # @return [::String] + # Required. The generator evaluation resource name. Format: + # `projects//locations//generators// + # evaluations/` + class DeleteGeneratorEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents evaluation result of a generator. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the evaluation. Format: + # `projects//locations//generators// + # evaluations/` + # @!attribute [rw] display_name + # @return [::String] + # Optional. The display name of the generator evaluation. At most 64 bytes + # long. + # @!attribute [rw] generator_evaluation_config + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig] + # Required. The configuration of the evaluation task. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this generator evaluation. + # @!attribute [r] complete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Completion time of this generator evaluation. + # @!attribute [rw] initial_generator + # @return [::Google::Cloud::Dialogflow::V2::Generator] + # Required. The initial generator that was used when creating this + # evaluation. This is a copy of the generator read from storage when creating + # the evaluation. + # @!attribute [r] summarization_metrics + # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics] + # Output only. Only available when the summarization generator is provided. + # @!attribute [r] evaluation_status + # @return [::Google::Cloud::Dialogflow::V2::EvaluationStatus] + # Output only. The result status of the evaluation pipeline. Provides the + # status information including if the evaluation is still in progress, + # completed or failed with certain error and user actionable message. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. A read only boolean field reflecting Zone Separation + # status of the model. The field is an aggregated + # value of ZS status of its underlying dependencies. See more details in + # go/zicy-resource-placement#resource-status + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. A read only boolean field reflecting Zone Isolation status + # of the model. The field is an aggregated value of + # ZI status of its underlying dependencies. See more details in + # go/zicy-resource-placement#resource-status + class GeneratorEvaluation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Evaluation metrics for summarization generator. + # @!attribute [r] summarization_evaluation_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::SummarizationEvaluationResult>] + # Output only. A list of evaluation results per conversation(&summary), + # metric and section. + # @!attribute [r] summarization_evaluation_merged_results_uri + # @return [::String] + # Output only. User bucket uri for merged evaluation score and aggregation + # score csv. + # @!attribute [r] overall_metrics + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::OverallScoresByMetric>] + # Output only. A list of aggregated(average) scores per metric section. + # @!attribute [r] overall_section_tokens + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::SectionToken>] + # Output only. Overall token per section. This is an aggregated(sum) result + # of input token of summary acorss all conversations that are selected for + # summarization evaluation. + # @!attribute [r] conversation_details + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::ConversationDetail>] + # Output only. List of conversation details. + class SummarizationEvaluationMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Decomposition details for accuracy. + # @!attribute [r] point + # @return [::String] + # Output only. The breakdown point of the summary. + # @!attribute [r] accuracy_reasoning + # @return [::String] + # Output only. The accuracy reasoning of the breakdown point. + # @!attribute [r] is_accurate + # @return [::Boolean] + # Output only. Whether the breakdown point is accurate or not. + class AccuracyDecomposition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Decomposition details for adherence. + # @deprecated This message is deprecated and may be removed in the next major version update. + # @!attribute [r] point + # @return [::String] + # Output only. The breakdown point of the given instructions. + # @!attribute [r] adherence_reasoning + # @return [::String] + # Output only. The adherence reasoning of the breakdown point. + # @!attribute [r] is_adherent + # @return [::Boolean] + # Output only. Whether the breakdown point is adherent or not. + class AdherenceDecomposition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Rubric result of the adherence evaluation. A rubric is ued to determine + # if the summary adheres to all aspects of the given instructions. + # @!attribute [r] question + # @return [::String] + # Output only. The question generated from instruction that used to + # evaluate summary. + # @!attribute [r] reasoning + # @return [::String] + # Output only. The reasoning of the rubric question is addressed or not. + # @!attribute [r] is_addressed + # @return [::Boolean] + # Output only. A boolean that indicates whether the rubric question is + # addressed or not. + class AdherenceRubric + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Rubric details of the completeness evaluation result. + # @!attribute [r] question + # @return [::String] + # Output only. The question generated from instruction that used to + # evaluate summary. + # @!attribute [r] is_addressed + # @return [::Boolean] + # Output only. A boolean that indicates whether the rubric question is + # addressed or not. + class CompletenessRubric + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Decomposition details + # @deprecated This message is deprecated and may be removed in the next major version update. + # @!attribute [rw] accuracy_decomposition + # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::AccuracyDecomposition] + # only available for accuracy metric. + # + # Note: The following fields are mutually exclusive: `accuracy_decomposition`, `adherence_decomposition`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] adherence_decomposition + # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::AdherenceDecomposition] + # only available for adherence metric. + # + # Note: The following fields are mutually exclusive: `adherence_decomposition`, `accuracy_decomposition`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Decomposition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Evaluation result that contains one of accuracy, adherence or completeness + # evaluation result. + # @!attribute [rw] accuracy_decomposition + # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::AccuracyDecomposition] + # Only available for accuracy metric. + # + # Note: The following fields are mutually exclusive: `accuracy_decomposition`, `adherence_rubric`, `completeness_rubric`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] adherence_rubric + # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::AdherenceRubric] + # Only available for adherence metric. + # + # Note: The following fields are mutually exclusive: `adherence_rubric`, `accuracy_decomposition`, `completeness_rubric`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] completeness_rubric + # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::CompletenessRubric] + # Only available for completeness metric. + # + # Note: The following fields are mutually exclusive: `completeness_rubric`, `accuracy_decomposition`, `adherence_rubric`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class EvaluationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Evaluation result per conversation(&summary), metric and section. + # @!attribute [r] session_id + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Output only. conversation session id + # @!attribute [r] metric + # @return [::String] + # Output only. metric name, e.g. accuracy, completeness, adherence, etc. + # @!attribute [r] section + # @return [::String] + # Output only. section/task name, e.g. action, situation, etc + # @!attribute [r] score + # @return [::Float] + # Output only. score calculated from decompositions + # @!attribute [r] section_summary + # @return [::String] + # Output only. Summary of this section + # @!attribute [r] decompositions + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::Decomposition>] + # Output only. List of decompostion details + # @!attribute [r] evaluation_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::EvaluationResult>] + # Output only. List of evaluation results. + class SummarizationEvaluationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Overall performance per metric. This is the aggregated score for each + # metric across all conversations that are selected for summarization + # evaluation. + # @!attribute [r] metric + # @return [::String] + # Output only. Metric name. e.g. accuracy, adherence, completeness. + class OverallScoresByMetric + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A pair of section name and input token count of the input summary section. + # @!attribute [r] section + # @return [::String] + # Output only. The name of the summary instruction. + # @!attribute [r] token_count + # @return [::Integer] + # Output only. Token count. + class SectionToken + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Aggregated evaluation result on conversation level. This conatins + # evaluation results of all the metrics and sections. + # @!attribute [r] message_entries + # @return [::Array<::Google::Cloud::Dialogflow::V2::MessageEntry>] + # Output only. Conversation transcript that used for summarization + # evaluation as a reference. + # @!attribute [r] summary_sections + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarySuggestion::SummarySection>] + # Output only. Summary sections that used for summarization evaluation as a + # reference. + # @!attribute [r] metric_details + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::ConversationDetail::MetricDetail>] + # Output only. List of metric details. + # @!attribute [r] section_tokens + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::SectionToken>] + # Output only. Conversation level token count per section. This is an + # aggregated(sum) result of input token of summary acorss all metrics for a + # single conversation. + class ConversationDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Aggregated result on metric level. This conatins the evaluation results + # of all the sections. + # @!attribute [r] metric + # @return [::String] + # Output only. Metrics name. e.g. accuracy, adherence, completeness. + # @!attribute [r] score + # @return [::Float] + # Output only. Aggregated(average) score on this metric across all + # sections. + # @!attribute [r] section_details + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::ConversationDetail::MetricDetail::SectionDetail>] + # Output only. List of section details. + class MetricDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Section level result. + # @!attribute [r] section + # @return [::String] + # Output only. The name of the summary instruction. + # @!attribute [r] score + # @return [::Float] + # Output only. Aggregated(average) score on this section across all + # evaluation results. Either decompositions or rubrics. + # @!attribute [r] section_summary + # @return [::String] + # Output only. Summary for this section + # @!attribute [r] evaluation_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::EvaluationResult>] + # Output only. List of evaluation result. The list only contains one + # kind of the evaluation result. + class SectionDetail + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + + # Generator evaluation input config. + # @!attribute [rw] input_data_config + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::InputDataConfig] + # Required. The config/source of input data. + # @!attribute [rw] output_gcs_bucket_path + # @return [::String] + # Required. The output Cloud Storage bucket path to store eval files, e.g. + # per_summary_accuracy_score report. This path is provided by customer and + # files stored in it are visible to customer, no internal data should be + # stored in this path. + # @!attribute [rw] summarization_config + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::SummarizationConfig] + # Evaluation configs for summarization generator. + class GeneratorEvaluationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The distinctive configs for Agent Assist conversations as the conversation + # source. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Required. The start of the time range for conversations to be evaluated. + # Only conversations created at or after this timestamp will be sampled. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # Required. The end of the time range for conversations to be evaluated. + # Only conversations ended at or before this timestamp will be sampled. + class AgentAssistInputDataConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The distinctive configs for dataset as the conversation source. + # @!attribute [rw] dataset + # @return [::String] + # Required. The identifier of the dataset to be evaluated. + # Format: + # `projects//locations//datasets/`. + class DatasetInputDataConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Input data config details + # @!attribute [rw] input_data_source_type + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::InputDataSourceType] + # Required. The source type of input data. + # @!attribute [rw] start_time + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Protobuf::Timestamp] + # Optional. The start timestamp to fetch conversation data. + # @!attribute [rw] end_time + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Protobuf::Timestamp] + # Optional. The end timestamp to fetch conversation data. + # @!attribute [rw] sample_size + # @return [::Integer] + # Optional. Desired number of conversation-summary pairs to be evaluated. + # @!attribute [rw] is_summary_generation_allowed + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Whether the summary generation is allowed when the pre-existing + # qualified summaries are insufficient to cover the sample size. + # @!attribute [rw] summary_generation_option + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::InputDataConfig::SummaryGenerationOption] + # Optional. Option to control whether summaries are generated during + # evaluation. + # @!attribute [rw] agent_assist_input_data_config + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::AgentAssistInputDataConfig] + # The distinctive configs for Agent Assist conversations as the + # conversation source. + # + # Note: The following fields are mutually exclusive: `agent_assist_input_data_config`, `dataset_input_data_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] dataset_input_data_config + # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::DatasetInputDataConfig] + # The distinctive configs for dataset as the conversation source. + # + # Note: The following fields are mutually exclusive: `dataset_input_data_config`, `agent_assist_input_data_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class InputDataConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Summary generation options. + module SummaryGenerationOption + # Default option will not be used + SUMMARY_GENERATION_OPTION_UNSPECIFIED = 0 + + # Always Generate summary for all conversations. + ALWAYS_GENERATE = 1 + + # Gnerate only missing summaries. + GENERATE_IF_MISSING = 2 + + # Do not generate new summaries. Only use existing summaries found. + DO_NOT_GENERATE = 3 + end + end + + # Evaluation configs for summarization generator. + # @!attribute [rw] enable_accuracy_evaluation + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Enable accuracy evaluation. + # @!attribute [rw] accuracy_evaluation_version + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. Version for summarization accuracy. This will determine the + # prompt and model used at backend. + # @!attribute [rw] enable_completeness_evaluation + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Optional. Enable completeness evaluation. + # @!attribute [rw] completeness_evaluation_version + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. Version for summarization completeness. This will determine the + # prompt and model used at backend. + # @!attribute [rw] evaluator_version + # @return [::String] + # Optional. Version for summarization evaluation. + class SummarizationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enumeration of input data source type. + module InputDataSourceType + # Unspecified InputDataSourceType. Should not be used. + INPUT_DATA_SOURCE_TYPE_UNSPECIFIED = 0 + + # Fetch data from Agent Assist storage. If this source type is chosen, + # input_data_config.start_time and input_data_config.end_timestamp must be + # provided. + AGENT_ASSIST_CONVERSATIONS = 1 + + # Fetch data from Insights storage. If this source type is chosen, + # input_data_config.start_time and input_data_config.end_timestamp must be + # provided. + INSIGHTS_CONVERSATIONS = 2 + end + end + + # A common evalaution pipeline status. + # @!attribute [r] done + # @return [::Boolean] + # Output only. If the value is `false`, it means the evaluation is still in + # progress. If `true`, the operation is completed, and either `error` or + # `response` is available. + # @!attribute [r] pipeline_status + # @return [::Google::Rpc::Status] + # Output only. The error result of the evaluation in case of failure in + # evaluation pipeline. + class EvaluationStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb new file mode 100644 index 000000000000..67ae06b1b51e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Represents a notification sent to Cloud Pub/Sub subscribers for + # human agent assistant events in a specific conversation. + # @!attribute [rw] conversation + # @return [::String] + # The conversation this notification refers to. + # Format: `projects//conversations/`. + # @!attribute [rw] participant + # @return [::String] + # The participant that the suggestion is compiled for. + # Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + # @!attribute [rw] suggestion_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] + # The suggestion results payload that this notification refers to. + class HumanAgentAssistantEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/intent.rb new file mode 100644 index 000000000000..e531744bbf51 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/intent.rb @@ -0,0 +1,1089 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # An intent categorizes an end-user's intention for one conversation turn. For + # each agent, you define many intents, where your combined intents can handle a + # complete conversation. When an end-user writes or says something, referred to + # as an end-user expression or end-user input, Dialogflow matches the end-user + # input to the best intent in your agent. Matching an intent is also known as + # intent classification. + # + # For more information, see the [intent + # guide](https://cloud.google.com/dialogflow/docs/intents-overview). + # @!attribute [rw] name + # @return [::String] + # Optional. The unique identifier of this intent. + # Required for + # {::Google::Cloud::Dialogflow::V2::Intents::Client#update_intent Intents.UpdateIntent} and + # {::Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents Intents.BatchUpdateIntents} + # methods. + # Format: `projects//agent/intents/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The name of this intent. + # @!attribute [rw] webhook_state + # @return [::Google::Cloud::Dialogflow::V2::Intent::WebhookState] + # Optional. Indicates whether webhooks are enabled for the intent. + # @!attribute [rw] priority + # @return [::Integer] + # Optional. The priority of this intent. Higher numbers represent higher + # priorities. + # + # - If the supplied value is unspecified or 0, the service + # translates the value to 500,000, which corresponds to the + # `Normal` priority in the console. + # - If the supplied value is negative, the intent is ignored + # in runtime detect intent requests. + # @!attribute [rw] is_fallback + # @return [::Boolean] + # Optional. Indicates whether this is a fallback intent. + # @!attribute [rw] ml_disabled + # @return [::Boolean] + # Optional. Indicates whether Machine Learning is disabled for the intent. + # Note: If `ml_disabled` setting is set to true, then this intent is not + # taken into account during inference in `ML ONLY` match mode. Also, + # auto-markup in the UI is turned off. + # @!attribute [rw] live_agent_handoff + # @return [::Boolean] + # Optional. Indicates that a live agent should be brought in to handle the + # interaction with the user. In most cases, when you set this flag to true, + # you would also want to set end_interaction to true as well. Default is + # false. + # @!attribute [rw] end_interaction + # @return [::Boolean] + # Optional. Indicates that this intent ends an interaction. Some integrations + # (e.g., Actions on Google or Dialogflow phone gateway) use this information + # to close interaction with an end user. Default is false. + # @!attribute [rw] input_context_names + # @return [::Array<::String>] + # Optional. The list of context names required for this intent to be + # triggered. + # Format: `projects//agent/sessions/-/contexts/`. + # @!attribute [rw] events + # @return [::Array<::String>] + # Optional. The collection of event names that trigger the intent. + # If the collection of input contexts is not empty, all of the contexts must + # be present in the active user session for an event to trigger this intent. + # Event names are limited to 150 characters. + # @!attribute [rw] training_phrases + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase>] + # Optional. The collection of examples that the agent is + # trained on. + # @!attribute [rw] action + # @return [::String] + # Optional. The name of the action associated with the intent. + # Note: The action name must not contain whitespaces. + # @!attribute [rw] output_contexts + # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] + # Optional. The collection of contexts that are activated when the intent + # is matched. Context messages in this collection should not set the + # parameters field. Setting the `lifespan_count` to 0 will reset the context + # when the intent is matched. + # Format: `projects//agent/sessions/-/contexts/`. + # @!attribute [rw] reset_contexts + # @return [::Boolean] + # Optional. Indicates whether to delete all contexts in the current + # session when this intent is matched. + # @!attribute [rw] parameters + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Parameter>] + # Optional. The collection of parameters associated with the intent. + # @!attribute [rw] messages + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message>] + # Optional. The collection of rich messages corresponding to the + # `Response` field in the Dialogflow console. + # @!attribute [rw] default_response_platforms + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::Platform>] + # Optional. The list of platforms for which the first responses will be + # copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). + # @!attribute [r] root_followup_intent_name + # @return [::String] + # Output only. + # Read-only. The unique identifier of the root intent in the chain of + # followup intents. It identifies the correct followup intents chain for + # this intent. We populate this field only in the output. + # + # Format: `projects//agent/intents/`. + # @!attribute [rw] parent_followup_intent_name + # @return [::String] + # Read-only after creation. The unique identifier of the parent intent in the + # chain of followup intents. You can set this field when creating an intent, + # for example with + # {::Google::Cloud::Dialogflow::V2::Intents::Client#create_intent CreateIntent} or + # {::Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents BatchUpdateIntents}, + # in order to make this intent a followup intent. + # + # It identifies the parent followup intent. + # Format: `projects//agent/intents/`. + # @!attribute [r] followup_intent_info + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::FollowupIntentInfo>] + # Output only. Read-only. Information about all followup intents that have + # this intent as a direct or indirect parent. We populate this field only in + # the output. + class Intent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents an example that the agent is trained on. + # @!attribute [r] name + # @return [::String] + # Output only. The unique identifier of this training phrase. + # @!attribute [rw] type + # @return [::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Type] + # Required. The type of the training phrase. + # @!attribute [rw] parts + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Part>] + # Required. The ordered list of training phrase parts. + # The parts are concatenated in order to form the training phrase. + # + # Note: The API does not automatically annotate training phrases like the + # Dialogflow Console does. + # + # Note: Do not forget to include whitespace at part boundaries, + # so the training phrase is well formatted when the parts are concatenated. + # + # If the training phrase does not need to be annotated with parameters, + # you just need a single part with only the + # {::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Part#text Part.text} + # field set. + # + # If you want to annotate the training phrase, you must create multiple + # parts, where the fields of each part are populated in one of two ways: + # + # - `Part.text` is set to a part of the phrase that has no parameters. + # - `Part.text` is set to a part of the phrase that you want to annotate, + # and the `entity_type`, `alias`, and `user_defined` fields are all + # set. + # @!attribute [rw] times_added_count + # @return [::Integer] + # Optional. Indicates how many times this example was added to + # the intent. Each time a developer adds an existing sample by editing an + # intent or training, this counter is increased. + class TrainingPhrase + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a part of a training phrase. + # @!attribute [rw] text + # @return [::String] + # Required. The text for this part. + # @!attribute [rw] entity_type + # @return [::String] + # Optional. The entity type name prefixed with `@`. + # This field is required for annotated parts of the training phrase. + # @!attribute [rw] alias + # @return [::String] + # Optional. The parameter name for the value extracted from the + # annotated part of the example. + # This field is required for annotated parts of the training phrase. + # @!attribute [rw] user_defined + # @return [::Boolean] + # Optional. Indicates whether the text was manually annotated. + # This field is set to true when the Dialogflow Console is used to + # manually annotate the part. When creating an annotated part with the + # API, you must set this to true. + class Part + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents different types of training phrases. + module Type + # Not specified. This value should never be used. + TYPE_UNSPECIFIED = 0 + + # Examples do not contain @-prefixed entity type names, but example parts + # can be annotated with entity types. + EXAMPLE = 1 + + # Templates are not annotated with entity types, but they can contain + # @-prefixed entity type names as substrings. + # Template mode has been deprecated. Example mode is the only supported + # way to create new training phrases. If you have existing training + # phrases that you've created in template mode, those will continue to + # work. + TEMPLATE = 2 + end + end + + # Represents intent parameters. + # @!attribute [rw] name + # @return [::String] + # The unique identifier of this parameter. + # @!attribute [rw] display_name + # @return [::String] + # Required. The name of the parameter. + # @!attribute [rw] value + # @return [::String] + # Optional. The definition of the parameter value. It can be: + # + # - a constant string, + # - a parameter value defined as `$parameter_name`, + # - an original parameter value defined as `$parameter_name.original`, + # - a parameter value from some context defined as + # `#context_name.parameter_name`. + # @!attribute [rw] default_value + # @return [::String] + # Optional. The default value to use when the `value` yields an empty + # result. + # Default values can be extracted from contexts by using the following + # syntax: `#context_name.parameter_name`. + # @!attribute [rw] entity_type_display_name + # @return [::String] + # Optional. The name of the entity type, prefixed with `@`, that + # describes values of the parameter. If the parameter is + # required, this must be provided. + # @!attribute [rw] mandatory + # @return [::Boolean] + # Optional. Indicates whether the parameter is required. That is, + # whether the intent cannot be completed without collecting the parameter + # value. + # @!attribute [rw] prompts + # @return [::Array<::String>] + # Optional. The collection of prompts that the agent can present to the + # user in order to collect a value for the parameter. + # @!attribute [rw] is_list + # @return [::Boolean] + # Optional. Indicates whether the parameter represents a list of values. + class Parameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A rich response message. + # Corresponds to the intent `Response` field in the Dialogflow console. + # For more information, see + # [Rich response + # messages](https://cloud.google.com/dialogflow/docs/intents-rich-messages). + # @!attribute [rw] text + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Text] + # The text response. + # + # Note: The following fields are mutually exclusive: `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] image + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] + # The image response. + # + # Note: The following fields are mutually exclusive: `image`, `text`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] quick_replies + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::QuickReplies] + # The quick replies response. + # + # Note: The following fields are mutually exclusive: `quick_replies`, `text`, `image`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] card + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Card] + # The card response. + # + # Note: The following fields are mutually exclusive: `card`, `text`, `image`, `quick_replies`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] payload + # @return [::Google::Protobuf::Struct] + # A custom platform-specific response. + # + # Note: The following fields are mutually exclusive: `payload`, `text`, `image`, `quick_replies`, `card`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] simple_responses + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::SimpleResponses] + # The voice and text-only responses for Actions on Google. + # + # Note: The following fields are mutually exclusive: `simple_responses`, `text`, `image`, `quick_replies`, `card`, `payload`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] basic_card + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BasicCard] + # The basic card response for Actions on Google. + # + # Note: The following fields are mutually exclusive: `basic_card`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] suggestions + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Suggestions] + # The suggestion chips for Actions on Google. + # + # Note: The following fields are mutually exclusive: `suggestions`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] link_out_suggestion + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::LinkOutSuggestion] + # The link out suggestion chip for Actions on Google. + # + # Note: The following fields are mutually exclusive: `link_out_suggestion`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_select + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::ListSelect] + # The list card response for Actions on Google. + # + # Note: The following fields are mutually exclusive: `list_select`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] carousel_select + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::CarouselSelect] + # The carousel card response for Actions on Google. + # + # Note: The following fields are mutually exclusive: `carousel_select`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] browse_carousel_card + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard] + # Browse carousel card for Actions on Google. + # + # Note: The following fields are mutually exclusive: `browse_carousel_card`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] table_card + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::TableCard] + # Table card for Actions on Google. + # + # Note: The following fields are mutually exclusive: `table_card`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] media_content + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::MediaContent] + # The media content card for Actions on Google. + # + # Note: The following fields are mutually exclusive: `media_content`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] platform + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Platform] + # Optional. The platform that this message is intended for. + class Message + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The text response message. + # @!attribute [rw] text + # @return [::Array<::String>] + # Optional. The collection of the agent's responses. + class Text + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The image response message. + # @!attribute [rw] image_uri + # @return [::String] + # Optional. The public URI to an image file. + # @!attribute [rw] accessibility_text + # @return [::String] + # Optional. A text description of the image to be used for accessibility, + # e.g., screen readers. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The quick replies response message. + # @!attribute [rw] title + # @return [::String] + # Optional. The title of the collection of quick replies. + # @!attribute [rw] quick_replies + # @return [::Array<::String>] + # Optional. The collection of quick replies. + class QuickReplies + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The card response message. + # @!attribute [rw] title + # @return [::String] + # Optional. The title of the card. + # @!attribute [rw] subtitle + # @return [::String] + # Optional. The subtitle of the card. + # @!attribute [rw] image_uri + # @return [::String] + # Optional. The public URI to an image file for the card. + # @!attribute [rw] buttons + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::Card::Button>] + # Optional. The collection of card buttons. + class Card + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contains information about a button. + # @!attribute [rw] text + # @return [::String] + # Optional. The text to show on the button. + # @!attribute [rw] postback + # @return [::String] + # Optional. The text to send back to the Dialogflow API or a URI to + # open. + class Button + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The simple response message containing speech or text. + # @!attribute [rw] text_to_speech + # @return [::String] + # One of text_to_speech or ssml must be provided. The plain text of the + # speech output. Mutually exclusive with ssml. + # @!attribute [rw] ssml + # @return [::String] + # One of text_to_speech or ssml must be provided. Structured spoken + # response to the user in the SSML format. Mutually exclusive with + # text_to_speech. + # @!attribute [rw] display_text + # @return [::String] + # Optional. The text to display. + class SimpleResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The collection of simple response candidates. + # This message in `QueryResult.fulfillment_messages` and + # `WebhookResponse.fulfillment_messages` should contain only one + # `SimpleResponse`. + # @!attribute [rw] simple_responses + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::SimpleResponse>] + # Required. The list of simple responses. + class SimpleResponses + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The basic card message. Useful for displaying information. + # @!attribute [rw] title + # @return [::String] + # Optional. The title of the card. + # @!attribute [rw] subtitle + # @return [::String] + # Optional. The subtitle of the card. + # @!attribute [rw] formatted_text + # @return [::String] + # Required, unless image is present. The body text of the card. + # @!attribute [rw] image + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] + # Optional. The image for the card. + # @!attribute [rw] buttons + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::BasicCard::Button>] + # Optional. The collection of card buttons. + class BasicCard + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The button object that appears at the bottom of a card. + # @!attribute [rw] title + # @return [::String] + # Required. The title of the button. + # @!attribute [rw] open_uri_action + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BasicCard::Button::OpenUriAction] + # Required. Action to take when a user taps on the button. + class Button + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Opens the given URI. + # @!attribute [rw] uri + # @return [::String] + # Required. The HTTP or HTTPS scheme URI. + class OpenUriAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # The suggestion chip message that the user can tap to quickly post a reply + # to the conversation. + # @!attribute [rw] title + # @return [::String] + # Required. The text shown the in the suggestion chip. + class Suggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The collection of suggestions. + # @!attribute [rw] suggestions + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::Suggestion>] + # Required. The list of suggested replies. + class Suggestions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The suggestion chip message that allows the user to jump out to the app + # or website associated with this agent. + # @!attribute [rw] destination_name + # @return [::String] + # Required. The name of the app or site this chip is linking to. + # @!attribute [rw] uri + # @return [::String] + # Required. The URI of the app or site to open when the user taps the + # suggestion chip. + class LinkOutSuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The card for presenting a list of options to select from. + # @!attribute [rw] title + # @return [::String] + # Optional. The overall title of the list. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::ListSelect::Item>] + # Required. List items. + # @!attribute [rw] subtitle + # @return [::String] + # Optional. Subtitle of the list. + class ListSelect + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An item in the list. + # @!attribute [rw] info + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::SelectItemInfo] + # Required. Additional information about this option. + # @!attribute [rw] title + # @return [::String] + # Required. The title of the list item. + # @!attribute [rw] description + # @return [::String] + # Optional. The main text describing the item. + # @!attribute [rw] image + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] + # Optional. The image to display. + class Item + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The card for presenting a carousel of options to select from. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::CarouselSelect::Item>] + # Required. Carousel items. + class CarouselSelect + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An item in the carousel. + # @!attribute [rw] info + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::SelectItemInfo] + # Required. Additional info about the option item. + # @!attribute [rw] title + # @return [::String] + # Required. Title of the carousel item. + # @!attribute [rw] description + # @return [::String] + # Optional. The body text of the card. + # @!attribute [rw] image + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] + # Optional. The image to display. + class Item + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Additional info about the select item for when it is triggered in a + # dialog. + # @!attribute [rw] key + # @return [::String] + # Required. A unique key that will be sent back to the agent if this + # response is given. + # @!attribute [rw] synonyms + # @return [::Array<::String>] + # Optional. A list of synonyms that can also be used to trigger this + # item in dialog. + class SelectItemInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The media content card for Actions on Google. + # @!attribute [rw] media_type + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::MediaContent::ResponseMediaType] + # Optional. What type of media is the content (ie "audio"). + # @!attribute [rw] media_objects + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::MediaContent::ResponseMediaObject>] + # Required. List of media objects. + class MediaContent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Response media object for media content card. + # @!attribute [rw] name + # @return [::String] + # Required. Name of media card. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of media card. + # @!attribute [rw] large_image + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] + # Optional. Image to display above media content. + # + # Note: The following fields are mutually exclusive: `large_image`, `icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] icon + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] + # Optional. Icon to display above media content. + # + # Note: The following fields are mutually exclusive: `icon`, `large_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] content_url + # @return [::String] + # Required. Url where the media is stored. + class ResponseMediaObject + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Format of response media type. + module ResponseMediaType + # Unspecified. + RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0 + + # Response media type is audio. + AUDIO = 1 + end + end + + # Browse Carousel Card for Actions on Google. + # https://developers.google.com/actions/assistant/responses#browsing_carousel + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem>] + # Required. List of items in the Browse Carousel Card. Minimum of two + # items, maximum of ten. + # @!attribute [rw] image_display_options + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard::ImageDisplayOptions] + # Optional. Settings for displaying the image. Applies to every image in + # {::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard#items items}. + class BrowseCarouselCard + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Browsing carousel tile + # @!attribute [rw] open_uri_action + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem::OpenUrlAction] + # Required. Action to present to the user. + # @!attribute [rw] title + # @return [::String] + # Required. Title of the carousel item. Maximum of two lines of text. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the carousel item. Maximum of four lines of + # text. + # @!attribute [rw] image + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] + # Optional. Hero image for the carousel item. + # @!attribute [rw] footer + # @return [::String] + # Optional. Text that appears at the bottom of the Browse Carousel + # Card. Maximum of one line of text. + class BrowseCarouselCardItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Actions on Google action to open a given url. + # @!attribute [rw] url + # @return [::String] + # Required. URL + # @!attribute [rw] url_type_hint + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem::OpenUrlAction::UrlTypeHint] + # Optional. Specifies the type of viewer that is used when opening + # the URL. Defaults to opening via web browser. + class OpenUrlAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the URI. + module UrlTypeHint + # Unspecified + URL_TYPE_HINT_UNSPECIFIED = 0 + + # Url would be an amp action + AMP_ACTION = 1 + + # URL that points directly to AMP content, or to a canonical URL + # which refers to AMP content via . + AMP_CONTENT = 2 + end + end + end + + # Image display options for Actions on Google. This should be used for + # when the image's aspect ratio does not match the image container's + # aspect ratio. + module ImageDisplayOptions + # Fill the gaps between the image and the image container with gray + # bars. + IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0 + + # Fill the gaps between the image and the image container with gray + # bars. + GRAY = 1 + + # Fill the gaps between the image and the image container with white + # bars. + WHITE = 2 + + # Image is scaled such that the image width and height match or exceed + # the container dimensions. This may crop the top and bottom of the + # image if the scaled image height is greater than the container + # height, or crop the left and right of the image if the scaled image + # width is greater than the container width. This is similar to "Zoom + # Mode" on a widescreen TV when playing a 4:3 video. + CROPPED = 3 + + # Pad the gaps between image and image frame with a blurred copy of the + # same image. + BLURRED_BACKGROUND = 4 + end + end + + # Table card for Actions on Google. + # @!attribute [rw] title + # @return [::String] + # Required. Title of the card. + # @!attribute [rw] subtitle + # @return [::String] + # Optional. Subtitle to the title. + # @!attribute [rw] image + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] + # Optional. Image which should be displayed on the card. + # @!attribute [rw] column_properties + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::ColumnProperties>] + # Optional. Display properties for the columns in this table. + # @!attribute [rw] rows + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::TableCardRow>] + # Optional. Rows in this table of data. + # @!attribute [rw] buttons + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::BasicCard::Button>] + # Optional. List of buttons for the card. + class TableCard + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Column properties for + # {::Google::Cloud::Dialogflow::V2::Intent::Message::TableCard TableCard}. + # @!attribute [rw] header + # @return [::String] + # Required. Column heading. + # @!attribute [rw] horizontal_alignment + # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::ColumnProperties::HorizontalAlignment] + # Optional. Defines text alignment for all cells in this column. + class ColumnProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Text alignments within a cell. + module HorizontalAlignment + # Text is aligned to the leading edge of the column. + HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0 + + # Text is aligned to the leading edge of the column. + LEADING = 1 + + # Text is centered in the column. + CENTER = 2 + + # Text is aligned to the trailing edge of the column. + TRAILING = 3 + end + end + + # Row of {::Google::Cloud::Dialogflow::V2::Intent::Message::TableCard TableCard}. + # @!attribute [rw] cells + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::TableCardCell>] + # Optional. List of cells that make up this row. + # @!attribute [rw] divider_after + # @return [::Boolean] + # Optional. Whether to add a visual divider after this row. + class TableCardRow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cell of + # {::Google::Cloud::Dialogflow::V2::Intent::Message::TableCardRow TableCardRow}. + # @!attribute [rw] text + # @return [::String] + # Required. Text in this cell. + class TableCardCell + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The rich response message integration platform. See + # [Integrations](https://cloud.google.com/dialogflow/docs/integrations). + module Platform + # Default platform. + PLATFORM_UNSPECIFIED = 0 + + # Facebook. + FACEBOOK = 1 + + # Slack. + SLACK = 2 + + # Telegram. + TELEGRAM = 3 + + # Kik. + KIK = 4 + + # Skype. + SKYPE = 5 + + # Line. + LINE = 6 + + # Viber. + VIBER = 7 + + # Google Assistant + # See [Dialogflow webhook + # format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + ACTIONS_ON_GOOGLE = 8 + + # Google Hangouts. + GOOGLE_HANGOUTS = 11 + end + end + + # Represents a single followup intent in the chain. + # @!attribute [rw] followup_intent_name + # @return [::String] + # The unique identifier of the followup intent. + # Format: `projects//agent/intents/`. + # @!attribute [rw] parent_followup_intent_name + # @return [::String] + # The unique identifier of the followup intent's parent. + # Format: `projects//agent/intents/`. + class FollowupIntentInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the different states that webhooks can be in. + module WebhookState + # Webhook is disabled in the agent and in the intent. + WEBHOOK_STATE_UNSPECIFIED = 0 + + # Webhook is enabled in the agent and in the intent. + WEBHOOK_STATE_ENABLED = 1 + + # Webhook is enabled in the agent and in the intent. Also, each slot + # filling prompt is forwarded to the webhook. + WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Intents::Client#list_intents Intents.ListIntents}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list all intents from. + # Format: `projects//agent` or `projects//locations//agent`. + # + # Alternatively, you can specify the environment to list intents for. + # Format: `projects//agent/environments/` + # or `projects//locations//agent/environments/`. + # Note: training phrases of the intents will not be returned for non-draft + # environment. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @!attribute [rw] intent_view + # @return [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListIntentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Intents::Client#list_intents Intents.ListIntents}. + # @!attribute [rw] intents + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent>] + # The list of agent intents. There will be a maximum number of items + # returned based on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListIntentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Intents::Client#get_intent Intents.GetIntent}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the intent. + # Format: `projects//agent/intents/`. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @!attribute [rw] intent_view + # @return [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + class GetIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Intents::Client#create_intent Intents.CreateIntent}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create a intent for. + # Format: `projects//agent`. + # @!attribute [rw] intent + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # Required. The intent to create. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @!attribute [rw] intent_view + # @return [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + class CreateIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Intents::Client#update_intent Intents.UpdateIntent}. + # @!attribute [rw] intent + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # Required. The intent to update. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields get updated. + # @!attribute [rw] intent_view + # @return [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + class UpdateIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Intents::Client#delete_intent Intents.DeleteIntent}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the intent to delete. If this intent has direct or + # indirect followup intents, we also delete them. + # Format: `projects//agent/intents/`. + class DeleteIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the agent to update or create intents in. + # Format: `projects//agent`. + # @!attribute [rw] intent_batch_uri + # @return [::String] + # The URI to a Google Cloud Storage file containing intents to update or + # create. The file format can either be a serialized proto (of IntentBatch + # type) or JSON object. Note: The URI must start with "gs://". + # + # Note: The following fields are mutually exclusive: `intent_batch_uri`, `intent_batch_inline`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] intent_batch_inline + # @return [::Google::Cloud::Dialogflow::V2::IntentBatch] + # The collection of intents to update or create. + # + # Note: The following fields are mutually exclusive: `intent_batch_inline`, `intent_batch_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The language used to access language-specific data. + # If not specified, the agent's default language is used. + # For more information, see + # [Multilingual intent and entity + # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields get updated. + # @!attribute [rw] intent_view + # @return [::Google::Cloud::Dialogflow::V2::IntentView] + # Optional. The resource view to apply to the returned intent. + class BatchUpdateIntentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents Intents.BatchUpdateIntents}. + # @!attribute [rw] intents + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent>] + # The collection of updated or created intents. + class BatchUpdateIntentsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Intents::Client#batch_delete_intents Intents.BatchDeleteIntents}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the agent to delete all entities types for. Format: + # `projects//agent`. + # @!attribute [rw] intents + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent>] + # Required. The collection of intents to delete. Only intent `name` must be + # filled in. + class BatchDeleteIntentsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message is a wrapper around a collection of intents. + # @!attribute [rw] intents + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent>] + # A collection of intents. + class IntentBatch + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the options for views of an intent. + # An intent can be a sizable object. Therefore, we provide a resource view that + # does not return training phrases in the response by default. + module IntentView + # Training phrases field is not populated in the response. + INTENT_VIEW_UNSPECIFIED = 0 + + # All fields are populated. + INTENT_VIEW_FULL = 1 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb new file mode 100644 index 000000000000..0a6fa7d91c68 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # A knowledge base represents a collection of knowledge documents that you + # provide to Dialogflow. Your knowledge documents contain information that may + # be useful during conversations with end-users. Some Dialogflow features use + # knowledge bases when looking for a response to an end-user input. + # + # For more information, see the [knowledge base + # guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). + # + # Note: The `projects.agent.knowledgeBases` resource is deprecated; + # only use `projects.knowledgeBases`. + # @!attribute [rw] name + # @return [::String] + # The knowledge base resource name. + # The name must be empty when creating a knowledge base. + # Format: `projects//locations//knowledgeBases/`. + # @!attribute [rw] display_name + # @return [::String] + # Required. The display name of the knowledge base. The name must be 1024 + # bytes or less; otherwise, the creation request fails. + # @!attribute [rw] language_code + # @return [::String] + # Language which represents the KnowledgeBase. When the KnowledgeBase is + # created/updated, expect this to be present for non en-us languages. When + # unspecified, the default language code en-us applies. + class KnowledgeBase + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases KnowledgeBases.ListKnowledgeBases}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project to list of knowledge bases for. + # Format: `projects//locations/`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return in a single page. By + # default 10 and at most 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token value returned from a previous list request. + # @!attribute [rw] filter + # @return [::String] + # The filter expression used to filter knowledge bases returned by the list + # method. The expression has the following syntax: + # + # [AND ] ... + # + # The following fields and operators are supported: + # + # * display_name with has(:) operator + # * language_code with equals(=) operator + # + # Examples: + # + # * 'language_code=en-us' matches knowledge bases with en-us language code. + # * 'display_name:articles' matches knowledge bases whose display name + # contains "articles". + # * 'display_name:"Best Articles"' matches knowledge bases whose display + # name contains "Best Articles". + # * 'language_code=en-gb AND display_name=articles' matches all knowledge + # bases whose display name contains "articles" and whose language code is + # "en-gb". + # + # Note: An empty filter string (i.e. "") is a no-op and will result in no + # filtering. + # + # For more information about filtering, see + # [API Filtering](https://aip.dev/160). + class ListKnowledgeBasesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases KnowledgeBases.ListKnowledgeBases}. + # @!attribute [rw] knowledge_bases + # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] + # The list of knowledge bases. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListKnowledgeBasesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#get_knowledge_base KnowledgeBases.GetKnowledgeBase}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the knowledge base to retrieve. + # Format `projects//locations//knowledgeBases/`. + class GetKnowledgeBaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#create_knowledge_base KnowledgeBases.CreateKnowledgeBase}. + # @!attribute [rw] parent + # @return [::String] + # Required. The project to create a knowledge base for. + # Format: `projects//locations/`. + # @!attribute [rw] knowledge_base + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # Required. The knowledge base to create. + class CreateKnowledgeBaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#delete_knowledge_base KnowledgeBases.DeleteKnowledgeBase}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the knowledge base to delete. + # Format: `projects//locations//knowledgeBases/`. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. Force deletes the knowledge base. When set to true, any documents + # in the knowledge base are also deleted. + class DeleteKnowledgeBaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#update_knowledge_base KnowledgeBases.UpdateKnowledgeBase}. + # @!attribute [rw] knowledge_base + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] + # Required. The knowledge base to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Not specified means `update all`. + # Currently, only `display_name` can be updated, an InvalidArgument will be + # returned for attempting to update other fields. + class UpdateKnowledgeBaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/operations.rb new file mode 100644 index 000000000000..ddbb7a24b9dd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/operations.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 Dialogflow + module V2 + # Metadata for a + # {::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#create_generator_evaluation GeneratorEvaluations.CreateGeneratorEvaluation} + # operation. + # @!attribute [r] generator_evaluation + # @return [::String] + # Output only. The resource name of the generator evaluation. Format: + # `projects//locations//generators//evaluations/` + class GeneratorEvaluationOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb new file mode 100644 index 000000000000..8d9a79153ed2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb @@ -0,0 +1,1689 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Represents a conversation participant (human agent, virtual agent, end-user). + # @!attribute [rw] name + # @return [::String] + # Optional. The unique identifier of this participant. + # Format: `projects//locations//conversations//participants/`. + # @!attribute [rw] role + # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Immutable. The role this participant plays in the conversation. This field + # must be set during participant creation and is then immutable. + # @!attribute [rw] sip_recording_media_label + # @return [::String] + # Optional. Label applied to streams representing this participant in SIPREC + # XML metadata and SDP. This is used to assign transcriptions from that + # media stream to this participant. This field can be updated. + # @!attribute [rw] obfuscated_external_user_id + # @return [::String] + # Optional. Obfuscated user id that should be associated with the created + # participant. + # + # You can specify a user id as follows: + # + # 1. If you set this field in + # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest#participant CreateParticipantRequest} + # or + # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest#participant UpdateParticipantRequest}, + # Dialogflow adds the obfuscated user id with the participant. + # + # 2. If you set this field in + # [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] + # or [StreamingAnalyzeContent] + # [google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id], + # Dialogflow will update + # {::Google::Cloud::Dialogflow::V2::Participant#obfuscated_external_user_id Participant.obfuscated_external_user_id}. + # + # Dialogflow returns an error if you try to add a user id for a + # non-{::Google::Cloud::Dialogflow::V2::Participant::Role::END_USER END_USER} + # participant. + # + # Dialogflow uses this user id for billing and measurement purposes. For + # example, Dialogflow determines whether a user in one conversation returned + # in a later conversation. + # + # Additionally, to link an escalated Virtual Agent conversation + # with its corresponding Agent Assist conversation for analytics, this field + # in Agent Assist conversations should be populated to indicate the user id + # of the `END_USER` participant in the escalated conversation. + # + # Note: + # + # * Please never pass raw user ids to Dialogflow. Always obfuscate your user + # id first. + # * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + # hash function like SHA-512. + # * The length of the user id must be <= 256 characters. + # @!attribute [rw] documents_metadata_filters + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Key-value filters on the metadata of documents returned by + # article suggestion. If specified, article suggestion only returns suggested + # documents that match all filters in their + # {::Google::Cloud::Dialogflow::V2::Document#metadata Document.metadata}. Multiple + # values for a metadata key should be concatenated by comma. For example, + # filters to match all documents that have 'US' or 'CA' in their market + # metadata values and 'agent' in their user metadata values will be + # ``` + # documents_metadata_filters { + # key: "market" + # value: "US,CA" + # } + # documents_metadata_filters { + # key: "user" + # value: "agent" + # } + # ``` + # @!attribute [rw] agent_desktop_source + # @return [::Google::Cloud::Dialogflow::V2::Participant::AgentDesktopSource] + # Optional. For tracking the utilization of prebuilt Agent Assist integration + # modules. This field is only inscope for Integration type that include UI + # Modules, Backend Modules, and Agent Desktop connector, it is out of scope + # for CCaaS and Direct Integration. + # For each human agent, prebuilt UI Modules needs to trigger the + # UpdateParticipant API to update this field. Both + # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest#participant CreateParticipantRequest} + # and + # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest#participant UpdateParticipantRequest} + # will be supported. + class Participant + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class DocumentsMetadataFiltersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enumeration of the roles a participant can play in a conversation. + module Role + # Participant role not set. + ROLE_UNSPECIFIED = 0 + + # Participant is a human agent. + HUMAN_AGENT = 1 + + # Participant is an automated agent, such as a Dialogflow agent. + AUTOMATED_AGENT = 2 + + # Participant is an end user that has called or chatted with + # Dialogflow services. + END_USER = 3 + end + + # Enumeration of the Agent Desktop Source when using prebuilt Agent + # Assist integration modules. + module AgentDesktopSource + # Agent Desktop Source is not specified. + AGENT_DESKTOP_SOURCE_UNSPECIFIED = 0 + + # Agent Desktop Source is Live Person. + LIVE_PERSON = 1 + + # Agent Desktop Source is Genesys Cloud. + GENESYS_CLOUD = 2 + + # Agent Desktop Source is Twilio. + TWILIO = 3 + + # Agent Desktop Source is Salesforce. + SALESFORCE = 4 + + # UI Modules are in use but the desktop is either not currently released or + # setting this field to the applicable desktop. + OTHER = 8 + end + end + + # Represents a message posted into a conversation. + # @!attribute [rw] name + # @return [::String] + # Optional. The unique identifier of the message. + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] content + # @return [::String] + # Required. The message content. + # @!attribute [rw] language_code + # @return [::String] + # Optional. The message language. + # This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + # language tag. Example: "en-US". + # @!attribute [r] participant + # @return [::String] + # Output only. The participant that sends this message. + # @!attribute [r] participant_role + # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] + # Output only. The role of the participant. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the message was created in Contact Center AI. + # @!attribute [rw] send_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The time when the message was sent. For voice messages, this is + # the time when an utterance started. + # @!attribute [r] message_annotation + # @return [::Google::Cloud::Dialogflow::V2::MessageAnnotation] + # Output only. The annotation for the message. + # @!attribute [r] sentiment_analysis + # @return [::Google::Cloud::Dialogflow::V2::SentimentAnalysisResult] + # Output only. The sentiment analysis result for the message. + class Message + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#create_participant Participants.CreateParticipant}. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource identifier of the conversation adding the participant. + # Format: `projects//locations//conversations/`. + # @!attribute [rw] participant + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # Required. The participant to create. + class CreateParticipantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#get_participant Participants.GetParticipant}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the participant. Format: + # `projects//locations//conversations//participants/`. + class GetParticipantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#list_participants Participants.ListParticipants}. + # @!attribute [rw] parent + # @return [::String] + # Required. The conversation to list all participants from. + # Format: `projects//locations//conversations/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListParticipantsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#list_participants Participants.ListParticipants}. + # @!attribute [rw] participants + # @return [::Array<::Google::Cloud::Dialogflow::V2::Participant>] + # The list of participants. There is a maximum number of items + # returned based on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results or empty if there are no + # more results in the list. + class ListParticipantsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#update_participant Participants.UpdateParticipant}. + # @!attribute [rw] participant + # @return [::Google::Cloud::Dialogflow::V2::Participant] + # Required. The participant to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to specify which fields to update. + class UpdateParticipantRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent}. + # @!attribute [rw] participant + # @return [::String] + # Required. The name of the participant this text comes from. + # Format: `projects//locations//conversations//participants/`. + # @!attribute [rw] text_input + # @return [::Google::Cloud::Dialogflow::V2::TextInput] + # The natural language text to be processed. + # + # Note: The following fields are mutually exclusive: `text_input`, `audio_input`, `event_input`, `suggestion_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] audio_input + # @return [::Google::Cloud::Dialogflow::V2::AudioInput] + # The natural language speech audio to be processed. + # + # Note: The following fields are mutually exclusive: `audio_input`, `text_input`, `event_input`, `suggestion_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] event_input + # @return [::Google::Cloud::Dialogflow::V2::EventInput] + # An input event to send to Dialogflow. + # + # Note: The following fields are mutually exclusive: `event_input`, `text_input`, `audio_input`, `suggestion_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] suggestion_input + # @return [::Google::Cloud::Dialogflow::V2::SuggestionInput] + # An input representing the selection of a suggestion. + # + # Note: The following fields are mutually exclusive: `suggestion_input`, `text_input`, `audio_input`, `event_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] reply_audio_config + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] + # Speech synthesis configuration. + # The speech synthesis settings for a virtual agent that may be configured + # for the associated conversation profile are not used when calling + # AnalyzeContent. If this configuration is not supplied, speech synthesis + # is disabled. + # @!attribute [rw] query_params + # @return [::Google::Cloud::Dialogflow::V2::QueryParameters] + # Parameters for a Dialogflow virtual-agent query. + # @!attribute [rw] assist_query_params + # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] + # Parameters for a human assist query. + # @!attribute [rw] cx_parameters + # @return [::Google::Protobuf::Struct] + # Additional parameters to be put into Dialogflow CX session parameters. To + # remove a parameter from the session, clients should explicitly set the + # parameter value to null. + # + # Note: this field should only be used if you are connecting to a Dialogflow + # CX agent. + # @!attribute [rw] request_id + # @return [::String] + # A unique identifier for this request. Restricted to 36 ASCII characters. + # A random UUID is recommended. + # This request is only idempotent if a `request_id` is provided. + class AnalyzeContentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message in the response that indicates the parameters of DTMF. + # @!attribute [rw] accepts_dtmf_input + # @return [::Boolean] + # Indicates whether DTMF input can be handled in the next request. + class DtmfParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent}. + # @!attribute [rw] reply_text + # @return [::String] + # The output text content. + # This field is set if the automated agent responded with text to show to + # the user. + # @!attribute [rw] reply_audio + # @return [::Google::Cloud::Dialogflow::V2::OutputAudio] + # The audio data bytes encoded as specified in the request. + # This field is set if: + # + # - `reply_audio_config` was specified in the request, or + # - The automated agent responded with audio to play to the user. In such + # case, `reply_audio.config` contains settings used to synthesize the + # speech. + # + # In some scenarios, multiple output audio fields may be present in the + # response structure. In these cases, only the top-most-level audio output + # has content. + # @!attribute [rw] automated_agent_reply + # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentReply] + # Only set if a Dialogflow automated agent has responded. + # Note that in [AutomatedAgentReply.DetectIntentResponse][], + # [Sessions.DetectIntentResponse.output_audio][] + # and [Sessions.DetectIntentResponse.output_audio_config][] + # are always empty, use + # {::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse#reply_audio reply_audio} + # instead. + # @!attribute [rw] message + # @return [::Google::Cloud::Dialogflow::V2::Message] + # Message analyzed by CCAI. + # @!attribute [rw] human_agent_suggestion_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] + # The suggestions for most recent human agent. The order is the same as + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} + # of + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#human_agent_suggestion_config HumanAgentAssistantConfig.human_agent_suggestion_config}. + # + # Note that any failure of Agent Assist features will not lead to the overall + # failure of an AnalyzeContent API call. Instead, the features will + # fail silently with the error field set in the corresponding + # SuggestionResult. + # @!attribute [rw] end_user_suggestion_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] + # The suggestions for end user. The order is the same as + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} + # of + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#end_user_suggestion_config HumanAgentAssistantConfig.end_user_suggestion_config}. + # + # Same as human_agent_suggestion_results, any failure of Agent Assist + # features will not lead to the overall failure of an AnalyzeContent API + # call. Instead, the features will fail silently with the error field set in + # the corresponding SuggestionResult. + # @!attribute [rw] dtmf_parameters + # @return [::Google::Cloud::Dialogflow::V2::DtmfParameters] + # Indicates the parameters of DTMF. + class AnalyzeContentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message sent by the client to the + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} + # method. + # + # Multiple request messages should be sent in order: + # + # 1. The first message must contain + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#participant participant}, + # [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] + # and optionally + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#query_params query_params}. + # If you want to receive an audio response, it should also contain + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#reply_audio_config reply_audio_config}. + # The message must not contain + # [input][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input]. + # + # 2. If + # [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in + # the first message + # was set to + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#audio_config audio_config}, + # all subsequent messages must contain + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#input_audio input_audio} + # to continue with Speech recognition. However, note that: + # + # * Dialogflow will bill you for the audio so far. + # * Dialogflow discards all Speech recognition results in favor of the + # text input. + # + # 3. If + # [StreamingAnalyzeContentRequest.config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] + # in the first message was set + # to + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#text_config StreamingAnalyzeContentRequest.text_config}, + # then the second message must contain only + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#input_text input_text}. + # Moreover, you must not send more than two messages. + # + # After you sent all input, you must half-close or abort the request stream. + # @!attribute [rw] participant + # @return [::String] + # Required. The name of the participant this text comes from. + # Format: `projects//locations//conversations//participants/`. + # @!attribute [rw] audio_config + # @return [::Google::Cloud::Dialogflow::V2::InputAudioConfig] + # Instructs the speech recognizer how to process the speech audio. + # + # Note: The following fields are mutually exclusive: `audio_config`, `text_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] text_config + # @return [::Google::Cloud::Dialogflow::V2::InputTextConfig] + # The natural language text to be processed. + # + # Note: The following fields are mutually exclusive: `text_config`, `audio_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] reply_audio_config + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] + # Speech synthesis configuration. + # The speech synthesis settings for a virtual agent that may be configured + # for the associated conversation profile are not used when calling + # StreamingAnalyzeContent. If this configuration is not supplied, speech + # synthesis is disabled. + # @!attribute [rw] input_audio + # @return [::String] + # The input audio content to be recognized. Must be sent if `audio_config` + # is set in the first message. The complete audio over all streaming + # messages must not exceed 1 minute. + # + # Note: The following fields are mutually exclusive: `input_audio`, `input_text`, `input_dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] input_text + # @return [::String] + # The UTF-8 encoded natural language text to be processed. Must be sent if + # `text_config` is set in the first message. Text length must not exceed + # 256 bytes for virtual agent interactions. The `input_text` field can be + # only sent once, and would cancel the speech recognition if any ongoing. + # + # Note: The following fields are mutually exclusive: `input_text`, `input_audio`, `input_dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] input_dtmf + # @return [::Google::Cloud::Dialogflow::V2::TelephonyDtmfEvents] + # The DTMF digits used to invoke intent and fill in parameter value. + # + # This input is ignored if the previous response indicated that DTMF input + # is not accepted. + # + # Note: The following fields are mutually exclusive: `input_dtmf`, `input_audio`, `input_text`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] query_params + # @return [::Google::Cloud::Dialogflow::V2::QueryParameters] + # Parameters for a Dialogflow virtual-agent query. + # @!attribute [rw] assist_query_params + # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] + # Parameters for a human assist query. + # @!attribute [rw] cx_parameters + # @return [::Google::Protobuf::Struct] + # Additional parameters to be put into Dialogflow CX session parameters. To + # remove a parameter from the session, clients should explicitly set the + # parameter value to null. + # + # Note: this field should only be used if you are connecting to a Dialogflow + # CX agent. + # @!attribute [rw] enable_extended_streaming + # @return [::Boolean] + # Optional. Enable full bidirectional streaming. You can keep streaming the + # audio until timeout, and there's no need to half close the stream to get + # the response. + # + # Restrictions: + # + # - Timeout: 3 mins. + # - Audio Encoding: only supports + # {::Google::Cloud::Dialogflow::V2::AudioEncoding::AUDIO_ENCODING_LINEAR_16 AudioEncoding.AUDIO_ENCODING_LINEAR_16} + # and + # {::Google::Cloud::Dialogflow::V2::AudioEncoding::AUDIO_ENCODING_MULAW AudioEncoding.AUDIO_ENCODING_MULAW} + # - Lifecycle: conversation should be in `Assist Stage`, go to + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#create_conversation Conversations.CreateConversation} + # for more information. + # + # InvalidArgument Error will be returned if the one of restriction checks + # failed. + # + # You can find more details in + # https://cloud.google.com/agent-assist/docs/extended-streaming + # @!attribute [rw] enable_partial_automated_agent_reply + # @return [::Boolean] + # Optional. Enable partial responses from Dialogflow CX agent. If this flag + # is not enabled, response stream still contains only one final response even + # if some `Fulfillment`s in Dialogflow CX agent have been configured to + # return partial responses. + # @!attribute [rw] output_multiple_utterances + # @return [::Boolean] + # Optional. If multiple uttereances are detected in the audio stream, process + # them individually instead of stitching them together to form a single + # utterance. + # @!attribute [rw] enable_debugging_info + # @return [::Boolean] + # If true, `StreamingAnalyzeContentResponse.debugging_info` will get + # populated. + class StreamingAnalyzeContentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message returned from the `StreamingAnalyzeContent` method. + # + # Multiple response messages can be returned in order: + # + # 1. If the input was set to streaming audio, the first one or more messages + # contain `recognition_result`. Each `recognition_result` represents a more + # complete transcript of what the user said. When a user speaks multiple + # sentences, the API will emit multiple messages where `is_final = true`. + # Each time the system detects a distinct pause or completed thought, it + # locks in that segment, marks it `is_final = true`, and then immediately + # starts a new recognition cycle for the next sentence on the same stream. + # + # 2. In virtual agent stage: if `enable_partial_automated_agent_reply` is + # true, the following N (currently 1 <= N <= 4) messages + # contain `automated_agent_reply` and optionally `reply_audio` + # returned by the virtual agent. The first (N-1) + # `automated_agent_reply`s will have `automated_agent_reply_type` set to + # `PARTIAL`. The last `automated_agent_reply` has + # `automated_agent_reply_type` set to `FINAL`. + # If `enable_partial_automated_agent_reply` is not enabled, response stream + # only contains the final reply. + # + # In human assist stage: the following N (N >= 1) messages contain + # `human_agent_suggestion_results`, `end_user_suggestion_results` or + # `message`. + # @!attribute [rw] recognition_result + # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult] + # The result of speech recognition. + # @!attribute [rw] reply_text + # @return [::String] + # The output text content. + # This field is set if an automated agent responded with a text for the user. + # @!attribute [rw] reply_audio + # @return [::Google::Cloud::Dialogflow::V2::OutputAudio] + # The audio data bytes encoded as specified in the request. + # This field is set if: + # + # - The `reply_audio_config` field is specified in the request. + # - The automated agent, which this output comes from, responded with audio. + # In such case, the `reply_audio.config` field contains settings used to + # synthesize the speech. + # + # In some scenarios, multiple output audio fields may be present in the + # response structure. In these cases, only the top-most-level audio output + # has content. + # @!attribute [rw] automated_agent_reply + # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentReply] + # Note that in [AutomatedAgentReply.DetectIntentResponse][], + # [Sessions.DetectIntentResponse.output_audio][] + # and [Sessions.DetectIntentResponse.output_audio_config][] + # are always empty, use + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#reply_audio reply_audio} + # instead. + # @!attribute [rw] message + # @return [::Google::Cloud::Dialogflow::V2::Message] + # Message analyzed by CCAI. + # @!attribute [rw] human_agent_suggestion_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] + # The suggestions for most recent human agent. The order is the same as + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} + # of + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#human_agent_suggestion_config HumanAgentAssistantConfig.human_agent_suggestion_config}. + # @!attribute [rw] end_user_suggestion_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] + # The suggestions for end user. The order is the same as + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} + # of + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#end_user_suggestion_config HumanAgentAssistantConfig.end_user_suggestion_config}. + # @!attribute [rw] dtmf_parameters + # @return [::Google::Cloud::Dialogflow::V2::DtmfParameters] + # Indicates the parameters of DTMF. + # @!attribute [rw] debugging_info + # @return [::Google::Cloud::Dialogflow::V2::CloudConversationDebuggingInfo] + # Debugging info that would get populated when + # `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. + # @!attribute [rw] speech_model + # @return [::String] + # The name of the actual Cloud speech model used for speech recognition. + class StreamingAnalyzeContentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles Participants.SuggestArticles}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the participant to fetch suggestion for. + # Format: `projects//locations//conversations//participants/`. + # @!attribute [rw] latest_message + # @return [::String] + # Optional. The name of the latest conversation message to compile suggestion + # for. If empty, it will be the latest message of the conversation. + # + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Optional. Max number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#latest_message latest_message} + # to use as context when compiling the suggestion. By default 20 and at + # most 50. + # @!attribute [rw] assist_query_params + # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] + # Parameters for a human assist query. + class SuggestArticlesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles Participants.SuggestArticles}. + # @!attribute [rw] article_answers + # @return [::Array<::Google::Cloud::Dialogflow::V2::ArticleAnswer>] + # Articles ordered by score in descending order. + # @!attribute [rw] latest_message + # @return [::String] + # The name of the latest conversation message used to compile + # suggestion for. + # + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse#latest_message latest_message} + # to compile the suggestion. It may be smaller than the + # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#context_size SuggestArticlesRequest.context_size} + # field in the request if there aren't that many messages in the + # conversation. + class SuggestArticlesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_faq_answers Participants.SuggestFaqAnswers}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the participant to fetch suggestion for. + # Format: `projects//locations//conversations//participants/`. + # @!attribute [rw] latest_message + # @return [::String] + # Optional. The name of the latest conversation message to compile suggestion + # for. If empty, it will be the latest message of the conversation. + # + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Optional. Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 20 and at most 50. + # @!attribute [rw] assist_query_params + # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] + # Parameters for a human assist query. + class SuggestFaqAnswersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_faq_answers Participants.SuggestFaqAnswers}. + # @!attribute [rw] faq_answers + # @return [::Array<::Google::Cloud::Dialogflow::V2::FaqAnswer>] + # Answers extracted from FAQ documents. + # @!attribute [rw] latest_message + # @return [::String] + # The name of the latest conversation message used to compile + # suggestion for. + # + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse#latest_message latest_message} + # to compile the suggestion. It may be smaller than the + # {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest#context_size SuggestFaqAnswersRequest.context_size} + # field in the request if there aren't that many messages in the + # conversation. + class SuggestFaqAnswersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_suggestions Conversations.GenerateSuggestions}. + # @!attribute [rw] generator_suggestion_answers + # @return [::Array<::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse::GeneratorSuggestionAnswer>] + # The answers generated for the conversation based on context. + # @!attribute [rw] latest_message + # @return [::String] + # The name of the latest conversation message used as context for + # compiling suggestion. + # + # Format: `projects//locations//conversations//messages/`. + class GenerateSuggestionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A GeneratorSuggestion answer. + # @!attribute [rw] generator_suggestion + # @return [::Google::Cloud::Dialogflow::V2::GeneratorSuggestion] + # Suggestion details. + # @!attribute [rw] source_generator + # @return [::String] + # The name of the generator used to generate this suggestion. Format: + # `projects//locations//generators/`. + # @!attribute [rw] answer_record + # @return [::String] + # Answer record that uniquely identifies the suggestion. This can be used + # to provide suggestion feedback. + class GeneratorSuggestionAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_smart_replies Participants.SuggestSmartReplies}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the participant to fetch suggestion for. + # Format: `projects//locations//conversations//participants/`. + # @!attribute [rw] current_text_input + # @return [::Google::Cloud::Dialogflow::V2::TextInput] + # The current natural language text segment to compile suggestion + # for. This provides a way for user to get follow up smart reply suggestion + # after a smart reply selection, without sending a text message. + # @!attribute [rw] latest_message + # @return [::String] + # The name of the latest conversation message to compile suggestion + # for. If empty, it will be the latest message of the conversation. + # + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Max number of messages prior to and including + # [latest_message] to use as context when compiling the + # suggestion. By default 20 and at most 50. + class SuggestSmartRepliesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_smart_replies Participants.SuggestSmartReplies}. + # @!attribute [r] smart_reply_answers + # @return [::Array<::Google::Cloud::Dialogflow::V2::SmartReplyAnswer>] + # Output only. Multiple reply options provided by smart reply service. The + # order is based on the rank of the model prediction. + # The maximum number of the returned replies is set in SmartReplyConfig. + # @!attribute [rw] latest_message + # @return [::String] + # The name of the latest conversation message used to compile + # suggestion for. + # + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse#latest_message latest_message} + # to compile the suggestion. It may be smaller than the + # {::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest#context_size SuggestSmartRepliesRequest.context_size} + # field in the request if there aren't that many messages in the + # conversation. + class SuggestSmartRepliesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the natural language speech audio to be processed. + # @!attribute [rw] config + # @return [::Google::Cloud::Dialogflow::V2::InputAudioConfig] + # Required. Instructs the speech recognizer how to process the speech audio. + # @!attribute [rw] audio + # @return [::String] + # Required. The natural language speech audio to be processed. + # A single request can contain up to 2 minutes of speech audio data. + # The transcribed text cannot contain more than 256 bytes for virtual agent + # interactions. + class AudioInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the natural language speech audio to be played to the end user. + # @!attribute [rw] config + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] + # Instructs the speech synthesizer how to generate the speech + # audio. + # @!attribute [rw] audio + # @return [::String] + # The natural language speech audio. + class OutputAudio + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a response from an automated agent. + # @!attribute [rw] detect_intent_response + # @return [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] + # Response of the Dialogflow + # {::Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent Sessions.DetectIntent} + # call. + # @!attribute [rw] automated_agent_reply_type + # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentReply::AutomatedAgentReplyType] + # AutomatedAgentReply type. + # @!attribute [rw] allow_cancellation + # @return [::Boolean] + # Indicates whether the partial automated agent reply is interruptible when a + # later reply message arrives. e.g. if the agent specified some music as + # partial response, it can be cancelled. + # @!attribute [rw] cx_current_page + # @return [::String] + # The unique identifier of the current Dialogflow CX conversation page. + # Format: `projects//locations//agents//flows//pages/`. + class AutomatedAgentReply + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents different automated agent reply types. + module AutomatedAgentReplyType + # Not specified. This should never happen. + AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED = 0 + + # Partial reply. e.g. Aggregated responses in a `Fulfillment` that enables + # `return_partial_response` can be returned as partial reply. + # WARNING: partial reply is not eligible for barge-in. + PARTIAL = 1 + + # Final reply. + FINAL = 2 + end + end + + # Represents article answer. + # @!attribute [rw] title + # @return [::String] + # The article title. + # @!attribute [rw] uri + # @return [::String] + # The article URI. + # @!attribute [rw] snippets + # @return [::Array<::String>] + # Article snippets. + # @!attribute [rw] confidence + # @return [::Float] + # Article match confidence. + # The system's confidence score that this article is a good match for this + # conversation, as a value from 0.0 (completely uncertain) to 1.0 + # (completely certain). + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # A map that contains metadata about the answer and the + # document from which it originates. + # @!attribute [rw] answer_record + # @return [::String] + # The name of answer record, in the format of + # "projects//locations//answerRecords/" + class ArticleAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents answer from "frequently asked questions". + # @!attribute [rw] answer + # @return [::String] + # The piece of text from the `source` knowledge base document. + # @!attribute [rw] confidence + # @return [::Float] + # The system's confidence score that this Knowledge answer is a good match + # for this conversational query, range from 0.0 (completely uncertain) + # to 1.0 (completely certain). + # @!attribute [rw] question + # @return [::String] + # The corresponding FAQ question. + # @!attribute [rw] source + # @return [::String] + # Indicates which Knowledge Document this answer was extracted + # from. + # Format: `projects//locations//agent/knowledgeBases//documents/`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # A map that contains metadata about the answer and the + # document from which it originates. + # @!attribute [rw] answer_record + # @return [::String] + # The name of answer record, in the format of + # "projects//locations//answerRecords/" + class FaqAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents a smart reply answer. + # @!attribute [rw] reply + # @return [::String] + # The content of the reply. + # @!attribute [rw] confidence + # @return [::Float] + # Smart reply confidence. + # The system's confidence score that this reply is a good match for + # this conversation, as a value from 0.0 (completely uncertain) to 1.0 + # (completely certain). + # @!attribute [rw] answer_record + # @return [::String] + # The name of answer record, in the format of + # "projects//locations//answerRecords/" + class SmartReplyAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an intent suggestion. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the intent. + # @!attribute [rw] intent_v2 + # @return [::String] + # The unique identifier of this + # {::Google::Cloud::Dialogflow::V2::Intent intent}. Format: `projects//locations//agent/intents/`. + # @!attribute [rw] description + # @return [::String] + # Human readable description for better understanding an intent like its + # scope, content, result etc. Maximum character limit: 140 characters. + class IntentSuggestion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a Dialogflow assist answer. + # @!attribute [rw] query_result + # @return [::Google::Cloud::Dialogflow::V2::QueryResult] + # Result from v2 agent. + # + # Note: The following fields are mutually exclusive: `query_result`, `intent_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] intent_suggestion + # @return [::Google::Cloud::Dialogflow::V2::IntentSuggestion] + # An intent suggestion generated from conversation. + # + # Note: The following fields are mutually exclusive: `intent_suggestion`, `query_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] answer_record + # @return [::String] + # The name of answer record, in the format of + # "projects//locations//answerRecords/" + class DialogflowAssistAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One response of different type of suggestion response which is used in + # the response of + # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} + # and + # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent}, + # as well as + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantEvent HumanAgentAssistantEvent}. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # Error status if the request failed. + # + # Note: The following fields are mutually exclusive: `error`, `suggest_articles_response`, `suggest_knowledge_assist_response`, `suggest_faq_answers_response`, `suggest_smart_replies_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] suggest_articles_response + # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] + # SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + # + # Note: The following fields are mutually exclusive: `suggest_articles_response`, `error`, `suggest_knowledge_assist_response`, `suggest_faq_answers_response`, `suggest_smart_replies_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] suggest_knowledge_assist_response + # @return [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] + # SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. + # + # Note: The following fields are mutually exclusive: `suggest_knowledge_assist_response`, `error`, `suggest_articles_response`, `suggest_faq_answers_response`, `suggest_smart_replies_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] suggest_faq_answers_response + # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] + # SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + # + # Note: The following fields are mutually exclusive: `suggest_faq_answers_response`, `error`, `suggest_articles_response`, `suggest_knowledge_assist_response`, `suggest_smart_replies_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] suggest_smart_replies_response + # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] + # SuggestSmartRepliesResponse if request is for SMART_REPLY. + # + # Note: The following fields are mutually exclusive: `suggest_smart_replies_response`, `error`, `suggest_articles_response`, `suggest_knowledge_assist_response`, `suggest_faq_answers_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] generate_suggestions_response + # @return [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] + # Suggestions generated using generators triggered by customer or agent + # messages. + # + # Note: The following fields are mutually exclusive: `generate_suggestions_response`, `error`, `suggest_articles_response`, `suggest_knowledge_assist_response`, `suggest_faq_answers_response`, `suggest_smart_replies_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class SuggestionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the language used in the input text. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language of this conversational query. See [Language + # Support](https://cloud.google.com/dialogflow/docs/reference/language) + # for a list of the currently supported language codes. + class InputTextConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a part of a message possibly annotated with an entity. The part + # can be an entity or purely a part of the message between two entities or + # message start/end. + # @!attribute [rw] text + # @return [::String] + # A part of a message possibly annotated with an entity. + # @!attribute [rw] entity_type + # @return [::String] + # The [Dialogflow system entity + # type](https://cloud.google.com/dialogflow/docs/reference/system-entities) + # of this message part. If this is empty, Dialogflow could not annotate the + # phrase part with a system entity. + # @!attribute [rw] formatted_value + # @return [::Google::Protobuf::Value] + # The [Dialogflow system entity formatted value + # ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of + # this message part. For example for a system entity of type + # `@sys.unit-currency`, this may contain: + #
+        #     {
+        #       "amount": 5,
+        #       "currency": "USD"
+        #     }
+        #     
+ class AnnotatedMessagePart + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the result of annotation for the message. + # @!attribute [rw] parts + # @return [::Array<::Google::Cloud::Dialogflow::V2::AnnotatedMessagePart>] + # The collection of annotated message parts ordered by their + # position in the message. You can recover the annotated message by + # concatenating [AnnotatedMessagePart.text]. + # @!attribute [rw] contain_entities + # @return [::Boolean] + # Indicates whether the text message contains entities. + class MessageAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the action to take for a tool call that requires confirmation. + # @!attribute [rw] answer_record + # @return [::String] + # Required. Format: `projects//locations//answerRecords/` + # The answer record associated with the tool call. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Struct] + # Optional. Parameters to be used for the tool call. If not provided, the + # tool will be called without any parameters. + # @!attribute [rw] action + # @return [::Google::Cloud::Dialogflow::V2::SuggestionInput::Action] + # Optional. The type of action to take with the tool. + # @!attribute [rw] send_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Time when the current suggest input is sent. For tool calls, this + # timestamp (along with the answer record) will be included in the + # corresponding tool call result so that it can be identified. + class SuggestionInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicate what type of action to take with the tool call. + module Action + # Action not specified. + ACTION_UNSPECIFIED = 0 + + # Indicates the user chooses to not make the tool call. It + # is only applicable to tool calls that are waiting for user + # confirmation. + CANCEL = 1 + + # Makes the tool call with provided parameters. This action is intended + # for tool calls that only read but not write data. + REVISE = 2 + + # Makes the tool call with provided parameters. This action is intended + # for tool calls that may write data. + CONFIRM = 3 + end + end + + # Represents the parameters of human assist query. + # @!attribute [rw] documents_metadata_filters + # @return [::Google::Protobuf::Map{::String => ::String}] + # Key-value filters on the metadata of documents returned by article + # suggestion. If specified, article suggestion only returns suggested + # documents that match all filters in their + # {::Google::Cloud::Dialogflow::V2::Document#metadata Document.metadata}. Multiple + # values for a metadata key should be concatenated by comma. For example, + # filters to match all documents that have 'US' or 'CA' in their market + # metadata values and 'agent' in their user metadata values will be + # ``` + # documents_metadata_filters { + # key: "market" + # value: "US,CA" + # } + # documents_metadata_filters { + # key: "user" + # value: "agent" + # } + # ``` + class AssistQueryParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class DocumentsMetadataFiltersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist Participants.SuggestKnowledgeAssist}. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the participant to fetch suggestions for. + # Format: `projects//locations//conversations//participants/`. + # @!attribute [rw] latest_message + # @return [::String] + # Optional. The name of the latest conversation message to compile + # suggestions for. If empty, it will be the latest message of the + # conversation. Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Optional. Max number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest#latest_message latest_message} + # to use as context when compiling the suggestion. The context size is by + # default 100 and at most 100. + # @!attribute [rw] previous_suggested_query + # @return [::String] + # Optional. The previously suggested query for the given conversation. This + # helps identify whether the next suggestion we generate is reasonably + # different from the previous one. This is useful to avoid similar + # suggestions within the conversation. + class SuggestKnowledgeAssistRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist Participants.SuggestKnowledgeAssist}. + # @!attribute [r] knowledge_assist_answer + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer] + # Output only. Knowledge Assist suggestion. + # @!attribute [rw] latest_message + # @return [::String] + # The name of the latest conversation message used to compile suggestion for. + # Format: `projects//locations//conversations//messages/`. + # @!attribute [rw] context_size + # @return [::Integer] + # Number of messages prior to and including + # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse#latest_message latest_message} + # to compile the suggestion. It may be smaller than the + # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest#context_size SuggestKnowledgeAssistRequest.context_size} + # field in the request if there are fewer messages in the conversation. + # @!attribute [rw] additional_suggested_query_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::AdditionalSuggestedQueryResult>] + # Optional. The list of additional suggested queries based on the context. + # This is used for the cases when we want to generate multiple queries + # for a single request. + class SuggestKnowledgeAssistResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Debug information related to ingested context reference. + # @!attribute [rw] project_not_allowlisted + # @return [::Boolean] + # Indicates if the project is allowlisted to use ingested context + # reference. + # @!attribute [rw] context_reference_retrieved + # @return [::Boolean] + # The status of context_reference retrieval from database. + # @!attribute [rw] ingested_parameters_debug_info + # @return [::Array<::Google::Cloud::Dialogflow::V2::IngestedContextReferenceDebugInfo::IngestedParameterDebugInfo>] + # Parameters ingested from the context reference. + class IngestedContextReferenceDebugInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Debug information related to ingested parameters from context reference. + # @!attribute [rw] parameter + # @return [::String] + # The name of the parameter in the context reference. + # @!attribute [rw] ingestion_status + # @return [::Google::Cloud::Dialogflow::V2::IngestedContextReferenceDebugInfo::IngestedParameterDebugInfo::IngestionStatus] + # The ingestion status for this specific parameter. + class IngestedParameterDebugInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum representing the various states of parameter ingestion. + module IngestionStatus + # Default value, indicates that the ingestion status is not specified. + INGESTION_STATUS_UNSPECIFIED = 0 + + # Indicates that the parameter was successfully ingested. + INGESTION_STATUS_SUCCEEDED = 1 + + # Indicates that the parameter was not available for ingestion. + INGESTION_STATUS_CONTEXT_NOT_AVAILABLE = 2 + + # Indicates that there was a failure parsing the parameter content. + INGESTION_STATUS_PARSE_FAILED = 3 + + # Indicates that the context reference had an unexpected number of + # content entries as Context reference should only have one entry. + INGESTION_STATUS_INVALID_ENTRY = 4 + + # Indicates that the context reference content was not in the expected + # format (e.g., JSON). + INGESTION_STATUS_INVALID_FORMAT = 5 + + # Indicates that the context reference language does not match the + # conversation language. + INGESTION_STATUS_LANGUAGE_MISMATCH = 6 + end + end + end + + # Message to represent the latency of the service. + # @!attribute [rw] internal_service_latencies + # @return [::Array<::Google::Cloud::Dialogflow::V2::ServiceLatency::InternalServiceLatency>] + # A list of internal service latencies. + class ServiceLatency + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message to represent the latency of an internal service. + # @!attribute [rw] step + # @return [::String] + # The name of the internal service. + # @!attribute [rw] latency_ms + # @return [::Float] + # The latency of the internal service in milliseconds. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The start time of the internal service. + # @!attribute [rw] complete_time + # @return [::Google::Protobuf::Timestamp] + # The completion time of the internal service. + class InternalServiceLatency + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Debug information related to Knowledge Assist feature. + # @!attribute [rw] query_generation_failure_reason + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo::QueryGenerationFailureReason] + # Reason for query generation. + # @!attribute [rw] query_categorization_failure_reason + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo::QueryCategorizationFailureReason] + # Reason for query categorization. + # @!attribute [rw] datastore_response_reason + # @return [::Google::Cloud::Dialogflow::V2::DatastoreResponseReason] + # Response reason from datastore which indicates data serving status or + # answer quality degradation. + # @!attribute [rw] knowledge_assist_behavior + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo::KnowledgeAssistBehavior] + # Configured behaviors for Knowedge Assist. + # @!attribute [rw] ingested_context_reference_debug_info + # @return [::Google::Cloud::Dialogflow::V2::IngestedContextReferenceDebugInfo] + # Information about parameters ingested for search knowledge. + # @!attribute [rw] service_latency + # @return [::Google::Cloud::Dialogflow::V2::ServiceLatency] + # The latency of the service. + # @!attribute [rw] query_generation_debug_info + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo::QueryGenerationDebugInfo] + # Token usage metadata for query generation. + # @!attribute [rw] ces_debug_info + # @return [::Google::Protobuf::Struct] + # Debug information from CES runtime API. + class KnowledgeAssistDebugInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configured behaviors for Knowedge Assist. + # @!attribute [rw] answer_generation_rewriter_on + # @return [::Boolean] + # Whether data store agent rewriter was turned off for the request. + # @!attribute [rw] end_user_metadata_included + # @return [::Boolean] + # Whether end_user_metadata is included in the data store agent call. + # @!attribute [rw] return_query_only + # @return [::Boolean] + # Whether customers configured to return query only in the + # conversation profile. + # @!attribute [rw] use_pubsub_delivery + # @return [::Boolean] + # Whether customers configured to use pubsub to deliver. + # @!attribute [rw] disable_sync_delivery + # @return [::Boolean] + # Whether customers configured to disable the synchronous delivery of + # Knowedge Assist response. + # @!attribute [rw] previous_queries_included + # @return [::Boolean] + # Whether previously suggested queries are included in the query generation + # process. + # @!attribute [rw] use_translated_message + # @return [::Boolean] + # Translated message is included in query generation process. + # @!attribute [rw] use_custom_safety_filter_level + # @return [::Boolean] + # Safety filter is adjusted by user. + # @!attribute [rw] conversation_transcript_has_mixed_languages + # @return [::Boolean] + # Conversation transcript has mixed languages. + # @!attribute [rw] query_generation_agent_language_mismatch + # @return [::Boolean] + # Whether the agent language from the translation generator mismatches the + # end-user language. + # @!attribute [rw] query_generation_end_user_language_mismatch + # @return [::Boolean] + # Whether the end-user language from the translation generator mismatches + # the end-user language. + # @!attribute [rw] third_party_connector_allowed + # @return [::Boolean] + # This field indicates whether third party connectors are enabled for the + # project + # @!attribute [rw] multiple_queries_generated + # @return [::Boolean] + # Indicates that the query generation model generated multiple queries. + # @!attribute [rw] query_contained_search_context + # @return [::Boolean] + # Indicates that the generated query contains search context. + # @!attribute [rw] invalid_items_query_suggestion_skipped + # @return [::Boolean] + # Indicates that invalid items were skipped when parsing the LLM response. + # @!attribute [rw] primary_query_redacted_and_replaced + # @return [::Boolean] + # True if the primary suggested query was redacted and replaced by an + # additional query. + # @!attribute [rw] appended_search_context_count + # @return [::Integer] + # The number of search contexts appended to the query. + class KnowledgeAssistBehavior + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Token usage metadata for query generation. + # @!attribute [rw] prompt_token_count + # @return [::Integer] + # The total number of tokens in the prompt. + # @!attribute [rw] candidates_token_count + # @return [::Integer] + # The total number of tokens in the generated candidates. + # @!attribute [rw] total_token_count + # @return [::Integer] + # The total number of tokens for the entire request. + class QueryGenerationDebugInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Reason for query generation failure. + module QueryGenerationFailureReason + # Default value. + QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED = 0 + + # Query generation is blocked due to out of quota. + QUERY_GENERATION_OUT_OF_QUOTA = 1 + + # Call to Knowedge Assist query generation model fails. + QUERY_GENERATION_FAILED = 2 + + # Query generation model decides that there is no new topic change or + # there has been similar queries generated in the previous turns. + QUERY_GENERATION_NO_QUERY_GENERATED = 3 + + # Knowedge Assist generated query is blocked by RAI (Responsible AI). + QUERY_GENERATION_RAI_FAILED = 4 + + # Query generation is blocked by Knowledge Assist conversation profile + # level / agent id level filtering. + NOT_IN_ALLOWLIST = 5 + + # The generated query is blocked due to redaction. + QUERY_GENERATION_QUERY_REDACTED = 6 + + # Query generation failed due to LLM response parse failure. + QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED = 10 + + # The conversation has no messages. + QUERY_GENERATION_EMPTY_CONVERSATION = 11 + + # The last message in the conversation is empty. + QUERY_GENERATION_EMPTY_LAST_MESSAGE = 12 + + # The trigger event condition is not met. + # This occurs in the following scenarios: + # 1. The trigger_event is CUSTOMER_MESSAGE or UNSPECIFIED, but the last + # message is not from the customer. + # 2. The trigger_event is AGENT_MESSAGE, but the last message is not from + # the agent. + QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET = 13 + end + + # Reason for query categorization failure. + module QueryCategorizationFailureReason + # Default value. + QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED = 0 + + # Vertex AI Search config supplied for query categorization is invalid. + QUERY_CATEGORIZATION_INVALID_CONFIG = 1 + + # Vertex AI Search result does not contain a query categorization result. + QUERY_CATEGORIZATION_RESULT_NOT_FOUND = 2 + + # Vertex AI Search call fails. + QUERY_CATEGORIZATION_FAILED = 3 + end + end + + # Represents a Knowledge Assist answer. + # @!attribute [rw] suggested_query + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::SuggestedQuery] + # The query suggested based on the context. Suggestion is made only if it + # is different from the previous suggestion. + # @!attribute [rw] suggested_query_answer + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer] + # The answer generated for the suggested query. Whether or not an answer is + # generated depends on how confident we are about the generated query. + # @!attribute [rw] answer_record + # @return [::String] + # The name of the answer record. + # Format: `projects//locations//answer + # Records/`. + # @!attribute [rw] knowledge_assist_debug_info + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo] + # Debug information related to Knowledge Assist feature. + class KnowledgeAssistAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a suggested query. + # @!attribute [rw] query_text + # @return [::String] + # Suggested query text. + # @!attribute [rw] search_contexts + # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::SuggestedQuery::SearchContext>] + # Optional. The search contexts for the query. + class SuggestedQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Search context is information useful for knowledge search that helps + # enrich the query. + # Example: + # search_context { + # key: "application name" + # value: "DesignApp" + # } + # @!attribute [rw] key + # @return [::String] + # Optional. The key of the search context, e.g. "application name". + # @!attribute [rw] value + # @return [::String] + # Optional. The value of the search context, e.g. "DesignApp". + class SearchContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents a single suggested query result. + # @!attribute [r] suggested_query + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::SuggestedQuery] + # Output only. The suggested query based on the context. + # @!attribute [r] answer_record + # @return [::String] + # Output only. The name of the answer record. + # Format: `projects//locations//answerRecords/` + class AdditionalSuggestedQueryResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an answer from Knowledge. Currently supports FAQ and Generative + # answers. + # @!attribute [rw] answer_text + # @return [::String] + # The piece of text from the `source` that answers this suggested query. + # @!attribute [rw] faq_source + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::FaqSource] + # Populated if the prediction came from FAQ. + # + # Note: The following fields are mutually exclusive: `faq_source`, `generative_source`, `playbook_source`, `event_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] generative_source + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource] + # Populated if the prediction was Generative. + # + # Note: The following fields are mutually exclusive: `generative_source`, `faq_source`, `playbook_source`, `event_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] playbook_source + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource] + # Populated if the prediction was from Playbook. + # + # Note: The following fields are mutually exclusive: `playbook_source`, `faq_source`, `generative_source`, `event_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] event_source + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::EventSource] + # Populated if the prediction was from an event. + # + # Note: The following fields are mutually exclusive: `event_source`, `faq_source`, `generative_source`, `playbook_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class KnowledgeAnswer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Details about source of FAQ answer. + # @!attribute [rw] question + # @return [::String] + # The corresponding FAQ question. + class FaqSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about source of Generative answer. + # @!attribute [rw] snippets + # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource::Snippet>] + # All snippets used for this Generative Prediction, with their source URI + # and data. + class GenerativeSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Snippet Source for a Generative Prediction. + # @!attribute [rw] uri + # @return [::String] + # URI the data is sourced from. + # @!attribute [rw] text + # @return [::String] + # Text taken from that URI. + # @!attribute [rw] title + # @return [::String] + # Title of the document. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Metadata of the document. + class Snippet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Details about source of Event answer. + # @!attribute [rw] event + # @return [::String] + # Name of the triggered event. + # @!attribute [rw] snippets + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource] + # Sources used in event fulfillment. + class EventSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Response reason from datastore which indicates data serving status or + # answer quality degradation. + module DatastoreResponseReason + # Default value. + DATASTORE_RESPONSE_REASON_UNSPECIFIED = 0 + + # No specific response reason from datastore. + NONE = 1 + + # Search is blocked due to out of quota. + SEARCH_OUT_OF_QUOTA = 2 + + # Search returns empty results. + SEARCH_EMPTY_RESULTS = 3 + + # Generative AI is disabled. + ANSWER_GENERATION_GEN_AI_DISABLED = 4 + + # Answer generation is blocked due to out of quota. + ANSWER_GENERATION_OUT_OF_QUOTA = 5 + + # Answer generation encounters an error. + ANSWER_GENERATION_ERROR = 6 + + # Answer generation does not have enough information to generate answer. + ANSWER_GENERATION_NOT_ENOUGH_INFO = 7 + + # Answer generation is blocked by RAI (Responsible AI) failure. + ANSWER_GENERATION_RAI_FAILED = 8 + + # Answer generation is not grounded on reliable sources. + ANSWER_GENERATION_NOT_GROUNDED = 9 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb new file mode 100644 index 000000000000..3530af5106e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb @@ -0,0 +1,762 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # The request to detect user's intent. + # @!attribute [rw] session + # @return [::String] + # Required. The name of the session this query is sent to. Format: + # `projects//agent/sessions/`, or + # `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + # default 'draft' environment (`Environment ID` might be referred to as + # environment name at some places). If `User ID` is not specified, we are + # using "-". It's up to the API caller to choose an appropriate `Session ID` + # and `User Id`. They can be a random number or some type of user and session + # identifiers (preferably hashed). The length of the `Session ID` and + # `User ID` must not exceed 36 characters. + # + # For more information, see the [API interactions + # guide](https://cloud.google.com/dialogflow/docs/api-overview). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # @!attribute [rw] query_params + # @return [::Google::Cloud::Dialogflow::V2::QueryParameters] + # The parameters of this query. + # @!attribute [rw] query_input + # @return [::Google::Cloud::Dialogflow::V2::QueryInput] + # Required. The input specification. It can be set to: + # + # 1. an audio config which instructs the speech recognizer how to process + # the speech audio, + # + # 2. a conversational query in the form of text, or + # + # 3. an event that specifies which intent to trigger. + # @!attribute [rw] output_audio_config + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] + # Instructs the speech synthesizer how to generate the output + # audio. If this field is not set and agent-level speech synthesizer is not + # configured, no output audio is generated. + # @!attribute [rw] output_audio_config_mask + # @return [::Google::Protobuf::FieldMask] + # Mask for + # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} + # indicating which settings in this request-level config should override + # speech synthesizer settings defined at agent-level. + # + # If unspecified or empty, + # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} + # replaces the agent-level config in its entirety. + # @!attribute [rw] input_audio + # @return [::String] + # The natural language speech audio to be processed. This field + # should be populated iff `query_input` is set to an input audio config. + # A single request can contain up to 1 minute of speech audio data. + class DetectIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message returned from the [DetectIntent][] method. + # @!attribute [rw] response_id + # @return [::String] + # The unique identifier of the response. It can be used to + # locate a response in the training example set or for reporting issues. + # @!attribute [rw] query_result + # @return [::Google::Cloud::Dialogflow::V2::QueryResult] + # The selected results of the conversational query or event processing. + # See `alternative_query_results` for additional potential results. + # @!attribute [rw] webhook_status + # @return [::Google::Rpc::Status] + # Specifies the status of the webhook request. + # @!attribute [rw] output_audio + # @return [::String] + # The audio data bytes encoded as specified in the request. + # Note: The output audio is generated based on the values of default platform + # text responses found in the `query_result.fulfillment_messages` field. If + # multiple default text responses exist, they will be concatenated when + # generating audio. If no default platform text responses exist, the + # generated audio content will be empty. + # + # In some scenarios, multiple output audio fields may be present in the + # response structure. In these cases, only the top-most-level audio output + # has content. + # @!attribute [rw] output_audio_config + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] + # The config used by the speech synthesizer to generate the output audio. + class DetectIntentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the parameters of the conversational query. + # @!attribute [rw] time_zone + # @return [::String] + # The time zone of this conversational query from the + # [time zone database](https://www.iana.org/time-zones), e.g., + # America/New_York, Europe/Paris. If not provided, the time zone specified in + # agent settings is used. + # @!attribute [rw] geo_location + # @return [::Google::Type::LatLng] + # The geo location of this conversational query. + # @!attribute [rw] contexts + # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] + # The collection of contexts to be activated before this query is + # executed. + # @!attribute [rw] reset_contexts + # @return [::Boolean] + # Specifies whether to delete all contexts in the current session + # before the new ones are activated. + # @!attribute [rw] session_entity_types + # @return [::Array<::Google::Cloud::Dialogflow::V2::SessionEntityType>] + # Additional session entity types to replace or extend developer + # entity types with. The entity synonyms apply to all languages and persist + # for the session of this query. + # @!attribute [rw] payload + # @return [::Google::Protobuf::Struct] + # This field can be used to pass custom data to your webhook. + # Arbitrary JSON objects are supported. + # If supplied, the value is used to populate the + # `WebhookRequest.original_detect_intent_request.payload` + # field sent to your webhook. + # @!attribute [rw] sentiment_analysis_request_config + # @return [::Google::Cloud::Dialogflow::V2::SentimentAnalysisRequestConfig] + # Configures the type of sentiment analysis to perform. If not + # provided, sentiment analysis is not performed. + # @!attribute [rw] webhook_headers + # @return [::Google::Protobuf::Map{::String => ::String}] + # This field can be used to pass HTTP headers for a webhook + # call. These headers will be sent to webhook along with the headers that + # have been configured through the Dialogflow web console. The headers + # defined within this field will overwrite the headers configured through the + # Dialogflow console if there is a conflict. Header names are + # case-insensitive. Google's specified headers are not allowed. Including: + # "Host", "Content-Length", "Connection", "From", "User-Agent", + # "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", + # etc. + # @!attribute [rw] platform + # @return [::String] + # The platform of the virtual agent response messages. + # + # If not empty, only emits messages from this platform in the response. + # Valid values are the enum names of + # {::Google::Cloud::Dialogflow::V2::Intent::Message#platform platform}. + class QueryParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class WebhookHeadersEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents the query input. It can contain either: + # + # 1. An audio config which instructs the speech recognizer how to process the + # speech audio. + # + # 2. A conversational query in the form of text. + # + # 3. An event that specifies which intent to trigger. + # @!attribute [rw] audio_config + # @return [::Google::Cloud::Dialogflow::V2::InputAudioConfig] + # Instructs the speech recognizer how to process the speech audio. + # + # Note: The following fields are mutually exclusive: `audio_config`, `text`, `event`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] text + # @return [::Google::Cloud::Dialogflow::V2::TextInput] + # The natural language text to be processed. Text length must not exceed + # 256 character for virtual agent interactions. + # + # Note: The following fields are mutually exclusive: `text`, `audio_config`, `event`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] event + # @return [::Google::Cloud::Dialogflow::V2::EventInput] + # The event to be processed. + # + # Note: The following fields are mutually exclusive: `event`, `audio_config`, `text`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class QueryInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the result of conversational query or event processing. + # @!attribute [rw] query_text + # @return [::String] + # The original conversational query text: + # + # - If natural language text was provided as input, `query_text` contains + # a copy of the input. + # - If natural language speech audio was provided as input, `query_text` + # contains the speech recognition result. If speech recognizer produced + # multiple alternatives, a particular one is picked. + # - If automatic spell correction is enabled, `query_text` will contain the + # corrected user input. + # @!attribute [rw] language_code + # @return [::String] + # The language that was triggered during intent detection. + # See [Language + # Support](https://cloud.google.com/dialogflow/docs/reference/language) + # for a list of the currently supported language codes. + # @!attribute [rw] speech_recognition_confidence + # @return [::Float] + # The Speech recognition confidence between 0.0 and 1.0. A higher number + # indicates an estimated greater likelihood that the recognized words are + # correct. The default of 0.0 is a sentinel value indicating that confidence + # was not set. + # + # This field is not guaranteed to be accurate or set. In particular this + # field isn't set for [StreamingDetectIntent][] since the streaming endpoint + # has separate confidence estimates per portion of the audio in + # StreamingRecognitionResult. + # @!attribute [rw] action + # @return [::String] + # The action name from the matched intent. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Struct] + # The collection of extracted parameters. + # + # Depending on your protocol or client library language, this is a + # map, associative array, symbol table, dictionary, or JSON object + # composed of a collection of (MapKey, MapValue) pairs: + # + # * MapKey type: string + # * MapKey value: parameter name + # * MapValue type: If parameter's entity type is a composite entity then use + # map, otherwise, depending on the parameter value type, it could be one of + # string, number, boolean, null, list or map. + # * MapValue value: If parameter's entity type is a composite entity then use + # map from composite entity property names to property values, otherwise, + # use parameter value. + # @!attribute [rw] all_required_params_present + # @return [::Boolean] + # This field is set to: + # + # - `false` if the matched intent has required parameters and not all of + # the required parameter values have been collected. + # - `true` if all required parameter values have been collected, or if the + # matched intent doesn't contain any required parameters. + # @!attribute [rw] cancels_slot_filling + # @return [::Boolean] + # Indicates whether the conversational query triggers a cancellation for slot + # filling. For more information, see the [cancel slot filling + # documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). + # @!attribute [rw] fulfillment_text + # @return [::String] + # The text to be pronounced to the user or shown on the screen. + # Note: This is a legacy field, `fulfillment_messages` should be preferred. + # @!attribute [rw] fulfillment_messages + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message>] + # The collection of rich messages to present to the user. + # @!attribute [rw] webhook_source + # @return [::String] + # If the query was fulfilled by a webhook call, this field is set to the + # value of the `source` field returned in the webhook response. + # @!attribute [rw] webhook_payload + # @return [::Google::Protobuf::Struct] + # If the query was fulfilled by a webhook call, this field is set to the + # value of the `payload` field returned in the webhook response. + # @!attribute [rw] output_contexts + # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] + # The collection of output contexts. If applicable, + # `output_contexts.parameters` contains entries with name + # `.original` containing the original parameter values + # before the query. + # @!attribute [rw] intent + # @return [::Google::Cloud::Dialogflow::V2::Intent] + # The intent that matched the conversational query. Some, not + # all fields are filled in this message, including but not limited to: + # `name`, `display_name`, `end_interaction` and `is_fallback`. + # @!attribute [rw] intent_detection_confidence + # @return [::Float] + # The intent detection confidence. Values range from 0.0 + # (completely uncertain) to 1.0 (completely certain). + # This value is for informational purpose only and is only used to + # help match the best intent within the classification threshold. + # This value may change for the same end-user expression at any time due to a + # model retraining or change in implementation. + # If there are `multiple knowledge_answers` messages, this value is set to + # the greatest `knowledgeAnswers.match_confidence` value in the list. + # @!attribute [rw] diagnostic_info + # @return [::Google::Protobuf::Struct] + # Free-form diagnostic information for the associated detect intent request. + # The fields of this data can change without notice, so you should not write + # code that depends on its structure. + # The data may contain: + # + # - webhook call latency + # - webhook errors + # @!attribute [rw] sentiment_analysis_result + # @return [::Google::Cloud::Dialogflow::V2::SentimentAnalysisResult] + # The sentiment analysis result, which depends on the + # `sentiment_analysis_request_config` specified in the request. + class QueryResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message sent by the client to the + # [StreamingDetectIntent][] method. + # + # Multiple request messages should be sent in order: + # + # 1. The first message must contain + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#session session}, + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_input query_input} + # plus optionally + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_params query_params}. + # If the client wants to receive an audio response, it should also contain + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config}. + # The message must not contain + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio input_audio}. + # 2. If + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_input query_input} + # was set to + # {::Google::Cloud::Dialogflow::V2::InputAudioConfig query_input.audio_config}, + # all subsequent messages must contain + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio input_audio} + # to continue with Speech recognition. If you decide to rather detect an + # intent from text input after you already started Speech recognition, + # please send a message with + # {::Google::Cloud::Dialogflow::V2::QueryInput#text query_input.text}. + # + # However, note that: + # + # * Dialogflow will bill you for the audio duration so far. + # * Dialogflow discards all Speech recognition results in favor of the + # input text. + # * Dialogflow will use the language code from the first message. + # + # After you sent all input, you must half-close or abort the request stream. + # @!attribute [rw] session + # @return [::String] + # Required. The name of the session the query is sent to. + # Format of the session name: + # `projects//agent/sessions/`, or + # `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume + # default 'draft' environment. If `User ID` is not specified, we are using + # "-". It's up to the API caller to choose an appropriate `Session ID` and + # `User Id`. They can be a random number or some type of user and session + # identifiers (preferably hashed). The length of the `Session ID` and + # `User ID` must not exceed 36 characters. + # + # For more information, see the [API interactions + # guide](https://cloud.google.com/dialogflow/docs/api-overview). + # + # Note: Always use agent versions for production traffic. + # See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # @!attribute [rw] query_params + # @return [::Google::Cloud::Dialogflow::V2::QueryParameters] + # The parameters of this query. + # @!attribute [rw] query_input + # @return [::Google::Cloud::Dialogflow::V2::QueryInput] + # Required. The input specification. It can be set to: + # + # 1. an audio config which instructs the speech recognizer how to process + # the speech audio, + # + # 2. a conversational query in the form of text, or + # + # 3. an event that specifies which intent to trigger. + # @!attribute [rw] single_utterance + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Please use + # {::Google::Cloud::Dialogflow::V2::InputAudioConfig#single_utterance InputAudioConfig.single_utterance} + # instead. If `false` (default), recognition does not cease until the client + # closes the stream. If `true`, the recognizer will detect a single spoken + # utterance in input audio. Recognition ceases when it detects the audio's + # voice has stopped or paused. In this case, once a detected intent is + # received, the client should close the stream and start a new request with a + # new stream as needed. This setting is ignored when `query_input` is a piece + # of text or an event. + # @!attribute [rw] output_audio_config + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] + # Instructs the speech synthesizer how to generate the output + # audio. If this field is not set and agent-level speech synthesizer is not + # configured, no output audio is generated. + # @!attribute [rw] output_audio_config_mask + # @return [::Google::Protobuf::FieldMask] + # Mask for + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config} + # indicating which settings in this request-level config should override + # speech synthesizer settings defined at agent-level. + # + # If unspecified or empty, + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config} + # replaces the agent-level config in its entirety. + # @!attribute [rw] input_audio + # @return [::String] + # The input audio content to be recognized. Must be sent if + # `query_input` was set to a streaming input audio config. The complete audio + # over all streaming messages must not exceed 1 minute. + # @!attribute [rw] enable_debugging_info + # @return [::Boolean] + # if true, `StreamingDetectIntentResponse.debugging_info` will get populated. + class StreamingDetectIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Cloud conversation info for easier debugging. + # It will get populated in `StreamingDetectIntentResponse` or + # `StreamingAnalyzeContentResponse` when the flag `enable_debugging_info` is + # set to true in corresponding requests. + # @!attribute [rw] audio_data_chunks + # @return [::Integer] + # Number of input audio data chunks in streaming requests. + # @!attribute [rw] result_end_time_offset + # @return [::Google::Protobuf::Duration] + # Time offset of the end of speech utterance relative to the + # beginning of the first audio chunk. + # @!attribute [rw] first_audio_duration + # @return [::Google::Protobuf::Duration] + # Duration of first audio chunk. + # @!attribute [rw] single_utterance + # @return [::Boolean] + # Whether client used single utterance mode. + # @!attribute [rw] speech_partial_results_end_times + # @return [::Array<::Google::Protobuf::Duration>] + # Time offsets of the speech partial results relative to the beginning of + # the stream. + # @!attribute [rw] speech_final_results_end_times + # @return [::Array<::Google::Protobuf::Duration>] + # Time offsets of the speech final results (is_final=true) relative to the + # beginning of the stream. + # @!attribute [rw] partial_responses + # @return [::Integer] + # Total number of partial responses. + # @!attribute [rw] speaker_id_passive_latency_ms_offset + # @return [::Integer] + # Time offset of Speaker ID stream close time relative to the Speech stream + # close time in milliseconds. Only meaningful for conversations involving + # passive verification. + # @!attribute [rw] bargein_event_triggered + # @return [::Boolean] + # Whether a barge-in event is triggered in this request. + # @!attribute [rw] speech_single_utterance + # @return [::Boolean] + # Whether speech uses single utterance mode. + # @!attribute [rw] dtmf_partial_results_times + # @return [::Array<::Google::Protobuf::Duration>] + # Time offsets of the DTMF partial results relative to the beginning of + # the stream. + # @!attribute [rw] dtmf_final_results_times + # @return [::Array<::Google::Protobuf::Duration>] + # Time offsets of the DTMF final results relative to the beginning of + # the stream. + # @!attribute [rw] single_utterance_end_time_offset + # @return [::Google::Protobuf::Duration] + # Time offset of the end-of-single-utterance signal relative to the + # beginning of the stream. + # @!attribute [rw] no_speech_timeout + # @return [::Google::Protobuf::Duration] + # No speech timeout settings for the stream. + # @!attribute [rw] endpointing_timeout + # @return [::Google::Protobuf::Duration] + # Speech endpointing timeout settings for the stream. + # @!attribute [rw] is_input_text + # @return [::Boolean] + # Whether the streaming terminates with an injected text query. + # @!attribute [rw] client_half_close_time_offset + # @return [::Google::Protobuf::Duration] + # Client half close time in terms of input audio duration. + # @!attribute [rw] client_half_close_streaming_time_offset + # @return [::Google::Protobuf::Duration] + # Client half close time in terms of API streaming duration. + class CloudConversationDebuggingInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message returned from the + # [StreamingDetectIntent][] method. + # + # Multiple response messages can be returned in order: + # + # 1. If the + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio StreamingDetectIntentRequest.input_audio} + # field was + # set, the `recognition_result` field is populated for one + # or more messages. + # See the + # {::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult StreamingRecognitionResult} + # message for details about the result message sequence. + # + # 2. The next message contains `response_id`, `query_result` + # and optionally `webhook_status` if a WebHook was called. + # @!attribute [rw] response_id + # @return [::String] + # The unique identifier of the response. It can be used to + # locate a response in the training example set or for reporting issues. + # @!attribute [rw] recognition_result + # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult] + # The result of speech recognition. + # @!attribute [rw] query_result + # @return [::Google::Cloud::Dialogflow::V2::QueryResult] + # The result of the conversational query or event processing. + # @!attribute [rw] webhook_status + # @return [::Google::Rpc::Status] + # Specifies the status of the webhook request. + # @!attribute [rw] output_audio + # @return [::String] + # The audio data bytes encoded as specified in the request. + # Note: The output audio is generated based on the values of default platform + # text responses found in the `query_result.fulfillment_messages` field. If + # multiple default text responses exist, they will be concatenated when + # generating audio. If no default platform text responses exist, the + # generated audio content will be empty. + # + # In some scenarios, multiple output audio fields may be present in the + # response structure. In these cases, only the top-most-level audio output + # has content. + # @!attribute [rw] output_audio_config + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] + # The config used by the speech synthesizer to generate the output audio. + # @!attribute [rw] debugging_info + # @return [::Google::Cloud::Dialogflow::V2::CloudConversationDebuggingInfo] + # Debugging info that would get populated when + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#enable_debugging_info StreamingDetectIntentRequest.enable_debugging_info} + # is set to true. + class StreamingDetectIntentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains a speech recognition result corresponding to a portion of the audio + # that is currently being processed or an indication that this is the end + # of the single requested utterance. + # + # While end-user audio is being processed, Dialogflow sends a series of + # results. Each result may contain a `transcript` value. A transcript + # represents a portion of the utterance. While the recognizer is processing + # audio, transcript values may be interim values or finalized values. + # Once a transcript is finalized, the `is_final` value is set to true and + # processing continues for the next transcript. + # + # If `StreamingDetectIntentRequest.query_input.audio_config.single_utterance` + # was true, and the recognizer has completed processing audio, + # the `message_type` value is set to `END_OF_SINGLE_UTTERANCE and the + # following (last) result contains the last finalized transcript. + # + # The complete end-user utterance is determined by concatenating the + # finalized transcript values received for the series of results. + # + # In the following example, single utterance is enabled. In the case where + # single utterance is not enabled, result 8 would not occur. + # + # ``` + # Num | transcript | message_type | is_final + # --- | ------------------------ | ----------------------- | -------- + # 1 | "tube" | TRANSCRIPT | false + # 2 | "to be a" | TRANSCRIPT | false + # 3 | "to be" | TRANSCRIPT | false + # 4 | "to be or not to be" | TRANSCRIPT | true + # 5 | "that's" | TRANSCRIPT | false + # 6 | "that is | TRANSCRIPT | false + # 7 | " that is the question" | TRANSCRIPT | true + # 8 | unset | END_OF_SINGLE_UTTERANCE | unset + # 9 | ". Whether 'tis nobler" | TRANSCRIPT | true + # 10 | " in the mind" | TRANSCRIPT | false + # 11 | " in the mind to suffer" | TRANSCRIPT | true + # ``` + # + # Concatenating the finalized transcripts with `is_final` set to true, + # the complete utterance becomes "to be or not to be that is the question". + # @!attribute [rw] message_type + # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult::MessageType] + # Type of the result message. + # @!attribute [rw] transcript + # @return [::String] + # Transcript text representing the words that the user spoke. + # Populated if and only if `message_type` = `TRANSCRIPT`. + # @!attribute [rw] is_final + # @return [::Boolean] + # If `false`, the `StreamingRecognitionResult` represents an + # interim result that may change. If `true`, the recognizer will not return + # any further hypotheses about this piece of the audio. May only be populated + # for `message_type` = `TRANSCRIPT`. + # @!attribute [rw] confidence + # @return [::Float] + # The Speech confidence between 0.0 and 1.0 for the current portion of audio. + # A higher number indicates an estimated greater likelihood that the + # recognized words are correct. The default of 0.0 is a sentinel value + # indicating that confidence was not set. + # + # This field is typically only provided if `is_final` is true and you should + # not rely on it being accurate or even set. + # @!attribute [rw] speech_word_info + # @return [::Array<::Google::Cloud::Dialogflow::V2::SpeechWordInfo>] + # Word-specific information for the words recognized by Speech in + # {::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult#transcript transcript}. + # Populated if and only if `message_type` = `TRANSCRIPT` and + # [InputAudioConfig.enable_word_info] is set. + # @!attribute [rw] speech_end_offset + # @return [::Google::Protobuf::Duration] + # Time offset of the end of this Speech recognition result relative to the + # beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. + # @!attribute [rw] language_code + # @return [::String] + # Detected language code for the transcript. + class StreamingRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the response message. + module MessageType + # Not specified. Should never be used. + MESSAGE_TYPE_UNSPECIFIED = 0 + + # Message contains a (possibly partial) transcript. + TRANSCRIPT = 1 + + # This event indicates that the server has detected the end of the user's + # speech utterance and expects no additional inputs. + # Therefore, the server will not process additional audio (although it may + # subsequently return additional results). The client should stop sending + # additional audio data, half-close the gRPC connection, and wait for any + # additional results until the server closes the gRPC connection. This + # message is only sent if `single_utterance` was set to `true`, and is not + # used otherwise. + END_OF_SINGLE_UTTERANCE = 2 + end + end + + # Auxiliary proto messages. + # + # Represents the natural language text to be processed. + # @!attribute [rw] text + # @return [::String] + # Required. The UTF-8 encoded natural language text to be processed. + # Text length must not exceed 256 characters for virtual agent interactions. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language of this conversational query. See [Language + # Support](https://cloud.google.com/dialogflow/docs/reference/language) + # for a list of the currently supported language codes. Note that queries in + # the same session do not necessarily need to specify the same language. + class TextInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Events allow for matching intents by event name instead of the natural + # language input. For instance, input `` can trigger a personalized welcome response. + # The parameter `name` may be used by the agent in the response: + # `"Hello #welcome_event.name! What can I do for you today?"`. + # @!attribute [rw] name + # @return [::String] + # Required. The unique identifier of the event. + # @!attribute [rw] parameters + # @return [::Google::Protobuf::Struct] + # The collection of parameters associated with the event. + # + # Depending on your protocol or client library language, this is a + # map, associative array, symbol table, dictionary, or JSON object + # composed of a collection of (MapKey, MapValue) pairs: + # + # * MapKey type: string + # * MapKey value: parameter name + # * MapValue type: If parameter's entity type is a composite entity then use + # map, otherwise, depending on the parameter value type, it could be one of + # string, number, boolean, null, list or map. + # * MapValue value: If parameter's entity type is a composite entity then use + # map from composite entity property names to property values, otherwise, + # use parameter value. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language of this query. See [Language + # Support](https://cloud.google.com/dialogflow/docs/reference/language) + # for a list of the currently supported language codes. Note that queries in + # the same session do not necessarily need to specify the same language. + # + # This field is ignored when used in the context of a + # {::Google::Cloud::Dialogflow::V2::WebhookResponse#followup_event_input WebhookResponse.followup_event_input} + # field, because the language was already defined in the originating detect + # intent request. + class EventInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configures the types of sentiment analysis to perform. + # @!attribute [rw] analyze_query_text_sentiment + # @return [::Boolean] + # Instructs the service to perform sentiment analysis on + # `query_text`. If not provided, sentiment analysis is not performed on + # `query_text`. + class SentimentAnalysisRequestConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The result of sentiment analysis. Sentiment analysis inspects user input + # and identifies the prevailing subjective opinion, especially to determine a + # user's attitude as positive, negative, or neutral. + # For [DetectIntent][], it needs to be configured in + # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#query_params DetectIntentRequest.query_params}. + # For [StreamingDetectIntent][], it needs to be configured in + # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_params StreamingDetectIntentRequest.query_params}. + # And for + # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} + # and + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent}, + # it needs to be configured in + # {::Google::Cloud::Dialogflow::V2::ConversationProfile#human_agent_assistant_config ConversationProfile.human_agent_assistant_config} + # @!attribute [rw] query_text_sentiment + # @return [::Google::Cloud::Dialogflow::V2::Sentiment] + # The sentiment analysis result for `query_text`. + class SentimentAnalysisResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The sentiment, such as positive/negative feeling or association, for a unit + # of analysis, such as the query text. See: + # https://cloud.google.com/natural-language/docs/basics#interpreting_sentiment_analysis_values + # for how to interpret the result. + # @!attribute [rw] score + # @return [::Float] + # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + # sentiment). + # @!attribute [rw] magnitude + # @return [::Float] + # A non-negative number in the [0, +inf) range, which represents the absolute + # magnitude of sentiment, regardless of score (positive or negative). + class Sentiment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb new file mode 100644 index 000000000000..0869b91564a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session_entity_type.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 Dialogflow + module V2 + # A session represents a conversation between a Dialogflow agent and an + # end-user. You can create special entities, called session entities, during a + # session. Session entities can extend or replace custom entity types and only + # exist during the session that they were created for. All session data, + # including session entities, is stored by Dialogflow for 20 minutes. + # + # For more information, see the [session entity + # guide](https://cloud.google.com/dialogflow/docs/entities-session). + # @!attribute [rw] name + # @return [::String] + # Required. The unique identifier of this session entity type. Format: + # `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # + # `` must be the display name of an existing entity + # type in the same agent that will be overridden or supplemented. + # @!attribute [rw] entity_override_mode + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType::EntityOverrideMode] + # Required. Indicates whether the additional data should override or + # supplement the custom entity type definition. + # @!attribute [rw] entities + # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity>] + # Required. The collection of entities associated with this session entity + # type. + class SessionEntityType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The types of modifications for a session entity type. + module EntityOverrideMode + # Not specified. This value should be never used. + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0 + + # The collection of session entities overrides the collection of entities + # in the corresponding custom entity type. + ENTITY_OVERRIDE_MODE_OVERRIDE = 1 + + # The collection of session entities extends the collection of entities in + # the corresponding custom entity type. + # + # Note: Even in this override mode calls to `ListSessionEntityTypes`, + # `GetSessionEntityType`, `CreateSessionEntityType` and + # `UpdateSessionEntityType` only return the additional entities added in + # this session entity type. If you want to get the supplemented list, + # please call + # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#get_entity_type EntityTypes.GetEntityType} + # on the custom entity type and merge. + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types SessionEntityTypes.ListSessionEntityTypes}. + # @!attribute [rw] parent + # @return [::String] + # Required. The session to list all session entity types from. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users// + # sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListSessionEntityTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types SessionEntityTypes.ListSessionEntityTypes}. + # @!attribute [rw] session_entity_types + # @return [::Array<::Google::Cloud::Dialogflow::V2::SessionEntityType>] + # The list of session entity types. There will be a maximum number of items + # returned based on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListSessionEntityTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#get_session_entity_type SessionEntityTypes.GetSessionEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the session entity type. Format: + # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + class GetSessionEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#create_session_entity_type SessionEntityTypes.CreateSessionEntityType}. + # @!attribute [rw] parent + # @return [::String] + # Required. The session to create a session entity type for. + # Format: `projects//agent/sessions/` or + # `projects//agent/environments//users// + # sessions/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + # @!attribute [rw] session_entity_type + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # Required. The session entity type to create. + class CreateSessionEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#update_session_entity_type SessionEntityTypes.UpdateSessionEntityType}. + # @!attribute [rw] session_entity_type + # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] + # Required. The session entity type to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields get updated. + class UpdateSessionEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#delete_session_entity_type SessionEntityTypes.DeleteSessionEntityType}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the entity type to delete. Format: + # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + # If `Environment ID` is not specified, we assume default 'draft' + # environment. If `User ID` is not specified, we assume default '-' user. + class DeleteSessionEntityTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/sip_trunk.rb new file mode 100644 index 000000000000..9cbbcb689362 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/sip_trunk.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! + + +module Google + module Cloud + module Dialogflow + module V2 + # The request message for + # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#create_sip_trunk SipTrunks.CreateSipTrunk}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location to create a SIP trunk for. + # Format: `projects//locations/`. + # @!attribute [rw] sip_trunk + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # Required. The SIP trunk to create. + class CreateSipTrunkRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#delete_sip_trunk SipTrunks.DeleteSipTrunk}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the SIP trunk to delete. + # Format: `projects//locations//sipTrunks/`. + class DeleteSipTrunkRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#list_sip_trunks SipTrunks.ListSipTrunks}. + # @!attribute [rw] parent + # @return [::String] + # Required. The location to list SIP trunks from. + # Format: `projects//locations/`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListSipTrunksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#list_sip_trunks SipTrunks.ListSipTrunks}. + # @!attribute [rw] sip_trunks + # @return [::Array<::Google::Cloud::Dialogflow::V2::SipTrunk>] + # The list of SIP trunks. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListSipTrunksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#get_sip_trunk SipTrunks.GetSipTrunk}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the SIP trunk to delete. + # Format: `projects//locations//sipTrunks/`. + class GetSipTrunkRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#update_sip_trunk SipTrunks.UpdateSipTrunk}. + # @!attribute [rw] sip_trunk + # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] + # Required. The SipTrunk to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The mask to control which fields get updated. If the mask is not + # present, all fields will be updated. + class UpdateSipTrunkRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # SipTrunk is the resource that represents a SIP trunk to connect to Google + # Telephony platform SIP trunking service. + # @!attribute [rw] name + # @return [::String] + # Identifier. The unique identifier of the SIP trunk. + # Format: `projects//locations//sipTrunks/`. + # @!attribute [rw] expected_hostname + # @return [::Array<::String>] + # Required. The expected hostnames in the peer certificate from partner that + # is used for TLS authentication. + # @!attribute [r] connections + # @return [::Array<::Google::Cloud::Dialogflow::V2::Connection>] + # Output only. Connections of the SIP trunk. + # @!attribute [rw] display_name + # @return [::String] + # Optional. Human readable alias for this trunk. + class SipTrunk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a connection for SIP Trunk. + # @!attribute [r] connection_id + # @return [::String] + # Output only. The unique identifier of the SIP Trunk connection. + # @!attribute [r] state + # @return [::Google::Cloud::Dialogflow::V2::Connection::State] + # Output only. State of the connection. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the connection status changed. + # @!attribute [r] error_details + # @return [::Google::Cloud::Dialogflow::V2::Connection::ErrorDetails] + # Output only. The error details for the connection. Only populated when + # authentication errors occur. + class Connection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The error details of Sip Trunk connection authentication. + # @!attribute [r] certificate_state + # @return [::Google::Cloud::Dialogflow::V2::Connection::CertificateState] + # Output only. The status of the certificate authentication. + # @!attribute [rw] error_message + # @return [::String] + # The error message provided from SIP trunking auth service + class ErrorDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The state of Sip Trunk connection. + module State + # SIP Trunk connection state is Not specified. + STATE_UNSPECIFIED = 0 + + # SIP Trunk connection is connected. + CONNECTED = 1 + + # SIP Trunk connection is disconnected. + DISCONNECTED = 2 + + # SIP Trunk connection has authentication error. + AUTHENTICATION_FAILED = 3 + + # SIP Trunk connection is keepalive. + KEEPALIVE = 4 + end + + # The state of Sip Trunk certificate authentication. + module CertificateState + # Certificate state is not specified. + CERTIFICATE_STATE_UNSPECIFIED = 0 + + # Certificate is valid. + CERTIFICATE_VALID = 1 + + # Catch all for any error not specified. + CERTIFICATE_INVALID = 2 + + # Certificate leaf node has expired. + CERTIFICATE_EXPIRED = 3 + + # There is no hostname defined to authenticate in SipTrunkingServer. + CERTIFICATE_HOSTNAME_NOT_FOUND = 4 + + # No path found from the leaf certificate to any root. + CERTIFICATE_UNAUTHENTICATED = 5 + + # Trust store does not exist. + CERTIFICATE_TRUST_STORE_NOT_FOUND = 6 + + # Hostname has invalid format. + CERTIFICATE_HOSTNAME_INVALID_FORMAT = 7 + + # Certificate has exhausted its quota. + CERTIFICATE_QUOTA_EXCEEDED = 8 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool.rb new file mode 100644 index 000000000000..236a71e701c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool.rb @@ -0,0 +1,552 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Request message of CreateTool. + # @!attribute [rw] parent + # @return [::String] + # Required. The project/location to create tool for. Format: + # `projects//locations/` + # @!attribute [rw] tool + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # Required. The tool to create. + # @!attribute [rw] tool_id + # @return [::String] + # Optional. The ID to use for the tool, which will become the final + # component of the tool's resource name. + # + # The tool ID must be compliant with the regression formula + # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. + # If the field is not provide, an Id will be auto-generated. + # If the field is provided, the caller is responsible for + # 1. the uniqueness of the ID, otherwise the request will be rejected. + # 2. the consistency for whether to use custom ID or not under a project to + # better ensure uniqueness. + class CreateToolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message of GetTool. + # @!attribute [rw] name + # @return [::String] + # Required. The tool resource name to retrieve. Format: + # `projects//locations//tools/` + class GetToolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message of ListTools. + # @!attribute [rw] parent + # @return [::String] + # Required. The project/location to list tools for. Format: + # `projects//locations/` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of conversation models to return in a single page. + # Default to 10. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListToolsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of ListTools. + # @!attribute [rw] tools + # @return [::Array<::Google::Cloud::Dialogflow::V2::Tool>] + # List of tools retrieved. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListToolsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request of DeleteTool. + # @!attribute [rw] name + # @return [::String] + # Required. The tool resource name to delete. Format: + # `projects//locations//tools/` + class DeleteToolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request of UpdateTool. + # @!attribute [rw] tool + # @return [::Google::Cloud::Dialogflow::V2::Tool] + # Required. The tool to update. + # The name field of tool is to identify the tool to + # update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The list of fields to update. + class UpdateToolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a tool. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The resource name of the tool. Format: + # `projects//locations//tools/`. + # @!attribute [rw] tool_key + # @return [::String] + # Required. A human readable short name of the tool, which should be unique + # within the project. It should only contain letters, numbers, and + # underscores, and it will be used by LLM to identify the tool. + # @!attribute [rw] display_name + # @return [::String] + # Optional. A human readable short name of the tool, to be shown on the UI. + # @!attribute [rw] description + # @return [::String] + # Optional. A human readable description of the tool. + # @!attribute [rw] action_confirmation_requirement + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement}] + # Optional. Confirmation requirement for the actions. Each key is an action + # name in the action_schemas. If an action's confirmation requirement is + # unspecified (either the key is not present, or its value is + # CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the + # action's method_type - confirmation is not required if and only if + # method_type is GET. + # @!attribute [rw] extension_spec + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::Dialogflow::V2::Tool::ExtensionTool] + # Vertex extension tool specification. + # + # Note: The following fields are mutually exclusive: `extension_spec`, `function_spec`, `connector_spec`, `open_api_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] function_spec + # @return [::Google::Cloud::Dialogflow::V2::Tool::FunctionTool] + # Client side executed function specification. + # + # Note: The following fields are mutually exclusive: `function_spec`, `extension_spec`, `connector_spec`, `open_api_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] connector_spec + # @return [::Google::Cloud::Dialogflow::V2::Tool::ConnectorTool] + # Integration connectors tool specification. + # + # Note: The following fields are mutually exclusive: `connector_spec`, `extension_spec`, `function_spec`, `open_api_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] open_api_spec + # @return [::Google::Cloud::Dialogflow::V2::Tool::OpenApiTool] + # OpenAPI tool. + # + # Note: The following fields are mutually exclusive: `open_api_spec`, `extension_spec`, `function_spec`, `connector_spec`. 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. Creation time of this tool. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update time of this tool. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. A read only boolean field reflecting Zone Separation + # status of the tool. If the field is absent, it means the status is unknown. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. A read only boolean field reflecting Zone Isolation status + # of the tool. If the field is absent, it means the status is unknown. + class Tool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An ExtensionTool is a way to use Vertex Extensions as a tool. + # @!attribute [rw] name + # @return [::String] + # Required. The full name of the referenced vertex extension. + # Format: + # `projects/{project}/locations/{location}/extensions/{extension}` + class ExtensionTool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Function tool describes the functions to be invoked on the client side. + # @!attribute [rw] input_schema + # @return [::Google::Protobuf::Struct] + # Optional. The JSON schema is encapsulated in a + # {::Google::Protobuf::Struct google.protobuf.Struct} to describe the input of + # the function. This input is a JSON object that contains the function's + # parameters as properties of the object. + # @!attribute [rw] output_schema + # @return [::Google::Protobuf::Struct] + # Optional. The JSON schema is encapsulated in a + # {::Google::Protobuf::Struct google.protobuf.Struct} to describe the output + # of the function. This output is a JSON object that contains the + # function's parameters as properties of the object. + # @!attribute [rw] method_type + # @return [::Google::Cloud::Dialogflow::V2::Tool::MethodType] + # Optional. The method type of the function. If not specified, the default + # value is GET. + class FunctionTool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An OpenAPI tool is a way to provide the Tool specifications in the Open API + # schema format. + # @!attribute [rw] text_schema + # @return [::String] + # Required. The OpenAPI schema specified as a text. + # @!attribute [rw] authentication + # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication] + # Optional. Authentication information required by the API. + # @!attribute [rw] tls_config + # @return [::Google::Cloud::Dialogflow::V2::Tool::TLSConfig] + # Optional. TLS configuration for the HTTPS verification. + # @!attribute [rw] service_directory_config + # @return [::Google::Cloud::Dialogflow::V2::Tool::ServiceDirectoryConfig] + # Optional. Service Directory configuration. + class OpenApiTool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A ConnectorTool enabling using Integration Connectors Connections as tools. + # @!attribute [rw] name + # @return [::String] + # Required. The full resource name of the referenced Integration Connectors + # Connection. Format: 'projects/*/locations/*/connections/*' + # @!attribute [rw] actions + # @return [::Array<::Google::Cloud::Dialogflow::V2::Tool::ConnectorTool::Action>] + # Required. Actions for the tool to use. + class ConnectorTool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration of a Connection operation for the tool to use. + # @!attribute [rw] connection_action_id + # @return [::String] + # ID of a Connection action for the tool to use. + # + # Note: The following fields are mutually exclusive: `connection_action_id`, `entity_operation`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] entity_operation + # @return [::Google::Cloud::Dialogflow::V2::Tool::ConnectorTool::Action::EntityOperation] + # Entity operation configuration for the tool to use. + # + # Note: The following fields are mutually exclusive: `entity_operation`, `connection_action_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] input_fields + # @return [::Array<::String>] + # Optional. Entity fields to use as inputs for the operation. + # If no fields are specified, all fields of the Entity will be used. + # @!attribute [rw] output_fields + # @return [::Array<::String>] + # Optional. Entity fields to return from the operation. + # If no fields are specified, all fields of the Entity will be returned. + class Action + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Entity CRUD operation specification. + # @!attribute [rw] entity_id + # @return [::String] + # Required. ID of the entity. + # @!attribute [rw] operation + # @return [::Google::Cloud::Dialogflow::V2::Tool::ConnectorTool::Action::EntityOperation::OperationType] + # Required. Operation to perform on the entity. + class EntityOperation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The operation to perform on the entity. + module OperationType + # Operation type unspecified. Invalid, ConnectorTool create/update + # will fail. + OPERATION_TYPE_UNSPECIFIED = 0 + + # List operation. + LIST = 1 + + # Get operation. + GET = 2 + + # Create operation. + CREATE = 3 + + # Update operation. + UPDATE = 4 + + # Delete operation. + DELETE = 5 + end + end + end + end + + # Authentication information required for API calls + # @!attribute [rw] api_key_config + # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::ApiKeyConfig] + # Config for API key auth. + # + # Note: The following fields are mutually exclusive: `api_key_config`, `oauth_config`, `service_agent_auth_config`, `bearer_token_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oauth_config + # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::OAuthConfig] + # Config for OAuth. + # + # Note: The following fields are mutually exclusive: `oauth_config`, `api_key_config`, `service_agent_auth_config`, `bearer_token_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] service_agent_auth_config + # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::ServiceAgentAuthConfig] + # Config for [Diglogflow service + # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent) + # auth. + # + # Note: The following fields are mutually exclusive: `service_agent_auth_config`, `api_key_config`, `oauth_config`, `bearer_token_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bearer_token_config + # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::BearerTokenConfig] + # Config for bearer token auth. + # + # Note: The following fields are mutually exclusive: `bearer_token_config`, `api_key_config`, `oauth_config`, `service_agent_auth_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Authentication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Config for authentication with API key. + # @!attribute [rw] key_name + # @return [::String] + # Required. The parameter name or the header name of the API key. + # E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. + # @!attribute [rw] api_key + # @return [::String] + # Optional. The API key. If the `secret_version_for_api_key` field is + # set, this field will be ignored. + # @!attribute [rw] secret_version_for_api_key + # @return [::String] + # Optional. The name of the SecretManager secret version resource storing + # the API key. If this field is set, the `api_key` field will be ignored. + # Format: `projects/{project}/secrets/{secret}/versions/{version}` + # @!attribute [rw] request_location + # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::RequestLocation] + # Required. Key location in the request. + class ApiKeyConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Config for authentication with OAuth. + # @!attribute [rw] oauth_grant_type + # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::OAuthConfig::OauthGrantType] + # Required. OAuth grant types. + # @!attribute [rw] client_id + # @return [::String] + # Required. The client ID from the OAuth provider. + # @!attribute [rw] client_secret + # @return [::String] + # Optional. The client secret from the OAuth provider. If the + # `secret_version_for_client_secret` field is set, this field will be + # ignored. + # @!attribute [rw] secret_version_for_client_secret + # @return [::String] + # Optional. The name of the SecretManager secret version resource storing + # the client secret. If this field is set, the `client_secret` field will + # be ignored. Format: + # `projects/{project}/secrets/{secret}/versions/{version}` + # @!attribute [rw] token_endpoint + # @return [::String] + # Required. The token endpoint in the OAuth provider to exchange for an + # access token. + # @!attribute [rw] scopes + # @return [::Array<::String>] + # Optional. The OAuth scopes to grant. + class OAuthConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # OAuth grant types. Only [client credential + # grant](https://oauth.net/2/grant-types/client-credentials) is + # supported. + module OauthGrantType + # Default value. This value is unused. + OAUTH_GRANT_TYPE_UNSPECIFIED = 0 + + # Represents the [client credential + # flow](https://oauth.net/2/grant-types/client-credentials). + CLIENT_CREDENTIAL = 1 + end + end + + # Config for auth using [Dialogflow service + # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + # @!attribute [rw] service_agent_auth + # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::ServiceAgentAuthConfig::ServiceAgentAuth] + # Optional. Indicate the auth token type generated from the [Diglogflow + # service + # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + # The generated token is sent in the Authorization header. + class ServiceAgentAuthConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicate the auth token type generated from the [Diaglogflow service + # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). + module ServiceAgentAuth + # Service agent auth type unspecified. Default to ID_TOKEN. + SERVICE_AGENT_AUTH_UNSPECIFIED = 0 + + # Use [ID + # token](https://cloud.google.com/docs/authentication/token-types#id) + # generated from service agent. This can be used to access Cloud + # Function and Cloud Run after you grant Invoker role to + # `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ID_TOKEN = 1 + + # Use [access + # token](https://cloud.google.com/docs/authentication/token-types#access) + # generated from service agent. This can be used to access other Google + # Cloud APIs after you grant required roles to + # `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. + ACCESS_TOKEN = 2 + end + end + + # Config for authentication using bearer token. + # @!attribute [rw] token + # @return [::String] + # Optional. The text token appended to the text `Bearer` to the request + # Authorization header. + # [Session parameters + # reference](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#session-ref) + # can be used to pass the token dynamically, e.g. + # `$session.params.parameter-id`. + # @!attribute [rw] secret_version_for_token + # @return [::String] + # Optional. The name of the SecretManager secret version resource storing + # the Bearer token. If this field is set, the `token` field will be + # ignored. Format: + # `projects/{project}/secrets/{secret}/versions/{version}` + class BearerTokenConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The location of the API key in the request. + module RequestLocation + # Default value. This value is unused. + REQUEST_LOCATION_UNSPECIFIED = 0 + + # Represents the key in http header. + HEADER = 1 + + # Represents the key in query string. + QUERY_STRING = 2 + end + end + + # The TLS configuration. + # @!attribute [rw] ca_certs + # @return [::Array<::Google::Cloud::Dialogflow::V2::Tool::TLSConfig::CACert>] + # Required. Specifies a list of allowed custom CA certificates for HTTPS + # verification. + class TLSConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The CA certificate. + # @!attribute [rw] display_name + # @return [::String] + # Required. The name of the allowed custom CA certificates. This + # can be used to disambiguate the custom CA certificates. + # @!attribute [rw] cert + # @return [::String] + # Required. The allowed custom CA certificates (in DER format) for + # HTTPS verification. This overrides the default SSL trust store. If this + # is empty or unspecified, Dialogflow will use Google's default trust + # store to verify certificates. N.B. Make sure the HTTPS server + # certificates are signed with "subject alt name". For instance a + # certificate can be self-signed using the following command, + # ``` + # openssl x509 -req -days 200 -in example.com.csr \ + # -signkey example.com.key \ + # -out example.com.crt \ + # -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") + # ``` + class CACert + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Configuration for tools using Service Directory. + # @!attribute [rw] service + # @return [::String] + # Required. The name of [Service + # Directory](https://cloud.google.com/service-directory) service. + # Format: + # `projects//locations//namespaces//services/`. + # `LocationID` of the service directory must be the same as the location + # of the tool. + class ServiceDirectoryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement] + class ActionConfirmationRequirementEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Types of confirmation requirement. + module ConfirmationRequirement + # Unspecified. Whether the action requires confirmation is inferred from + # method_type. + CONFIRMATION_REQUIREMENT_UNSPECIFIED = 0 + + # Conformation is required. + REQUIRED = 1 + + # Conformation is not required. + NOT_REQUIRED = 2 + end + + # The method type of the tool. + module MethodType + # Unspecified. + METHOD_TYPE_UNSPECIFIED = 0 + + # GET method. + GET = 1 + + # POST method. + POST = 2 + + # PUT method. + PUT = 3 + + # DELETE method. + DELETE = 4 + + # PATCH method. + PATCH = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool_call.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool_call.rb new file mode 100644 index 000000000000..78fb857b4d6d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool_call.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # Represents a call of a specific tool's action with the specified inputs. + # @!attribute [rw] tool + # @return [::String] + # Optional. The {::Google::Cloud::Dialogflow::V2::Tool tool} associated with + # this call. Format: + # `projects//locations//tools/`. + # + # Note: The following fields are mutually exclusive: `tool`, `ces_tool`, `ces_toolset`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ces_tool + # @return [::String] + # Optional. CES tool name for this call. + # Format: + # `projects//locations//apps//tools/`. + # + # Note: The following fields are mutually exclusive: `ces_tool`, `tool`, `ces_toolset`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ces_toolset + # @return [::String] + # Optional. CES toolset name for this call. + # Format: + # `projects//locations//apps//toolsets/ToolsetID>`. + # + # Note: The following fields are mutually exclusive: `ces_toolset`, `tool`, `ces_tool`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ces_app + # @return [::String] + # Optional. CES app name for this call. + # Format: + # `projects//locations//apps/`. + # + # Note: The following fields are mutually exclusive: `ces_app`, `tool`, `ces_tool`, `ces_toolset`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] tool_display_name + # @return [::String] + # Optional. A human readable short name of the tool, to be shown on the UI. + # @!attribute [rw] tool_display_details + # @return [::String] + # Optional. A human readable description of the tool. + # @!attribute [rw] action + # @return [::String] + # Optional. The name of the tool's action associated with this call. + # @!attribute [rw] input_parameters + # @return [::Google::Protobuf::Struct] + # Optional. The action's input parameters. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create time of the tool call. + # @!attribute [rw] answer_record + # @return [::String] + # Optional. The answer record associated with this tool call. + # @!attribute [r] state + # @return [::Google::Cloud::Dialogflow::V2::ToolCall::State] + # Output only. State of the tool call. + class ToolCall + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Tool call states. + module State + # Default value. + STATE_UNSPECIFIED = 0 + + # The tool call has been triggered. + TRIGGERED = 1 + + # The tool call requires confirmation from a human. + NEEDS_CONFIRMATION = 2 + end + end + + # The result of calling a tool's action. + # @!attribute [rw] tool + # @return [::String] + # Optional. The {::Google::Cloud::Dialogflow::V2::Tool tool} associated with + # this call. Format: + # `projects//locations//tools/`. + # + # Note: The following fields are mutually exclusive: `tool`, `ces_toolset`, `ces_tool`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ces_toolset + # @return [::String] + # Optional. CES toolset name for this call. + # Format: + # `projects//locations//apps//toolsets/ToolsetID>`. + # + # Note: The following fields are mutually exclusive: `ces_toolset`, `tool`, `ces_tool`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ces_tool + # @return [::String] + # Optional. CES tool name for this call. + # Format: + # `projects//locations//apps//tools/`. + # + # Note: The following fields are mutually exclusive: `ces_tool`, `tool`, `ces_toolset`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ces_app + # @return [::String] + # Optional. CES app name for this call. + # Format: + # `projects//locations//apps/`. + # + # Note: The following fields are mutually exclusive: `ces_app`, `tool`, `ces_toolset`, `ces_tool`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] action + # @return [::String] + # Optional. The name of the tool's action associated with this call. + # @!attribute [rw] error + # @return [::Google::Cloud::Dialogflow::V2::ToolCallResult::Error] + # The tool call's error. + # + # Note: The following fields are mutually exclusive: `error`, `raw_content`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] raw_content + # @return [::String] + # Only populated if the response content is not utf-8 encoded. + # (by definition byte fields are base64 encoded). + # + # Note: The following fields are mutually exclusive: `raw_content`, `error`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] content + # @return [::String] + # Only populated if the response content is utf-8 encoded. + # + # Note: The following fields are mutually exclusive: `content`, `error`, `raw_content`. 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. Create time of the tool call result. + # @!attribute [rw] answer_record + # @return [::String] + # Optional. The answer record associated with this tool call result. + class ToolCallResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An error produced by the tool call. + # @!attribute [rw] message + # @return [::String] + # Optional. The error message of the function. + class Error + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/toolset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/toolset.rb new file mode 100644 index 000000000000..678b0309b45b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/toolset.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 Dialogflow + module V2 + # A tool that is created from a toolset. + # @!attribute [rw] toolset + # @return [::String] + # Required. The name of the toolset to retrieve the schema for. + # Format: + # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` + # @!attribute [rw] operation_id + # @return [::String] + # Optional. The operationId field of the OpenAPI endpoint. The operationId + # must be present in the toolset's definition. + # @!attribute [rw] confirmation_requirement + # @return [::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement] + # Optional. Indicates whether the tool requires human confirmation. + class ToolsetTool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/validation_result.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/validation_result.rb new file mode 100644 index 000000000000..66c12576d07f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/validation_result.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 Dialogflow + module V2 + # Represents a single validation error. + # @!attribute [rw] severity + # @return [::Google::Cloud::Dialogflow::V2::ValidationError::Severity] + # The severity of the error. + # @!attribute [rw] entries + # @return [::Array<::String>] + # The names of the entries that the error is associated with. + # Format: + # + # - `projects//agent`, if the error is associated with the entire + # agent. + # - `projects//agent/intents/`, if the error is + # associated with certain intents. + # - `projects//agent/intents//trainingPhrases/`, if the error is associated with + # certain intent training phrases. + # - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. + # - `projects//agent/entities/`, if the error is + # associated with certain entities. + # @!attribute [rw] error_message + # @return [::String] + # The detailed error message. + class ValidationError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a level of severity. + module Severity + # Not specified. This value should never be used. + SEVERITY_UNSPECIFIED = 0 + + # The agent doesn't follow Dialogflow best practices. + INFO = 1 + + # The agent may not behave as expected. + WARNING = 2 + + # The agent may experience partial failures. + ERROR = 3 + + # The agent may completely fail. + CRITICAL = 4 + end + end + + # Represents the output of agent validation. + # @!attribute [rw] validation_errors + # @return [::Array<::Google::Cloud::Dialogflow::V2::ValidationError>] + # Contains all validation errors. + class ValidationResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/version.rb new file mode 100644 index 000000000000..fc0ace2ec88e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/version.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow + module V2 + # You can create multiple versions of your agent and publish them to separate + # environments. + # + # When you edit an agent, you are editing the draft agent. At any point, you + # can save the draft agent as an agent version, which is an immutable snapshot + # of your agent. + # + # When you save the draft agent, it is published to the default environment. + # When you create agent versions, you can publish them to custom environments. + # You can create a variety of custom environments for: + # + # - testing + # - development + # - production + # - etc. + # + # For more information, see the [versions and environments + # guide](https://cloud.google.com/dialogflow/docs/agents-versions). + # @!attribute [r] name + # @return [::String] + # Output only. The unique identifier of this agent version. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + # @!attribute [rw] description + # @return [::String] + # Optional. The developer-provided description of this version. + # @!attribute [r] version_number + # @return [::Integer] + # Output only. The sequential number of this version. This field is read-only + # which means it cannot be set by create and update methods. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time of this version. This field is read-only, + # i.e., it cannot be set by create and update methods. + # @!attribute [r] status + # @return [::Google::Cloud::Dialogflow::V2::Version::VersionStatus] + # Output only. The status of this version. This field is read-only and cannot + # be set by create and update methods. + class Version + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of a version. + module VersionStatus + # Not specified. This value is not used. + VERSION_STATUS_UNSPECIFIED = 0 + + # Version is not ready to serve (e.g. training is in progress). + IN_PROGRESS = 1 + + # Version is ready to serve. + READY = 2 + + # Version training failed. + FAILED = 3 + end + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Versions::Client#list_versions Versions.ListVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to list all versions from. + # Supported formats: + # + # - `projects//agent` + # - `projects//locations//agent` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of items to return in a single page. By + # default 100 and at most 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. The next_page_token value returned from a previous list request. + class ListVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # {::Google::Cloud::Dialogflow::V2::Versions::Client#list_versions Versions.ListVersions}. + # @!attribute [rw] versions + # @return [::Array<::Google::Cloud::Dialogflow::V2::Version>] + # The list of agent versions. There will be a maximum number of items + # returned based on the page_size field in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Versions::Client#get_version Versions.GetVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the version. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + class GetVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Versions::Client#create_version Versions.CreateVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The agent to create a version for. + # Supported formats: + # + # - `projects//agent` + # - `projects//locations//agent` + # @!attribute [rw] version + # @return [::Google::Cloud::Dialogflow::V2::Version] + # Required. The version to create. + class CreateVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Versions::Client#update_version Versions.UpdateVersion}. + # @!attribute [rw] version + # @return [::Google::Cloud::Dialogflow::V2::Version] + # Required. The version to update. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to control which fields get updated. + class UpdateVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # {::Google::Cloud::Dialogflow::V2::Versions::Client#delete_version Versions.DeleteVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the version to delete. + # Supported formats: + # + # - `projects//agent/versions/` + # - `projects//locations//agent/versions/` + class DeleteVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/webhook.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/webhook.rb new file mode 100644 index 000000000000..1257075be86f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/webhook.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! + + +module Google + module Cloud + module Dialogflow + module V2 + # The request message for a webhook call. + # @!attribute [rw] session + # @return [::String] + # The unique identifier of detectIntent request session. + # Can be used to identify end-user inside webhook implementation. + # Format: `projects//agent/sessions/`, or + # `projects//agent/environments//users//sessions/`. + # @!attribute [rw] response_id + # @return [::String] + # The unique identifier of the response. Contains the same value as + # `[Streaming]DetectIntentResponse.response_id`. + # @!attribute [rw] query_result + # @return [::Google::Cloud::Dialogflow::V2::QueryResult] + # The result of the conversational query or event processing. Contains the + # same value as `[Streaming]DetectIntentResponse.query_result`. + # @!attribute [rw] original_detect_intent_request + # @return [::Google::Cloud::Dialogflow::V2::OriginalDetectIntentRequest] + # Optional. The contents of the original request that was passed to + # `[Streaming]DetectIntent` call. + class WebhookRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for a webhook call. + # + # This response is validated by the Dialogflow server. If validation fails, + # an error will be returned in the + # {::Google::Cloud::Dialogflow::V2::QueryResult#diagnostic_info QueryResult.diagnostic_info} + # field. Setting JSON fields to an empty value with the wrong type is a common + # error. To avoid this error: + # + # - Use `""` for empty strings + # - Use `{}` or `null` for empty objects + # - Use `[]` or `null` for empty arrays + # + # For more information, see the + # [Protocol Buffers Language + # Guide](https://developers.google.com/protocol-buffers/docs/proto3#json). + # @!attribute [rw] fulfillment_text + # @return [::String] + # Optional. The text response message intended for the end-user. + # It is recommended to use `fulfillment_messages.text.text[0]` instead. + # When provided, Dialogflow uses this field to populate + # {::Google::Cloud::Dialogflow::V2::QueryResult#fulfillment_text QueryResult.fulfillment_text} + # sent to the integration or API caller. + # @!attribute [rw] fulfillment_messages + # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message>] + # Optional. The rich response messages intended for the end-user. + # When provided, Dialogflow uses this field to populate + # {::Google::Cloud::Dialogflow::V2::QueryResult#fulfillment_messages QueryResult.fulfillment_messages} + # sent to the integration or API caller. + # @!attribute [rw] source + # @return [::String] + # Optional. A custom field used to identify the webhook source. + # Arbitrary strings are supported. + # When provided, Dialogflow uses this field to populate + # {::Google::Cloud::Dialogflow::V2::QueryResult#webhook_source QueryResult.webhook_source} + # sent to the integration or API caller. + # @!attribute [rw] payload + # @return [::Google::Protobuf::Struct] + # Optional. This field can be used to pass custom data from your webhook to + # the integration or API caller. Arbitrary JSON objects are supported. When + # provided, Dialogflow uses this field to populate + # {::Google::Cloud::Dialogflow::V2::QueryResult#webhook_payload QueryResult.webhook_payload} + # sent to the integration or API caller. This field is also used by the + # [Google Assistant + # integration](https://cloud.google.com/dialogflow/docs/integrations/aog) + # for rich response messages. + # See the format definition at [Google Assistant Dialogflow webhook + # format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) + # @!attribute [rw] output_contexts + # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] + # Optional. The collection of output contexts that will overwrite currently + # active contexts for the session and reset their lifespans. + # When provided, Dialogflow uses this field to populate + # {::Google::Cloud::Dialogflow::V2::QueryResult#output_contexts QueryResult.output_contexts} + # sent to the integration or API caller. + # @!attribute [rw] followup_event_input + # @return [::Google::Cloud::Dialogflow::V2::EventInput] + # Optional. Invokes the supplied events. + # When this field is set, Dialogflow ignores the `fulfillment_text`, + # `fulfillment_messages`, and `payload` fields. + # @!attribute [rw] session_entity_types + # @return [::Array<::Google::Cloud::Dialogflow::V2::SessionEntityType>] + # Optional. Additional session entity types to replace or extend developer + # entity types with. The entity synonyms apply to all languages and persist + # for the session. Setting this data from a webhook overwrites + # the session entity types that have been set using `detectIntent`, + # `streamingDetectIntent` or + # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} + # management methods. + class WebhookResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the contents of the original request that was passed to + # the `[Streaming]DetectIntent` call. + # @!attribute [rw] source + # @return [::String] + # The source of this request, e.g., `google`, `facebook`, `slack`. It is set + # by Dialogflow-owned servers. + # @!attribute [rw] version + # @return [::String] + # Optional. The version of the protocol used for this request. + # This field is AoG-specific. + # @!attribute [rw] payload + # @return [::Google::Protobuf::Struct] + # Optional. This field is set to the value of the `QueryParameters.payload` + # field passed in the request. Some integrations that query a Dialogflow + # agent may provide additional information in the payload. + # + # In particular, for the Dialogflow Phone Gateway integration, this field has + # the form: + #
{
+        #      "telephony": {
+        #        "caller_id": "+18558363987"
+        #      }
+        #     }
+ # Note: The caller ID field (`caller_id`) will be redacted for Trial + # Edition agents and populated with the caller ID in [E.164 + # format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. + class OriginalDetectIntentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/type/latlng.rb new file mode 100644 index 000000000000..593314b4cde5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/type/latlng.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # An object that represents a latitude/longitude pair. This is expressed as a + # pair of doubles to represent degrees latitude and degrees longitude. Unless + # specified otherwise, this object must conform to the + # + # WGS84 standard. Values must be within normalized ranges. + # @!attribute [rw] latitude + # @return [::Float] + # The latitude in degrees. It must be in the range [-90.0, +90.0]. + # @!attribute [rw] longitude + # @return [::Float] + # The longitude in degrees. It must be in the range [-180.0, +180.0]. + class LatLng + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/Gemfile new file mode 100644 index 000000000000..2acb72ce745a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2", path: "../" +else + gem "google-cloud-dialogflow-v2" +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-dialogflow-v2/snippets/agents/delete_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/delete_agent.rb new file mode 100644 index 000000000000..1dc9023adc01 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/delete_agent.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 dialogflow_v2_generated_Agents_DeleteAgent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_agent call in the Agents 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::Dialogflow::V2::Agents::Client#delete_agent. +# +def delete_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new + + # Call the delete_agent method. + result = client.delete_agent request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_Agents_DeleteAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb new file mode 100644 index 000000000000..8722ab5c72ed --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/export_agent.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 dialogflow_v2_generated_Agents_ExportAgent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the export_agent call in the Agents 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::Dialogflow::V2::Agents::Client#export_agent. +# +def export_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new + + # Call the export_agent method. + result = client.export_agent request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Agents_ExportAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb new file mode 100644 index 000000000000..7a95d5e28b96 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_agent.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 dialogflow_v2_generated_Agents_GetAgent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_agent call in the Agents 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::Dialogflow::V2::Agents::Client#get_agent. +# +def get_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new + + # Call the get_agent method. + result = client.get_agent request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + p result +end +# [END dialogflow_v2_generated_Agents_GetAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb new file mode 100644 index 000000000000..ed0f75af59d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.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 dialogflow_v2_generated_Agents_GetValidationResult_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_validation_result call in the Agents 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::Dialogflow::V2::Agents::Client#get_validation_result. +# +def get_validation_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new + + # Call the get_validation_result method. + result = client.get_validation_result request + + # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult. + p result +end +# [END dialogflow_v2_generated_Agents_GetValidationResult_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb new file mode 100644 index 000000000000..e7284b6e6efc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/import_agent.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 dialogflow_v2_generated_Agents_ImportAgent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the import_agent call in the Agents 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::Dialogflow::V2::Agents::Client#import_agent. +# +def import_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new + + # Call the import_agent method. + result = client.import_agent request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Agents_ImportAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb new file mode 100644 index 000000000000..d28970b5fe09 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/restore_agent.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 dialogflow_v2_generated_Agents_RestoreAgent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the restore_agent call in the Agents 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::Dialogflow::V2::Agents::Client#restore_agent. +# +def restore_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new + + # Call the restore_agent method. + result = client.restore_agent request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Agents_RestoreAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb new file mode 100644 index 000000000000..8f929009101e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/search_agents.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 dialogflow_v2_generated_Agents_SearchAgents_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the search_agents call in the Agents 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::Dialogflow::V2::Agents::Client#search_agents. +# +def search_agents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new + + # Call the search_agents method. + result = client.search_agents 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::Dialogflow::V2::Agent. + p item + end +end +# [END dialogflow_v2_generated_Agents_SearchAgents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb new file mode 100644 index 000000000000..4024bdc6c5b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/set_agent.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 dialogflow_v2_generated_Agents_SetAgent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the set_agent call in the Agents 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::Dialogflow::V2::Agents::Client#set_agent. +# +def set_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new + + # Call the set_agent method. + result = client.set_agent request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + p result +end +# [END dialogflow_v2_generated_Agents_SetAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb new file mode 100644 index 000000000000..80f635acaaf3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/train_agent.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 dialogflow_v2_generated_Agents_TrainAgent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the train_agent call in the Agents 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::Dialogflow::V2::Agents::Client#train_agent. +# +def train_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new + + # Call the train_agent method. + result = client.train_agent request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Agents_TrainAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb new file mode 100644 index 000000000000..b82dcb5b2b4f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.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 dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_answer_records call in the AnswerRecords 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::Dialogflow::V2::AnswerRecords::Client#list_answer_records. +# +def list_answer_records + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new + + # Call the list_answer_records method. + result = client.list_answer_records 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::Dialogflow::V2::AnswerRecord. + p item + end +end +# [END dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb new file mode 100644 index 000000000000..6c8f8db961f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.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 dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_answer_record call in the AnswerRecords 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::Dialogflow::V2::AnswerRecords::Client#update_answer_record. +# +def update_answer_record + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new + + # Call the update_answer_record method. + result = client.update_answer_record request + + # The returned object is of type Google::Cloud::Dialogflow::V2::AnswerRecord. + p result +end +# [END dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb new file mode 100644 index 000000000000..9a7b15ca505a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/create_context.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 dialogflow_v2_generated_Contexts_CreateContext_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_context call in the Contexts 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::Dialogflow::V2::Contexts::Client#create_context. +# +def create_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new + + # Call the create_context method. + result = client.create_context request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + p result +end +# [END dialogflow_v2_generated_Contexts_CreateContext_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb new file mode 100644 index 000000000000..efe3eca6c0dc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.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 dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_all_contexts call in the Contexts 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::Dialogflow::V2::Contexts::Client#delete_all_contexts. +# +def delete_all_contexts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new + + # Call the delete_all_contexts method. + result = client.delete_all_contexts request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb new file mode 100644 index 000000000000..9863858c489a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_context.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 dialogflow_v2_generated_Contexts_DeleteContext_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_context call in the Contexts 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::Dialogflow::V2::Contexts::Client#delete_context. +# +def delete_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new + + # Call the delete_context method. + result = client.delete_context request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_Contexts_DeleteContext_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb new file mode 100644 index 000000000000..da09cc6d51f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/get_context.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 dialogflow_v2_generated_Contexts_GetContext_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_context call in the Contexts 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::Dialogflow::V2::Contexts::Client#get_context. +# +def get_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetContextRequest.new + + # Call the get_context method. + result = client.get_context request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + p result +end +# [END dialogflow_v2_generated_Contexts_GetContext_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb new file mode 100644 index 000000000000..bf646bd3dee8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.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 dialogflow_v2_generated_Contexts_ListContexts_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_contexts call in the Contexts 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::Dialogflow::V2::Contexts::Client#list_contexts. +# +def list_contexts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new + + # Call the list_contexts method. + result = client.list_contexts 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::Dialogflow::V2::Context. + p item + end +end +# [END dialogflow_v2_generated_Contexts_ListContexts_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb new file mode 100644 index 000000000000..29cbf2478522 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/update_context.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 dialogflow_v2_generated_Contexts_UpdateContext_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_context call in the Contexts 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::Dialogflow::V2::Contexts::Client#update_context. +# +def update_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new + + # Call the update_context method. + result = client.update_context request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + p result +end +# [END dialogflow_v2_generated_Contexts_UpdateContext_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb new file mode 100644 index 000000000000..fe70fd892912 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.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 dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_conversation_dataset call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#create_conversation_dataset. +# +def create_conversation_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new + + # Call the create_conversation_dataset method. + result = client.create_conversation_dataset request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb new file mode 100644 index 000000000000..eb3601be7b26 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.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 dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_conversation_dataset call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#delete_conversation_dataset. +# +def delete_conversation_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new + + # Call the delete_conversation_dataset method. + result = client.delete_conversation_dataset request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb new file mode 100644 index 000000000000..0c4a42c0b852 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.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 dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_conversation_dataset call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#get_conversation_dataset. +# +def get_conversation_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new + + # Call the get_conversation_dataset method. + result = client.get_conversation_dataset request + + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. + p result +end +# [END dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb new file mode 100644 index 000000000000..8c3c877a147e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.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 dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the import_conversation_data call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data. +# +def import_conversation_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new + + # Call the import_conversation_data method. + result = client.import_conversation_data request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb new file mode 100644 index 000000000000..4e30f4d0af71 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.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 dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_conversation_datasets call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets. +# +def list_conversation_datasets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new + + # Call the list_conversation_datasets method. + result = client.list_conversation_datasets 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::Dialogflow::V2::ConversationDataset. + p item + end +end +# [END dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb new file mode 100644 index 000000000000..67046818982c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_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 dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#create_conversation_model. +# +def create_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new + + # Call the create_conversation_model method. + result = client.create_conversation_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 dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb new file mode 100644 index 000000000000..08f031d2dc4f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.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 dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_conversation_model_evaluation call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation. +# +def create_conversation_model_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new + + # Call the create_conversation_model_evaluation method. + result = client.create_conversation_model_evaluation request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb new file mode 100644 index 000000000000..4a135c039229 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_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 dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#delete_conversation_model. +# +def delete_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new + + # Call the delete_conversation_model method. + result = client.delete_conversation_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 dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb new file mode 100644 index 000000000000..0c840fb018c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_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 dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the deploy_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model. +# +def deploy_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new + + # Call the deploy_conversation_model method. + result = client.deploy_conversation_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 dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb new file mode 100644 index 000000000000..df02f37ecd43 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.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 dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#get_conversation_model. +# +def get_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new + + # Call the get_conversation_model method. + result = client.get_conversation_model request + + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. + p result +end +# [END dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb new file mode 100644 index 000000000000..0806c1654f42 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.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 dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_conversation_model_evaluation call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#get_conversation_model_evaluation. +# +def get_conversation_model_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new + + # Call the get_conversation_model_evaluation method. + result = client.get_conversation_model_evaluation request + + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. + p result +end +# [END dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb new file mode 100644 index 000000000000..9d835d0d26a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.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 dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_conversation_model_evaluations call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations. +# +def list_conversation_model_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new + + # Call the list_conversation_model_evaluations method. + result = client.list_conversation_model_evaluations 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::Dialogflow::V2::ConversationModelEvaluation. + p item + end +end +# [END dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb new file mode 100644 index 000000000000..feb0adee80df --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.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 dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_conversation_models call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#list_conversation_models. +# +def list_conversation_models + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new + + # Call the list_conversation_models method. + result = client.list_conversation_models 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::Dialogflow::V2::ConversationModel. + p item + end +end +# [END dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb new file mode 100644 index 000000000000..cd527948af47 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_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 dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the undeploy_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model. +# +def undeploy_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new + + # Call the undeploy_conversation_model method. + result = client.undeploy_conversation_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 dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb new file mode 100644 index 000000000000..d33648bb0442 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_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 dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the clear_suggestion_feature_config call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config. +# +def clear_suggestion_feature_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new + + # Call the clear_suggestion_feature_config method. + result = client.clear_suggestion_feature_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 dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb new file mode 100644 index 000000000000..0bff474f17f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.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 dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_conversation_profile call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#create_conversation_profile. +# +def create_conversation_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new + + # Call the create_conversation_profile method. + result = client.create_conversation_profile request + + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + p result +end +# [END dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb new file mode 100644 index 000000000000..0764e4d81d3e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.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 dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_conversation_profile call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#delete_conversation_profile. +# +def delete_conversation_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new + + # Call the delete_conversation_profile method. + result = client.delete_conversation_profile request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb new file mode 100644 index 000000000000..084d30cf18f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.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 dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_conversation_profile call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile. +# +def get_conversation_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new + + # Call the get_conversation_profile method. + result = client.get_conversation_profile request + + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + p result +end +# [END dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb new file mode 100644 index 000000000000..e2d03f7cc868 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.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 dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_conversation_profiles call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles. +# +def list_conversation_profiles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new + + # Call the list_conversation_profiles method. + result = client.list_conversation_profiles 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::Dialogflow::V2::ConversationProfile. + p item + end +end +# [END dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb new file mode 100644 index 000000000000..5f8f6b342935 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_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 dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the set_suggestion_feature_config call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config. +# +def set_suggestion_feature_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new + + # Call the set_suggestion_feature_config method. + result = client.set_suggestion_feature_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 dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb new file mode 100644 index 000000000000..c9caf7615409 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.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 dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_conversation_profile call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#update_conversation_profile. +# +def update_conversation_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new + + # Call the update_conversation_profile method. + result = client.update_conversation_profile request + + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + p result +end +# [END dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb new file mode 100644 index 000000000000..b3ab2aa619d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/complete_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 dialogflow_v2_generated_Conversations_CompleteConversation_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the complete_conversation call in the Conversations 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::Dialogflow::V2::Conversations::Client#complete_conversation. +# +def complete_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new + + # Call the complete_conversation method. + result = client.complete_conversation request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + p result +end +# [END dialogflow_v2_generated_Conversations_CompleteConversation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb new file mode 100644 index 000000000000..6f10891d7eef --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/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 dialogflow_v2_generated_Conversations_CreateConversation_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_conversation call in the Conversations 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::Dialogflow::V2::Conversations::Client#create_conversation. +# +def create_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new + + # Call the create_conversation method. + result = client.create_conversation request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + p result +end +# [END dialogflow_v2_generated_Conversations_CreateConversation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_suggestion.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_suggestion.rb new file mode 100644 index 000000000000..aa371ba61700 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_suggestion.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 dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the generate_stateless_suggestion call in the Conversations 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::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion. +# +def generate_stateless_suggestion + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new + + # Call the generate_stateless_suggestion method. + result = client.generate_stateless_suggestion request + + # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse. + p result +end +# [END dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_summary.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_summary.rb new file mode 100644 index 000000000000..29ac2872d330 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_summary.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 dialogflow_v2_generated_Conversations_GenerateStatelessSummary_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the generate_stateless_summary call in the Conversations 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::Dialogflow::V2::Conversations::Client#generate_stateless_summary. +# +def generate_stateless_summary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new + + # Call the generate_stateless_summary method. + result = client.generate_stateless_summary request + + # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse. + p result +end +# [END dialogflow_v2_generated_Conversations_GenerateStatelessSummary_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_suggestions.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_suggestions.rb new file mode 100644 index 000000000000..6a49d93fda1e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_suggestions.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 dialogflow_v2_generated_Conversations_GenerateSuggestions_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the generate_suggestions call in the Conversations 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::Dialogflow::V2::Conversations::Client#generate_suggestions. +# +def generate_suggestions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new + + # Call the generate_suggestions method. + result = client.generate_suggestions request + + # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse. + p result +end +# [END dialogflow_v2_generated_Conversations_GenerateSuggestions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb new file mode 100644 index 000000000000..38bd3cf94644 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/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 dialogflow_v2_generated_Conversations_GetConversation_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_conversation call in the Conversations 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::Dialogflow::V2::Conversations::Client#get_conversation. +# +def get_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new + + # Call the get_conversation method. + result = client.get_conversation request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + p result +end +# [END dialogflow_v2_generated_Conversations_GetConversation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/ingest_context_references.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/ingest_context_references.rb new file mode 100644 index 000000000000..408a37f8fbcd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/ingest_context_references.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 dialogflow_v2_generated_Conversations_IngestContextReferences_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the ingest_context_references call in the Conversations 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::Dialogflow::V2::Conversations::Client#ingest_context_references. +# +def ingest_context_references + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new + + # Call the ingest_context_references method. + result = client.ingest_context_references request + + # The returned object is of type Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse. + p result +end +# [END dialogflow_v2_generated_Conversations_IngestContextReferences_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb new file mode 100644 index 000000000000..7adcf395116f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/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 dialogflow_v2_generated_Conversations_ListConversations_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_conversations call in the Conversations 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::Dialogflow::V2::Conversations::Client#list_conversations. +# +def list_conversations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Conversation. + p item + end +end +# [END dialogflow_v2_generated_Conversations_ListConversations_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb new file mode 100644 index 000000000000..6db48aadee73 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_messages.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 dialogflow_v2_generated_Conversations_ListMessages_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_messages call in the Conversations 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::Dialogflow::V2::Conversations::Client#list_messages. +# +def list_messages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new + + # Call the list_messages method. + result = client.list_messages 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::Dialogflow::V2::Message. + p item + end +end +# [END dialogflow_v2_generated_Conversations_ListMessages_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/search_knowledge.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/search_knowledge.rb new file mode 100644 index 000000000000..6d9f04ecc8c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/search_knowledge.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 dialogflow_v2_generated_Conversations_SearchKnowledge_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the search_knowledge call in the Conversations 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::Dialogflow::V2::Conversations::Client#search_knowledge. +# +def search_knowledge + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new + + # Call the search_knowledge method. + result = client.search_knowledge request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse. + p result +end +# [END dialogflow_v2_generated_Conversations_SearchKnowledge_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/suggest_conversation_summary.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/suggest_conversation_summary.rb new file mode 100644 index 000000000000..64fa435c538e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/suggest_conversation_summary.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 dialogflow_v2_generated_Conversations_SuggestConversationSummary_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the suggest_conversation_summary call in the Conversations 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::Dialogflow::V2::Conversations::Client#suggest_conversation_summary. +# +def suggest_conversation_summary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new + + # Call the suggest_conversation_summary method. + result = client.suggest_conversation_summary request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse. + p result +end +# [END dialogflow_v2_generated_Conversations_SuggestConversationSummary_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/create_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/create_document.rb new file mode 100644 index 000000000000..09a45b2b34e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/create_document.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 dialogflow_v2_generated_Documents_CreateDocument_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_document call in the Documents 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::Dialogflow::V2::Documents::Client#create_document. +# +def create_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new + + # Call the create_document method. + result = client.create_document request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Documents_CreateDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb new file mode 100644 index 000000000000..c2527ed89adb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/delete_document.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 dialogflow_v2_generated_Documents_DeleteDocument_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_document call in the Documents 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::Dialogflow::V2::Documents::Client#delete_document. +# +def delete_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new + + # Call the delete_document method. + result = client.delete_document request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Documents_DeleteDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/export_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/export_document.rb new file mode 100644 index 000000000000..5bc17b24a8a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/export_document.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 dialogflow_v2_generated_Documents_ExportDocument_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the export_document call in the Documents 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::Dialogflow::V2::Documents::Client#export_document. +# +def export_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new + + # Call the export_document method. + result = client.export_document request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Documents_ExportDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/get_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/get_document.rb new file mode 100644 index 000000000000..46c5f51e1a16 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/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 dialogflow_v2_generated_Documents_GetDocument_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_document call in the Documents 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::Dialogflow::V2::Documents::Client#get_document. +# +def get_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new + + # Call the get_document method. + result = client.get_document request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Document. + p result +end +# [END dialogflow_v2_generated_Documents_GetDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb new file mode 100644 index 000000000000..3f6b2677bfd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/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 dialogflow_v2_generated_Documents_ImportDocuments_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the import_documents call in the Documents 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::Dialogflow::V2::Documents::Client#import_documents. +# +def import_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::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 dialogflow_v2_generated_Documents_ImportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb new file mode 100644 index 000000000000..c41bd457b663 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/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 dialogflow_v2_generated_Documents_ListDocuments_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_documents call in the Documents 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::Dialogflow::V2::Documents::Client#list_documents. +# +def list_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Document. + p item + end +end +# [END dialogflow_v2_generated_Documents_ListDocuments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb new file mode 100644 index 000000000000..02eb4cbe14ed --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/reload_document.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 dialogflow_v2_generated_Documents_ReloadDocument_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the reload_document call in the Documents 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::Dialogflow::V2::Documents::Client#reload_document. +# +def reload_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new + + # Call the reload_document method. + result = client.reload_document request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Documents_ReloadDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/update_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/update_document.rb new file mode 100644 index 000000000000..17a517e7e16d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/update_document.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 dialogflow_v2_generated_Documents_UpdateDocument_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_document call in the Documents 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::Dialogflow::V2::Documents::Client#update_document. +# +def update_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new + + # Call the update_document method. + result = client.update_document request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Documents_UpdateDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/get_encryption_spec.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/get_encryption_spec.rb new file mode 100644 index 000000000000..4ebad6a0d692 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/get_encryption_spec.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 dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_encryption_spec call in the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::Client#get_encryption_spec. +# +def get_encryption_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new + + # Call the get_encryption_spec method. + result = client.get_encryption_spec request + + # The returned object is of type Google::Cloud::Dialogflow::V2::EncryptionSpec. + p result +end +# [END dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/initialize_encryption_spec.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/initialize_encryption_spec.rb new file mode 100644 index 000000000000..e0da7705ede7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/initialize_encryption_spec.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 dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the initialize_encryption_spec call in the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::Client#initialize_encryption_spec. +# +def initialize_encryption_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new + + # Call the initialize_encryption_spec method. + result = client.initialize_encryption_spec request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb new file mode 100644 index 000000000000..68f06144a270 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.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 dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the batch_create_entities call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_create_entities. +# +def batch_create_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new + + # Call the batch_create_entities method. + result = client.batch_create_entities request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb new file mode 100644 index 000000000000..ae82178d87a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.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 dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the batch_delete_entities call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_delete_entities. +# +def batch_delete_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new + + # Call the batch_delete_entities method. + result = client.batch_delete_entities request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb new file mode 100644 index 000000000000..ce5ee0fee9b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.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 dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the batch_delete_entity_types call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_delete_entity_types. +# +def batch_delete_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new + + # Call the batch_delete_entity_types method. + result = client.batch_delete_entity_types request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb new file mode 100644 index 000000000000..69982093619b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.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 dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the batch_update_entities call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_update_entities. +# +def batch_update_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new + + # Call the batch_update_entities method. + result = client.batch_update_entities request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb new file mode 100644 index 000000000000..b01544b1d981 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.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 dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the batch_update_entity_types call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types. +# +def batch_update_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new + + # Call the batch_update_entity_types method. + result = client.batch_update_entity_types request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb new file mode 100644 index 000000000000..e58746418ec7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.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 dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_entity_type call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#create_entity_type. +# +def create_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new + + # Call the create_entity_type method. + result = client.create_entity_type request + + # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + p result +end +# [END dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb new file mode 100644 index 000000000000..7e04582cac7f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.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 dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_entity_type call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#delete_entity_type. +# +def delete_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new + + # Call the delete_entity_type method. + result = client.delete_entity_type request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb new file mode 100644 index 000000000000..309d3a58e7c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.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 dialogflow_v2_generated_EntityTypes_GetEntityType_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_entity_type call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#get_entity_type. +# +def get_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new + + # Call the get_entity_type method. + result = client.get_entity_type request + + # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + p result +end +# [END dialogflow_v2_generated_EntityTypes_GetEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb new file mode 100644 index 000000000000..efb7d67d12af --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.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 dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_entity_types call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#list_entity_types. +# +def list_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new + + # Call the list_entity_types method. + result = client.list_entity_types 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::Dialogflow::V2::EntityType. + p item + end +end +# [END dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb new file mode 100644 index 000000000000..7879502b5e51 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.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 dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_entity_type call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#update_entity_type. +# +def update_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new + + # Call the update_entity_type method. + result = client.update_entity_type request + + # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + p result +end +# [END dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb new file mode 100644 index 000000000000..77761ba93b38 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/create_environment.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 dialogflow_v2_generated_Environments_CreateEnvironment_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_environment call in the Environments 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::Dialogflow::V2::Environments::Client#create_environment. +# +def create_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new + + # Call the create_environment method. + result = client.create_environment request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + p result +end +# [END dialogflow_v2_generated_Environments_CreateEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb new file mode 100644 index 000000000000..25202158fb20 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/delete_environment.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 dialogflow_v2_generated_Environments_DeleteEnvironment_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_environment call in the Environments 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::Dialogflow::V2::Environments::Client#delete_environment. +# +def delete_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new + + # Call the delete_environment method. + result = client.delete_environment request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_Environments_DeleteEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb new file mode 100644 index 000000000000..60157fefbe6e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment.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 dialogflow_v2_generated_Environments_GetEnvironment_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_environment call in the Environments 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::Dialogflow::V2::Environments::Client#get_environment. +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new + + # Call the get_environment method. + result = client.get_environment request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + p result +end +# [END dialogflow_v2_generated_Environments_GetEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb new file mode 100644 index 000000000000..5f6c1b0b6d33 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.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 dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_environment_history call in the Environments 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::Dialogflow::V2::Environments::Client#get_environment_history. +# +def get_environment_history + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.new + + # Call the get_environment_history method. + result = client.get_environment_history 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::Dialogflow::V2::EnvironmentHistory::Entry. + p item + end +end +# [END dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb new file mode 100644 index 000000000000..e8527f8181dd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/list_environments.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 dialogflow_v2_generated_Environments_ListEnvironments_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_environments call in the Environments 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::Dialogflow::V2::Environments::Client#list_environments. +# +def list_environments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.new + + # Call the list_environments method. + result = client.list_environments 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::Dialogflow::V2::Environment. + p item + end +end +# [END dialogflow_v2_generated_Environments_ListEnvironments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb new file mode 100644 index 000000000000..44842c188b53 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/update_environment.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 dialogflow_v2_generated_Environments_UpdateEnvironment_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_environment call in the Environments 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::Dialogflow::V2::Environments::Client#update_environment. +# +def update_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new + + # Call the update_environment method. + result = client.update_environment request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + p result +end +# [END dialogflow_v2_generated_Environments_UpdateEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb new file mode 100644 index 000000000000..5d7394f0a225 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.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 dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_fulfillment call in the Fulfillments 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::Dialogflow::V2::Fulfillments::Client#get_fulfillment. +# +def get_fulfillment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new + + # Call the get_fulfillment method. + result = client.get_fulfillment request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + p result +end +# [END dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb new file mode 100644 index 000000000000..f937798be201 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.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 dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_fulfillment call in the Fulfillments 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::Dialogflow::V2::Fulfillments::Client#update_fulfillment. +# +def update_fulfillment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new + + # Call the update_fulfillment method. + result = client.update_fulfillment request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + p result +end +# [END dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/create_generator_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/create_generator_evaluation.rb new file mode 100644 index 000000000000..a3f3fb94bcfe --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/create_generator_evaluation.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 dialogflow_v2_generated_GeneratorEvaluations_CreateGeneratorEvaluation_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_generator_evaluation call in the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::Client#create_generator_evaluation. +# +def create_generator_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new + + # Call the create_generator_evaluation method. + result = client.create_generator_evaluation request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_GeneratorEvaluations_CreateGeneratorEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/delete_generator_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/delete_generator_evaluation.rb new file mode 100644 index 000000000000..59ce5ac33b34 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/delete_generator_evaluation.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 dialogflow_v2_generated_GeneratorEvaluations_DeleteGeneratorEvaluation_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_generator_evaluation call in the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::Client#delete_generator_evaluation. +# +def delete_generator_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new + + # Call the delete_generator_evaluation method. + result = client.delete_generator_evaluation request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_GeneratorEvaluations_DeleteGeneratorEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/get_generator_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/get_generator_evaluation.rb new file mode 100644 index 000000000000..36eb0a27f011 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/get_generator_evaluation.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 dialogflow_v2_generated_GeneratorEvaluations_GetGeneratorEvaluation_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_generator_evaluation call in the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::Client#get_generator_evaluation. +# +def get_generator_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new + + # Call the get_generator_evaluation method. + result = client.get_generator_evaluation request + + # The returned object is of type Google::Cloud::Dialogflow::V2::GeneratorEvaluation. + p result +end +# [END dialogflow_v2_generated_GeneratorEvaluations_GetGeneratorEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/list_generator_evaluations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/list_generator_evaluations.rb new file mode 100644 index 000000000000..87f21e7f2c21 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/list_generator_evaluations.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 dialogflow_v2_generated_GeneratorEvaluations_ListGeneratorEvaluations_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_generator_evaluations call in the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::Client#list_generator_evaluations. +# +def list_generator_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.new + + # Call the list_generator_evaluations method. + result = client.list_generator_evaluations 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::Dialogflow::V2::GeneratorEvaluation. + p item + end +end +# [END dialogflow_v2_generated_GeneratorEvaluations_ListGeneratorEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/create_generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/create_generator.rb new file mode 100644 index 000000000000..3f3c5fbcbd9a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/create_generator.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 dialogflow_v2_generated_Generators_CreateGenerator_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_generator call in the Generators 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::Dialogflow::V2::Generators::Client#create_generator. +# +def create_generator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new + + # Call the create_generator method. + result = client.create_generator request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. + p result +end +# [END dialogflow_v2_generated_Generators_CreateGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/delete_generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/delete_generator.rb new file mode 100644 index 000000000000..2aaec0ceda4b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/delete_generator.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 dialogflow_v2_generated_Generators_DeleteGenerator_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_generator call in the Generators 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::Dialogflow::V2::Generators::Client#delete_generator. +# +def delete_generator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new + + # Call the delete_generator method. + result = client.delete_generator request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_Generators_DeleteGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/get_generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/get_generator.rb new file mode 100644 index 000000000000..87194b7d58ff --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/get_generator.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 dialogflow_v2_generated_Generators_GetGenerator_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_generator call in the Generators 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::Dialogflow::V2::Generators::Client#get_generator. +# +def get_generator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new + + # Call the get_generator method. + result = client.get_generator request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. + p result +end +# [END dialogflow_v2_generated_Generators_GetGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/list_generators.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/list_generators.rb new file mode 100644 index 000000000000..19b1dff473b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/list_generators.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 dialogflow_v2_generated_Generators_ListGenerators_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_generators call in the Generators 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::Dialogflow::V2::Generators::Client#list_generators. +# +def list_generators + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.new + + # Call the list_generators method. + result = client.list_generators 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::Dialogflow::V2::Generator. + p item + end +end +# [END dialogflow_v2_generated_Generators_ListGenerators_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/update_generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/update_generator.rb new file mode 100644 index 000000000000..84192e6c0cc4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/update_generator.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 dialogflow_v2_generated_Generators_UpdateGenerator_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_generator call in the Generators 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::Dialogflow::V2::Generators::Client#update_generator. +# +def update_generator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Generators::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new + + # Call the update_generator method. + result = client.update_generator request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. + p result +end +# [END dialogflow_v2_generated_Generators_UpdateGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb new file mode 100644 index 000000000000..9778985ab52f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.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 dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the batch_delete_intents call in the Intents 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::Dialogflow::V2::Intents::Client#batch_delete_intents. +# +def batch_delete_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new + + # Call the batch_delete_intents method. + result = client.batch_delete_intents request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb new file mode 100644 index 000000000000..3601b8579c40 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.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 dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the batch_update_intents call in the Intents 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::Dialogflow::V2::Intents::Client#batch_update_intents. +# +def batch_update_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new + + # Call the batch_update_intents method. + result = client.batch_update_intents request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is 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 dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb new file mode 100644 index 000000000000..63bfadfbbdf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/create_intent.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 dialogflow_v2_generated_Intents_CreateIntent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_intent call in the Intents 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::Dialogflow::V2::Intents::Client#create_intent. +# +def create_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new + + # Call the create_intent method. + result = client.create_intent request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + p result +end +# [END dialogflow_v2_generated_Intents_CreateIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb new file mode 100644 index 000000000000..1679670c7f1c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/delete_intent.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 dialogflow_v2_generated_Intents_DeleteIntent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_intent call in the Intents 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::Dialogflow::V2::Intents::Client#delete_intent. +# +def delete_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new + + # Call the delete_intent method. + result = client.delete_intent request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_Intents_DeleteIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb new file mode 100644 index 000000000000..3117e8aa5595 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/get_intent.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 dialogflow_v2_generated_Intents_GetIntent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_intent call in the Intents 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::Dialogflow::V2::Intents::Client#get_intent. +# +def get_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new + + # Call the get_intent method. + result = client.get_intent request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + p result +end +# [END dialogflow_v2_generated_Intents_GetIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb new file mode 100644 index 000000000000..4913a8ffe8da --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/list_intents.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 dialogflow_v2_generated_Intents_ListIntents_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_intents call in the Intents 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::Dialogflow::V2::Intents::Client#list_intents. +# +def list_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new + + # Call the list_intents method. + result = client.list_intents 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::Dialogflow::V2::Intent. + p item + end +end +# [END dialogflow_v2_generated_Intents_ListIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb new file mode 100644 index 000000000000..621afdbe41e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/update_intent.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 dialogflow_v2_generated_Intents_UpdateIntent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_intent call in the Intents 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::Dialogflow::V2::Intents::Client#update_intent. +# +def update_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new + + # Call the update_intent method. + result = client.update_intent request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + p result +end +# [END dialogflow_v2_generated_Intents_UpdateIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb new file mode 100644 index 000000000000..cf1a10c4cebf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.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 dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_knowledge_base call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#create_knowledge_base. +# +def create_knowledge_base + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new + + # Call the create_knowledge_base method. + result = client.create_knowledge_base request + + # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + p result +end +# [END dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb new file mode 100644 index 000000000000..c7270d6b310a --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.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 dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_knowledge_base call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#delete_knowledge_base. +# +def delete_knowledge_base + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new + + # Call the delete_knowledge_base method. + result = client.delete_knowledge_base request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb new file mode 100644 index 000000000000..69489a60dc25 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.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 dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_knowledge_base call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#get_knowledge_base. +# +def get_knowledge_base + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new + + # Call the get_knowledge_base method. + result = client.get_knowledge_base request + + # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + p result +end +# [END dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb new file mode 100644 index 000000000000..0f0aed18a5dd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.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 dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_knowledge_bases call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases. +# +def list_knowledge_bases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.new + + # Call the list_knowledge_bases method. + result = client.list_knowledge_bases 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::Dialogflow::V2::KnowledgeBase. + p item + end +end +# [END dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb new file mode 100644 index 000000000000..075d971a2e73 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.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 dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_knowledge_base call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#update_knowledge_base. +# +def update_knowledge_base + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new + + # Call the update_knowledge_base method. + result = client.update_knowledge_base request + + # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + p result +end +# [END dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb new file mode 100644 index 000000000000..91afa9b9c512 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/analyze_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 dialogflow_v2_generated_Participants_AnalyzeContent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the analyze_content call in the Participants 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::Dialogflow::V2::Participants::Client#analyze_content. +# +def analyze_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new + + # Call the analyze_content method. + result = client.analyze_content request + + # The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse. + p result +end +# [END dialogflow_v2_generated_Participants_AnalyzeContent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb new file mode 100644 index 000000000000..a3103291d1e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/create_participant.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 dialogflow_v2_generated_Participants_CreateParticipant_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_participant call in the Participants 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::Dialogflow::V2::Participants::Client#create_participant. +# +def create_participant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new + + # Call the create_participant method. + result = client.create_participant request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + p result +end +# [END dialogflow_v2_generated_Participants_CreateParticipant_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb new file mode 100644 index 000000000000..6ec37dc378eb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/get_participant.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 dialogflow_v2_generated_Participants_GetParticipant_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_participant call in the Participants 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::Dialogflow::V2::Participants::Client#get_participant. +# +def get_participant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new + + # Call the get_participant method. + result = client.get_participant request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + p result +end +# [END dialogflow_v2_generated_Participants_GetParticipant_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb new file mode 100644 index 000000000000..080296c6b533 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/list_participants.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 dialogflow_v2_generated_Participants_ListParticipants_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_participants call in the Participants 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::Dialogflow::V2::Participants::Client#list_participants. +# +def list_participants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new + + # Call the list_participants method. + result = client.list_participants 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::Dialogflow::V2::Participant. + p item + end +end +# [END dialogflow_v2_generated_Participants_ListParticipants_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb new file mode 100644 index 000000000000..93facb5b275e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_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 dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the streaming_analyze_content call in the Participants 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::Dialogflow::V2::Participants::Client#streaming_analyze_content. +# +def streaming_analyze_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the streaming_analyze_content method to start streaming. + output = client.streaming_analyze_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::Dialogflow::V2::StreamingAnalyzeContentRequest.new + input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse + output.each do |current_response| + p current_response + end +end +# [END dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb new file mode 100644 index 000000000000..538f29e332f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.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 dialogflow_v2_generated_Participants_SuggestArticles_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the suggest_articles call in the Participants 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::Dialogflow::V2::Participants::Client#suggest_articles. +# +def suggest_articles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new + + # Call the suggest_articles method. + result = client.suggest_articles request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse. + p result +end +# [END dialogflow_v2_generated_Participants_SuggestArticles_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb new file mode 100644 index 000000000000..e3da7a83ee05 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.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 dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the suggest_faq_answers call in the Participants 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::Dialogflow::V2::Participants::Client#suggest_faq_answers. +# +def suggest_faq_answers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new + + # Call the suggest_faq_answers method. + result = client.suggest_faq_answers request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse. + p result +end +# [END dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_knowledge_assist.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_knowledge_assist.rb new file mode 100644 index 000000000000..536be88d1feb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_knowledge_assist.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 dialogflow_v2_generated_Participants_SuggestKnowledgeAssist_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the suggest_knowledge_assist call in the Participants 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::Dialogflow::V2::Participants::Client#suggest_knowledge_assist. +# +def suggest_knowledge_assist + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new + + # Call the suggest_knowledge_assist method. + result = client.suggest_knowledge_assist request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse. + p result +end +# [END dialogflow_v2_generated_Participants_SuggestKnowledgeAssist_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb new file mode 100644 index 000000000000..fac97edf6d89 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.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 dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the suggest_smart_replies call in the Participants 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::Dialogflow::V2::Participants::Client#suggest_smart_replies. +# +def suggest_smart_replies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new + + # Call the suggest_smart_replies method. + result = client.suggest_smart_replies request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse. + p result +end +# [END dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb new file mode 100644 index 000000000000..77c489b6dee2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/update_participant.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 dialogflow_v2_generated_Participants_UpdateParticipant_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_participant call in the Participants 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::Dialogflow::V2::Participants::Client#update_participant. +# +def update_participant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new + + # Call the update_participant method. + result = client.update_participant request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + p result +end +# [END dialogflow_v2_generated_Participants_UpdateParticipant_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb new file mode 100644 index 000000000000..3d17c9351982 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.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 dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_session_entity_type call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#create_session_entity_type. +# +def create_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new + + # Call the create_session_entity_type method. + result = client.create_session_entity_type request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + p result +end +# [END dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb new file mode 100644 index 000000000000..a204361de978 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.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 dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_session_entity_type call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#delete_session_entity_type. +# +def delete_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new + + # Call the delete_session_entity_type method. + result = client.delete_session_entity_type request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb new file mode 100644 index 000000000000..ba65d947e45d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.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 dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_session_entity_type call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#get_session_entity_type. +# +def get_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new + + # Call the get_session_entity_type method. + result = client.get_session_entity_type request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + p result +end +# [END dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb new file mode 100644 index 000000000000..95a29e9ad076 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.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 dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_session_entity_types call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types. +# +def list_session_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new + + # Call the list_session_entity_types method. + result = client.list_session_entity_types 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::Dialogflow::V2::SessionEntityType. + p item + end +end +# [END dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb new file mode 100644 index 000000000000..59940a81d6e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.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 dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_session_entity_type call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#update_session_entity_type. +# +def update_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new + + # Call the update_session_entity_type method. + result = client.update_session_entity_type request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + p result +end +# [END dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb new file mode 100644 index 000000000000..09af6a248ce9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.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 dialogflow_v2_generated_Sessions_DetectIntent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the detect_intent call in the Sessions 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::Dialogflow::V2::Sessions::Client#detect_intent. +# +def detect_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Sessions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DetectIntentRequest.new + + # Call the detect_intent method. + result = client.detect_intent request + + # The returned object is of type Google::Cloud::Dialogflow::V2::DetectIntentResponse. + p result +end +# [END dialogflow_v2_generated_Sessions_DetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb new file mode 100644 index 000000000000..74afa7ff9efe --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.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 dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the streaming_detect_intent call in the Sessions 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::Dialogflow::V2::Sessions::Client#streaming_detect_intent. +# +def streaming_detect_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Sessions::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the streaming_detect_intent method to start streaming. + output = client.streaming_detect_intent 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::Dialogflow::V2::StreamingDetectIntentRequest.new + input << Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse + output.each do |current_response| + p current_response + end +end +# [END dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/create_sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/create_sip_trunk.rb new file mode 100644 index 000000000000..9d69dd0f4f31 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/create_sip_trunk.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 dialogflow_v2_generated_SipTrunks_CreateSipTrunk_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_sip_trunk call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#create_sip_trunk. +# +def create_sip_trunk + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new + + # Call the create_sip_trunk method. + result = client.create_sip_trunk request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. + p result +end +# [END dialogflow_v2_generated_SipTrunks_CreateSipTrunk_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/delete_sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/delete_sip_trunk.rb new file mode 100644 index 000000000000..b19bf83621a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/delete_sip_trunk.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 dialogflow_v2_generated_SipTrunks_DeleteSipTrunk_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_sip_trunk call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#delete_sip_trunk. +# +def delete_sip_trunk + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new + + # Call the delete_sip_trunk method. + result = client.delete_sip_trunk request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_SipTrunks_DeleteSipTrunk_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/get_sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/get_sip_trunk.rb new file mode 100644 index 000000000000..94e56b866ff4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/get_sip_trunk.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 dialogflow_v2_generated_SipTrunks_GetSipTrunk_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_sip_trunk call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#get_sip_trunk. +# +def get_sip_trunk + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new + + # Call the get_sip_trunk method. + result = client.get_sip_trunk request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. + p result +end +# [END dialogflow_v2_generated_SipTrunks_GetSipTrunk_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/list_sip_trunks.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/list_sip_trunks.rb new file mode 100644 index 000000000000..30579a778ccf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/list_sip_trunks.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 dialogflow_v2_generated_SipTrunks_ListSipTrunks_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_sip_trunks call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#list_sip_trunks. +# +def list_sip_trunks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.new + + # Call the list_sip_trunks method. + result = client.list_sip_trunks 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::Dialogflow::V2::SipTrunk. + p item + end +end +# [END dialogflow_v2_generated_SipTrunks_ListSipTrunks_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/update_sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/update_sip_trunk.rb new file mode 100644 index 000000000000..4b4b85fc8603 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/update_sip_trunk.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 dialogflow_v2_generated_SipTrunks_UpdateSipTrunk_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_sip_trunk call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#update_sip_trunk. +# +def update_sip_trunk + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new + + # Call the update_sip_trunk method. + result = client.update_sip_trunk request + + # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. + p result +end +# [END dialogflow_v2_generated_SipTrunks_UpdateSipTrunk_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json new file mode 100644 index 000000000000..cbb9635bad3c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json @@ -0,0 +1,5215 @@ +{ + "client_library": { + "name": "google-cloud-dialogflow-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.dialogflow.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "dialogflow_v2_generated_Agents_GetAgent_sync", + "title": "Snippet for the get_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#get_agent.", + "file": "agents/get_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_agent", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#get_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Agent", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" + }, + "method": { + "short_name": "GetAgent", + "full_name": "google.cloud.dialogflow.v2.Agents.GetAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.v2.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Agents_SetAgent_sync", + "title": "Snippet for the set_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#set_agent.", + "file": "agents/set_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_agent", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#set_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::SetAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Agent", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" + }, + "method": { + "short_name": "SetAgent", + "full_name": "google.cloud.dialogflow.v2.Agents.SetAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.v2.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Agents_DeleteAgent_sync", + "title": "Snippet for the delete_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#delete_agent.", + "file": "agents/delete_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_agent", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#delete_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" + }, + "method": { + "short_name": "DeleteAgent", + "full_name": "google.cloud.dialogflow.v2.Agents.DeleteAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.v2.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Agents_SearchAgents_sync", + "title": "Snippet for the search_agents call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#search_agents.", + "file": "agents/search_agents.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_agents", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#search_agents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::SearchAgentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SearchAgentsResponse", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" + }, + "method": { + "short_name": "SearchAgents", + "full_name": "google.cloud.dialogflow.v2.Agents.SearchAgents", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.v2.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Agents_TrainAgent_sync", + "title": "Snippet for the train_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#train_agent.", + "file": "agents/train_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "train_agent", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::TrainAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" + }, + "method": { + "short_name": "TrainAgent", + "full_name": "google.cloud.dialogflow.v2.Agents.TrainAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.v2.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Agents_ExportAgent_sync", + "title": "Snippet for the export_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#export_agent.", + "file": "agents/export_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_agent", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#export_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ExportAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" + }, + "method": { + "short_name": "ExportAgent", + "full_name": "google.cloud.dialogflow.v2.Agents.ExportAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.v2.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Agents_ImportAgent_sync", + "title": "Snippet for the import_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#import_agent.", + "file": "agents/import_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_agent", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#import_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ImportAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" + }, + "method": { + "short_name": "ImportAgent", + "full_name": "google.cloud.dialogflow.v2.Agents.ImportAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.v2.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Agents_RestoreAgent_sync", + "title": "Snippet for the restore_agent call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#restore_agent.", + "file": "agents/restore_agent.rb", + "language": "RUBY", + "client_method": { + "short_name": "restore_agent", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#restore_agent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::RestoreAgentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" + }, + "method": { + "short_name": "RestoreAgent", + "full_name": "google.cloud.dialogflow.v2.Agents.RestoreAgent", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.v2.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Agents_GetValidationResult_sync", + "title": "Snippet for the get_validation_result call in the Agents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#get_validation_result.", + "file": "agents/get_validation_result.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_validation_result", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#get_validation_result", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetValidationResultRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ValidationResult", + "client": { + "short_name": "Agents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" + }, + "method": { + "short_name": "GetValidationResult", + "full_name": "google.cloud.dialogflow.v2.Agents.GetValidationResult", + "service": { + "short_name": "Agents", + "full_name": "google.cloud.dialogflow.v2.Agents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Tools_CreateTool_sync", + "title": "Snippet for the create_tool call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#create_tool.", + "file": "tools/create_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_tool", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#create_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Tool", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" + }, + "method": { + "short_name": "CreateTool", + "full_name": "google.cloud.dialogflow.v2.Tools.CreateTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.v2.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Tools_GetTool_sync", + "title": "Snippet for the get_tool call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#get_tool.", + "file": "tools/get_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_tool", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#get_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Tool", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" + }, + "method": { + "short_name": "GetTool", + "full_name": "google.cloud.dialogflow.v2.Tools.GetTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.v2.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Tools_ListTools_sync", + "title": "Snippet for the list_tools call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#list_tools.", + "file": "tools/list_tools.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tools", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#list_tools", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListToolsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListToolsResponse", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" + }, + "method": { + "short_name": "ListTools", + "full_name": "google.cloud.dialogflow.v2.Tools.ListTools", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.v2.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Tools_DeleteTool_sync", + "title": "Snippet for the delete_tool call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#delete_tool.", + "file": "tools/delete_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_tool", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#delete_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" + }, + "method": { + "short_name": "DeleteTool", + "full_name": "google.cloud.dialogflow.v2.Tools.DeleteTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.v2.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Tools_UpdateTool_sync", + "title": "Snippet for the update_tool call in the Tools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#update_tool.", + "file": "tools/update_tool.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_tool", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#update_tool", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateToolRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Tool", + "client": { + "short_name": "Tools::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" + }, + "method": { + "short_name": "UpdateTool", + "full_name": "google.cloud.dialogflow.v2.Tools.UpdateTool", + "service": { + "short_name": "Tools", + "full_name": "google.cloud.dialogflow.v2.Tools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Generators_CreateGenerator_sync", + "title": "Snippet for the create_generator call in the Generators service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#create_generator.", + "file": "generators/create_generator.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_generator", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#create_generator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Generator", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" + }, + "method": { + "short_name": "CreateGenerator", + "full_name": "google.cloud.dialogflow.v2.Generators.CreateGenerator", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.v2.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Generators_GetGenerator_sync", + "title": "Snippet for the get_generator call in the Generators service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#get_generator.", + "file": "generators/get_generator.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_generator", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#get_generator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetGeneratorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Generator", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" + }, + "method": { + "short_name": "GetGenerator", + "full_name": "google.cloud.dialogflow.v2.Generators.GetGenerator", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.v2.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Generators_ListGenerators_sync", + "title": "Snippet for the list_generators call in the Generators service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#list_generators.", + "file": "generators/list_generators.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_generators", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#list_generators", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" + }, + "method": { + "short_name": "ListGenerators", + "full_name": "google.cloud.dialogflow.v2.Generators.ListGenerators", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.v2.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Generators_DeleteGenerator_sync", + "title": "Snippet for the delete_generator call in the Generators service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#delete_generator.", + "file": "generators/delete_generator.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_generator", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#delete_generator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" + }, + "method": { + "short_name": "DeleteGenerator", + "full_name": "google.cloud.dialogflow.v2.Generators.DeleteGenerator", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.v2.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Generators_UpdateGenerator_sync", + "title": "Snippet for the update_generator call in the Generators service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#update_generator.", + "file": "generators/update_generator.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_generator", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#update_generator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Generator", + "client": { + "short_name": "Generators::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" + }, + "method": { + "short_name": "UpdateGenerator", + "full_name": "google.cloud.dialogflow.v2.Generators.UpdateGenerator", + "service": { + "short_name": "Generators", + "full_name": "google.cloud.dialogflow.v2.Generators" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Contexts_ListContexts_sync", + "title": "Snippet for the list_contexts call in the Contexts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#list_contexts.", + "file": "contexts/list_contexts.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_contexts", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#list_contexts", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListContextsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListContextsResponse", + "client": { + "short_name": "Contexts::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" + }, + "method": { + "short_name": "ListContexts", + "full_name": "google.cloud.dialogflow.v2.Contexts.ListContexts", + "service": { + "short_name": "Contexts", + "full_name": "google.cloud.dialogflow.v2.Contexts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Contexts_GetContext_sync", + "title": "Snippet for the get_context call in the Contexts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#get_context.", + "file": "contexts/get_context.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_context", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#get_context", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetContextRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Context", + "client": { + "short_name": "Contexts::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" + }, + "method": { + "short_name": "GetContext", + "full_name": "google.cloud.dialogflow.v2.Contexts.GetContext", + "service": { + "short_name": "Contexts", + "full_name": "google.cloud.dialogflow.v2.Contexts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Contexts_CreateContext_sync", + "title": "Snippet for the create_context call in the Contexts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#create_context.", + "file": "contexts/create_context.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_context", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#create_context", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateContextRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Context", + "client": { + "short_name": "Contexts::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" + }, + "method": { + "short_name": "CreateContext", + "full_name": "google.cloud.dialogflow.v2.Contexts.CreateContext", + "service": { + "short_name": "Contexts", + "full_name": "google.cloud.dialogflow.v2.Contexts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Contexts_UpdateContext_sync", + "title": "Snippet for the update_context call in the Contexts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#update_context.", + "file": "contexts/update_context.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_context", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#update_context", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateContextRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Context", + "client": { + "short_name": "Contexts::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" + }, + "method": { + "short_name": "UpdateContext", + "full_name": "google.cloud.dialogflow.v2.Contexts.UpdateContext", + "service": { + "short_name": "Contexts", + "full_name": "google.cloud.dialogflow.v2.Contexts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Contexts_DeleteContext_sync", + "title": "Snippet for the delete_context call in the Contexts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#delete_context.", + "file": "contexts/delete_context.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_context", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#delete_context", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteContextRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Contexts::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" + }, + "method": { + "short_name": "DeleteContext", + "full_name": "google.cloud.dialogflow.v2.Contexts.DeleteContext", + "service": { + "short_name": "Contexts", + "full_name": "google.cloud.dialogflow.v2.Contexts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Contexts_DeleteAllContexts_sync", + "title": "Snippet for the delete_all_contexts call in the Contexts service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#delete_all_contexts.", + "file": "contexts/delete_all_contexts.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_all_contexts", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#delete_all_contexts", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Contexts::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" + }, + "method": { + "short_name": "DeleteAllContexts", + "full_name": "google.cloud.dialogflow.v2.Contexts.DeleteAllContexts", + "service": { + "short_name": "Contexts", + "full_name": "google.cloud.dialogflow.v2.Contexts" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Intents_ListIntents_sync", + "title": "Snippet for the list_intents call in the Intents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#list_intents.", + "file": "intents/list_intents.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_intents", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#list_intents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListIntentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListIntentsResponse", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" + }, + "method": { + "short_name": "ListIntents", + "full_name": "google.cloud.dialogflow.v2.Intents.ListIntents", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.v2.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Intents_GetIntent_sync", + "title": "Snippet for the get_intent call in the Intents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#get_intent.", + "file": "intents/get_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_intent", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#get_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Intent", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" + }, + "method": { + "short_name": "GetIntent", + "full_name": "google.cloud.dialogflow.v2.Intents.GetIntent", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.v2.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Intents_CreateIntent_sync", + "title": "Snippet for the create_intent call in the Intents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#create_intent.", + "file": "intents/create_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_intent", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#create_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Intent", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" + }, + "method": { + "short_name": "CreateIntent", + "full_name": "google.cloud.dialogflow.v2.Intents.CreateIntent", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.v2.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Intents_UpdateIntent_sync", + "title": "Snippet for the update_intent call in the Intents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#update_intent.", + "file": "intents/update_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_intent", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#update_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Intent", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" + }, + "method": { + "short_name": "UpdateIntent", + "full_name": "google.cloud.dialogflow.v2.Intents.UpdateIntent", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.v2.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Intents_DeleteIntent_sync", + "title": "Snippet for the delete_intent call in the Intents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#delete_intent.", + "file": "intents/delete_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_intent", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#delete_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" + }, + "method": { + "short_name": "DeleteIntent", + "full_name": "google.cloud.dialogflow.v2.Intents.DeleteIntent", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.v2.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Intents_BatchUpdateIntents_sync", + "title": "Snippet for the batch_update_intents call in the Intents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents.", + "file": "intents/batch_update_intents.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_update_intents", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" + }, + "method": { + "short_name": "BatchUpdateIntents", + "full_name": "google.cloud.dialogflow.v2.Intents.BatchUpdateIntents", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.v2.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Intents_BatchDeleteIntents_sync", + "title": "Snippet for the batch_delete_intents call in the Intents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#batch_delete_intents.", + "file": "intents/batch_delete_intents.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_delete_intents", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#batch_delete_intents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Intents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" + }, + "method": { + "short_name": "BatchDeleteIntents", + "full_name": "google.cloud.dialogflow.v2.Intents.BatchDeleteIntents", + "service": { + "short_name": "Intents", + "full_name": "google.cloud.dialogflow.v2.Intents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync", + "title": "Snippet for the list_entity_types call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#list_entity_types.", + "file": "entity_types/list_entity_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_entity_types", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#list_entity_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "ListEntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_GetEntityType_sync", + "title": "Snippet for the get_entity_type call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#get_entity_type.", + "file": "entity_types/get_entity_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_entity_type", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#get_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::EntityType", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "GetEntityType", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.GetEntityType", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_CreateEntityType_sync", + "title": "Snippet for the create_entity_type call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#create_entity_type.", + "file": "entity_types/create_entity_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_entity_type", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#create_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::EntityType", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "CreateEntityType", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.CreateEntityType", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync", + "title": "Snippet for the update_entity_type call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#update_entity_type.", + "file": "entity_types/update_entity_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_entity_type", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#update_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::EntityType", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "UpdateEntityType", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync", + "title": "Snippet for the delete_entity_type call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#delete_entity_type.", + "file": "entity_types/delete_entity_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_entity_type", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#delete_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "DeleteEntityType", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.DeleteEntityType", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync", + "title": "Snippet for the batch_update_entity_types call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types.", + "file": "entity_types/batch_update_entity_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_update_entity_types", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "BatchUpdateEntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync", + "title": "Snippet for the batch_delete_entity_types call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entity_types.", + "file": "entity_types/batch_delete_entity_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_delete_entity_types", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entity_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "BatchDeleteEntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypes", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync", + "title": "Snippet for the batch_create_entities call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_create_entities.", + "file": "entity_types/batch_create_entities.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_create_entities", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_create_entities", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "BatchCreateEntities", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntities", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync", + "title": "Snippet for the batch_update_entities call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entities.", + "file": "entity_types/batch_update_entities.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_update_entities", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entities", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "BatchUpdateEntities", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntities", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync", + "title": "Snippet for the batch_delete_entities call in the EntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entities.", + "file": "entity_types/batch_delete_entities.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_delete_entities", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entities", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" + }, + "method": { + "short_name": "BatchDeleteEntities", + "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntities", + "service": { + "short_name": "EntityTypes", + "full_name": "google.cloud.dialogflow.v2.EntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync", + "title": "Snippet for the list_session_entity_types call in the SessionEntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types.", + "file": "session_entity_types/list_session_entity_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_session_entity_types", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" + }, + "method": { + "short_name": "ListSessionEntityTypes", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync", + "title": "Snippet for the get_session_entity_type call in the SessionEntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#get_session_entity_type.", + "file": "session_entity_types/get_session_entity_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_session_entity_type", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#get_session_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SessionEntityType", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" + }, + "method": { + "short_name": "GetSessionEntityType", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityType", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync", + "title": "Snippet for the create_session_entity_type call in the SessionEntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#create_session_entity_type.", + "file": "session_entity_types/create_session_entity_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_session_entity_type", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#create_session_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SessionEntityType", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" + }, + "method": { + "short_name": "CreateSessionEntityType", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityType", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync", + "title": "Snippet for the update_session_entity_type call in the SessionEntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#update_session_entity_type.", + "file": "session_entity_types/update_session_entity_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_session_entity_type", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#update_session_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SessionEntityType", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" + }, + "method": { + "short_name": "UpdateSessionEntityType", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityType", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync", + "title": "Snippet for the delete_session_entity_type call in the SessionEntityTypes service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#delete_session_entity_type.", + "file": "session_entity_types/delete_session_entity_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_session_entity_type", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#delete_session_entity_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SessionEntityTypes::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" + }, + "method": { + "short_name": "DeleteSessionEntityType", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityType", + "service": { + "short_name": "SessionEntityTypes", + "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Sessions_DetectIntent_sync", + "title": "Snippet for the detect_intent call in the Sessions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent.", + "file": "sessions/detect_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "detect_intent", + "full_name": "::Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DetectIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::DetectIntentResponse", + "client": { + "short_name": "Sessions::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Sessions::Client" + }, + "method": { + "short_name": "DetectIntent", + "full_name": "google.cloud.dialogflow.v2.Sessions.DetectIntent", + "service": { + "short_name": "Sessions", + "full_name": "google.cloud.dialogflow.v2.Sessions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync", + "title": "Snippet for the streaming_detect_intent call in the Sessions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent.", + "file": "sessions/streaming_detect_intent.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_detect_intent", + "full_name": "::Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse", + "client": { + "short_name": "Sessions::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Sessions::Client" + }, + "method": { + "short_name": "StreamingDetectIntent", + "full_name": "google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent", + "service": { + "short_name": "Sessions", + "full_name": "google.cloud.dialogflow.v2.Sessions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_CreateParticipant_sync", + "title": "Snippet for the create_participant call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#create_participant.", + "file": "participants/create_participant.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_participant", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#create_participant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateParticipantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Participant", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "CreateParticipant", + "full_name": "google.cloud.dialogflow.v2.Participants.CreateParticipant", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_GetParticipant_sync", + "title": "Snippet for the get_participant call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#get_participant.", + "file": "participants/get_participant.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_participant", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#get_participant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetParticipantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Participant", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "GetParticipant", + "full_name": "google.cloud.dialogflow.v2.Participants.GetParticipant", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_ListParticipants_sync", + "title": "Snippet for the list_participants call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#list_participants.", + "file": "participants/list_participants.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_participants", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#list_participants", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListParticipantsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListParticipantsResponse", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "ListParticipants", + "full_name": "google.cloud.dialogflow.v2.Participants.ListParticipants", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_UpdateParticipant_sync", + "title": "Snippet for the update_participant call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#update_participant.", + "file": "participants/update_participant.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_participant", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#update_participant", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Participant", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "UpdateParticipant", + "full_name": "google.cloud.dialogflow.v2.Participants.UpdateParticipant", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_AnalyzeContent_sync", + "title": "Snippet for the analyze_content call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content.", + "file": "participants/analyze_content.rb", + "language": "RUBY", + "client_method": { + "short_name": "analyze_content", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "AnalyzeContent", + "full_name": "google.cloud.dialogflow.v2.Participants.AnalyzeContent", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync", + "title": "Snippet for the streaming_analyze_content call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content.", + "file": "participants/streaming_analyze_content.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_analyze_content", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "StreamingAnalyzeContent", + "full_name": "google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_SuggestArticles_sync", + "title": "Snippet for the suggest_articles call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles.", + "file": "participants/suggest_articles.rb", + "language": "RUBY", + "client_method": { + "short_name": "suggest_articles", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "SuggestArticles", + "full_name": "google.cloud.dialogflow.v2.Participants.SuggestArticles", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync", + "title": "Snippet for the suggest_faq_answers call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#suggest_faq_answers.", + "file": "participants/suggest_faq_answers.rb", + "language": "RUBY", + "client_method": { + "short_name": "suggest_faq_answers", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_faq_answers", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "SuggestFaqAnswers", + "full_name": "google.cloud.dialogflow.v2.Participants.SuggestFaqAnswers", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_SuggestSmartReplies_sync", + "title": "Snippet for the suggest_smart_replies call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#suggest_smart_replies.", + "file": "participants/suggest_smart_replies.rb", + "language": "RUBY", + "client_method": { + "short_name": "suggest_smart_replies", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_smart_replies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "SuggestSmartReplies", + "full_name": "google.cloud.dialogflow.v2.Participants.SuggestSmartReplies", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Participants_SuggestKnowledgeAssist_sync", + "title": "Snippet for the suggest_knowledge_assist call in the Participants service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist.", + "file": "participants/suggest_knowledge_assist.rb", + "language": "RUBY", + "client_method": { + "short_name": "suggest_knowledge_assist", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "SuggestKnowledgeAssist", + "full_name": "google.cloud.dialogflow.v2.Participants.SuggestKnowledgeAssist", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync", + "title": "Snippet for the list_answer_records call in the AnswerRecords service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records.", + "file": "answer_records/list_answer_records.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_answer_records", + "full_name": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse", + "client": { + "short_name": "AnswerRecords::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client" + }, + "method": { + "short_name": "ListAnswerRecords", + "full_name": "google.cloud.dialogflow.v2.AnswerRecords.ListAnswerRecords", + "service": { + "short_name": "AnswerRecords", + "full_name": "google.cloud.dialogflow.v2.AnswerRecords" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync", + "title": "Snippet for the update_answer_record call in the AnswerRecords service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record.", + "file": "answer_records/update_answer_record.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_answer_record", + "full_name": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::AnswerRecord", + "client": { + "short_name": "AnswerRecords::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client" + }, + "method": { + "short_name": "UpdateAnswerRecord", + "full_name": "google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord", + "service": { + "short_name": "AnswerRecords", + "full_name": "google.cloud.dialogflow.v2.AnswerRecords" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync", + "title": "Snippet for the list_conversation_profiles call in the ConversationProfiles service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles.", + "file": "conversation_profiles/list_conversation_profiles.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_conversation_profiles", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse", + "client": { + "short_name": "ConversationProfiles::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" + }, + "method": { + "short_name": "ListConversationProfiles", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.ListConversationProfiles", + "service": { + "short_name": "ConversationProfiles", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync", + "title": "Snippet for the get_conversation_profile call in the ConversationProfiles service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile.", + "file": "conversation_profiles/get_conversation_profile.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_conversation_profile", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ConversationProfile", + "client": { + "short_name": "ConversationProfiles::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" + }, + "method": { + "short_name": "GetConversationProfile", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile", + "service": { + "short_name": "ConversationProfiles", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync", + "title": "Snippet for the create_conversation_profile call in the ConversationProfiles service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#create_conversation_profile.", + "file": "conversation_profiles/create_conversation_profile.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_conversation_profile", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#create_conversation_profile", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ConversationProfile", + "client": { + "short_name": "ConversationProfiles::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" + }, + "method": { + "short_name": "CreateConversationProfile", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.CreateConversationProfile", + "service": { + "short_name": "ConversationProfiles", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync", + "title": "Snippet for the update_conversation_profile call in the ConversationProfiles service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#update_conversation_profile.", + "file": "conversation_profiles/update_conversation_profile.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_conversation_profile", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#update_conversation_profile", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ConversationProfile", + "client": { + "short_name": "ConversationProfiles::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" + }, + "method": { + "short_name": "UpdateConversationProfile", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.UpdateConversationProfile", + "service": { + "short_name": "ConversationProfiles", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync", + "title": "Snippet for the delete_conversation_profile call in the ConversationProfiles service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#delete_conversation_profile.", + "file": "conversation_profiles/delete_conversation_profile.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_conversation_profile", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#delete_conversation_profile", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ConversationProfiles::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" + }, + "method": { + "short_name": "DeleteConversationProfile", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.DeleteConversationProfile", + "service": { + "short_name": "ConversationProfiles", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync", + "title": "Snippet for the set_suggestion_feature_config call in the ConversationProfiles service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config.", + "file": "conversation_profiles/set_suggestion_feature_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_suggestion_feature_config", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationProfiles::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" + }, + "method": { + "short_name": "SetSuggestionFeatureConfig", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.SetSuggestionFeatureConfig", + "service": { + "short_name": "ConversationProfiles", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync", + "title": "Snippet for the clear_suggestion_feature_config call in the ConversationProfiles service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config.", + "file": "conversation_profiles/clear_suggestion_feature_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "clear_suggestion_feature_config", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationProfiles::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" + }, + "method": { + "short_name": "ClearSuggestionFeatureConfig", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.ClearSuggestionFeatureConfig", + "service": { + "short_name": "ConversationProfiles", + "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_CreateConversation_sync", + "title": "Snippet for the create_conversation call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#create_conversation.", + "file": "conversations/create_conversation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_conversation", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#create_conversation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateConversationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Conversation", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "CreateConversation", + "full_name": "google.cloud.dialogflow.v2.Conversations.CreateConversation", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_ListConversations_sync", + "title": "Snippet for the list_conversations call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#list_conversations.", + "file": "conversations/list_conversations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_conversations", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#list_conversations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListConversationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationsResponse", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "ListConversations", + "full_name": "google.cloud.dialogflow.v2.Conversations.ListConversations", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_GetConversation_sync", + "title": "Snippet for the get_conversation call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#get_conversation.", + "file": "conversations/get_conversation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_conversation", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#get_conversation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetConversationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Conversation", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "GetConversation", + "full_name": "google.cloud.dialogflow.v2.Conversations.GetConversation", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_CompleteConversation_sync", + "title": "Snippet for the complete_conversation call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#complete_conversation.", + "file": "conversations/complete_conversation.rb", + "language": "RUBY", + "client_method": { + "short_name": "complete_conversation", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#complete_conversation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CompleteConversationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Conversation", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "CompleteConversation", + "full_name": "google.cloud.dialogflow.v2.Conversations.CompleteConversation", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_IngestContextReferences_sync", + "title": "Snippet for the ingest_context_references call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#ingest_context_references.", + "file": "conversations/ingest_context_references.rb", + "language": "RUBY", + "client_method": { + "short_name": "ingest_context_references", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#ingest_context_references", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "IngestContextReferences", + "full_name": "google.cloud.dialogflow.v2.Conversations.IngestContextReferences", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_ListMessages_sync", + "title": "Snippet for the list_messages call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages.", + "file": "conversations/list_messages.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_messages", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListMessagesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListMessagesResponse", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "ListMessages", + "full_name": "google.cloud.dialogflow.v2.Conversations.ListMessages", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_SuggestConversationSummary_sync", + "title": "Snippet for the suggest_conversation_summary call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#suggest_conversation_summary.", + "file": "conversations/suggest_conversation_summary.rb", + "language": "RUBY", + "client_method": { + "short_name": "suggest_conversation_summary", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#suggest_conversation_summary", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "SuggestConversationSummary", + "full_name": "google.cloud.dialogflow.v2.Conversations.SuggestConversationSummary", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_GenerateStatelessSummary_sync", + "title": "Snippet for the generate_stateless_summary call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_summary.", + "file": "conversations/generate_stateless_summary.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_stateless_summary", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_summary", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "GenerateStatelessSummary", + "full_name": "google.cloud.dialogflow.v2.Conversations.GenerateStatelessSummary", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync", + "title": "Snippet for the generate_stateless_suggestion call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion.", + "file": "conversations/generate_stateless_suggestion.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_stateless_suggestion", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "GenerateStatelessSuggestion", + "full_name": "google.cloud.dialogflow.v2.Conversations.GenerateStatelessSuggestion", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_SearchKnowledge_sync", + "title": "Snippet for the search_knowledge call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#search_knowledge.", + "file": "conversations/search_knowledge.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_knowledge", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#search_knowledge", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "SearchKnowledge", + "full_name": "google.cloud.dialogflow.v2.Conversations.SearchKnowledge", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Conversations_GenerateSuggestions_sync", + "title": "Snippet for the generate_suggestions call in the Conversations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#generate_suggestions.", + "file": "conversations/generate_suggestions.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_suggestions", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_suggestions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse", + "client": { + "short_name": "Conversations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" + }, + "method": { + "short_name": "GenerateSuggestions", + "full_name": "google.cloud.dialogflow.v2.Conversations.GenerateSuggestions", + "service": { + "short_name": "Conversations", + "full_name": "google.cloud.dialogflow.v2.Conversations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync", + "title": "Snippet for the create_conversation_dataset call in the ConversationDatasets service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#create_conversation_dataset.", + "file": "conversation_datasets/create_conversation_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_conversation_dataset", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#create_conversation_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationDatasets::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" + }, + "method": { + "short_name": "CreateConversationDataset", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.CreateConversationDataset", + "service": { + "short_name": "ConversationDatasets", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync", + "title": "Snippet for the get_conversation_dataset call in the ConversationDatasets service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#get_conversation_dataset.", + "file": "conversation_datasets/get_conversation_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_conversation_dataset", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#get_conversation_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ConversationDataset", + "client": { + "short_name": "ConversationDatasets::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" + }, + "method": { + "short_name": "GetConversationDataset", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.GetConversationDataset", + "service": { + "short_name": "ConversationDatasets", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync", + "title": "Snippet for the list_conversation_datasets call in the ConversationDatasets service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets.", + "file": "conversation_datasets/list_conversation_datasets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_conversation_datasets", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse", + "client": { + "short_name": "ConversationDatasets::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" + }, + "method": { + "short_name": "ListConversationDatasets", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets", + "service": { + "short_name": "ConversationDatasets", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync", + "title": "Snippet for the delete_conversation_dataset call in the ConversationDatasets service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#delete_conversation_dataset.", + "file": "conversation_datasets/delete_conversation_dataset.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_conversation_dataset", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#delete_conversation_dataset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationDatasets::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" + }, + "method": { + "short_name": "DeleteConversationDataset", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.DeleteConversationDataset", + "service": { + "short_name": "ConversationDatasets", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync", + "title": "Snippet for the import_conversation_data call in the ConversationDatasets service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data.", + "file": "conversation_datasets/import_conversation_data.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_conversation_data", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationDatasets::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" + }, + "method": { + "short_name": "ImportConversationData", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData", + "service": { + "short_name": "ConversationDatasets", + "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync", + "title": "Snippet for the create_conversation_model call in the ConversationModels service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model.", + "file": "conversation_models/create_conversation_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_conversation_model", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationModels::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" + }, + "method": { + "short_name": "CreateConversationModel", + "full_name": "google.cloud.dialogflow.v2.ConversationModels.CreateConversationModel", + "service": { + "short_name": "ConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationModels_GetConversationModel_sync", + "title": "Snippet for the get_conversation_model call in the ConversationModels service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model.", + "file": "conversation_models/get_conversation_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_conversation_model", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetConversationModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ConversationModel", + "client": { + "short_name": "ConversationModels::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" + }, + "method": { + "short_name": "GetConversationModel", + "full_name": "google.cloud.dialogflow.v2.ConversationModels.GetConversationModel", + "service": { + "short_name": "ConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationModels_ListConversationModels_sync", + "title": "Snippet for the list_conversation_models call in the ConversationModels service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_models.", + "file": "conversation_models/list_conversation_models.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_conversation_models", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_models", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse", + "client": { + "short_name": "ConversationModels::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" + }, + "method": { + "short_name": "ListConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels.ListConversationModels", + "service": { + "short_name": "ConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync", + "title": "Snippet for the delete_conversation_model call in the ConversationModels service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#delete_conversation_model.", + "file": "conversation_models/delete_conversation_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_conversation_model", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#delete_conversation_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationModels::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" + }, + "method": { + "short_name": "DeleteConversationModel", + "full_name": "google.cloud.dialogflow.v2.ConversationModels.DeleteConversationModel", + "service": { + "short_name": "ConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync", + "title": "Snippet for the deploy_conversation_model call in the ConversationModels service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model.", + "file": "conversation_models/deploy_conversation_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "deploy_conversation_model", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationModels::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" + }, + "method": { + "short_name": "DeployConversationModel", + "full_name": "google.cloud.dialogflow.v2.ConversationModels.DeployConversationModel", + "service": { + "short_name": "ConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync", + "title": "Snippet for the undeploy_conversation_model call in the ConversationModels service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model.", + "file": "conversation_models/undeploy_conversation_model.rb", + "language": "RUBY", + "client_method": { + "short_name": "undeploy_conversation_model", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationModels::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" + }, + "method": { + "short_name": "UndeployConversationModel", + "full_name": "google.cloud.dialogflow.v2.ConversationModels.UndeployConversationModel", + "service": { + "short_name": "ConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync", + "title": "Snippet for the get_conversation_model_evaluation call in the ConversationModels service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model_evaluation.", + "file": "conversation_models/get_conversation_model_evaluation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_conversation_model_evaluation", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model_evaluation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation", + "client": { + "short_name": "ConversationModels::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" + }, + "method": { + "short_name": "GetConversationModelEvaluation", + "full_name": "google.cloud.dialogflow.v2.ConversationModels.GetConversationModelEvaluation", + "service": { + "short_name": "ConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync", + "title": "Snippet for the list_conversation_model_evaluations call in the ConversationModels service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations.", + "file": "conversation_models/list_conversation_model_evaluations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_conversation_model_evaluations", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse", + "client": { + "short_name": "ConversationModels::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" + }, + "method": { + "short_name": "ListConversationModelEvaluations", + "full_name": "google.cloud.dialogflow.v2.ConversationModels.ListConversationModelEvaluations", + "service": { + "short_name": "ConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync", + "title": "Snippet for the create_conversation_model_evaluation call in the ConversationModels service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation.", + "file": "conversation_models/create_conversation_model_evaluation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_conversation_model_evaluation", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ConversationModels::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" + }, + "method": { + "short_name": "CreateConversationModelEvaluation", + "full_name": "google.cloud.dialogflow.v2.ConversationModels.CreateConversationModelEvaluation", + "service": { + "short_name": "ConversationModels", + "full_name": "google.cloud.dialogflow.v2.ConversationModels" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Documents_ListDocuments_sync", + "title": "Snippet for the list_documents call in the Documents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#list_documents.", + "file": "documents/list_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_documents", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#list_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListDocumentsResponse", + "client": { + "short_name": "Documents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" + }, + "method": { + "short_name": "ListDocuments", + "full_name": "google.cloud.dialogflow.v2.Documents.ListDocuments", + "service": { + "short_name": "Documents", + "full_name": "google.cloud.dialogflow.v2.Documents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Documents_GetDocument_sync", + "title": "Snippet for the get_document call in the Documents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#get_document.", + "file": "documents/get_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_document", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#get_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Document", + "client": { + "short_name": "Documents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" + }, + "method": { + "short_name": "GetDocument", + "full_name": "google.cloud.dialogflow.v2.Documents.GetDocument", + "service": { + "short_name": "Documents", + "full_name": "google.cloud.dialogflow.v2.Documents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Documents_CreateDocument_sync", + "title": "Snippet for the create_document call in the Documents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#create_document.", + "file": "documents/create_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_document", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#create_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Documents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" + }, + "method": { + "short_name": "CreateDocument", + "full_name": "google.cloud.dialogflow.v2.Documents.CreateDocument", + "service": { + "short_name": "Documents", + "full_name": "google.cloud.dialogflow.v2.Documents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Documents_ImportDocuments_sync", + "title": "Snippet for the import_documents call in the Documents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#import_documents.", + "file": "documents/import_documents.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_documents", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#import_documents", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Documents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" + }, + "method": { + "short_name": "ImportDocuments", + "full_name": "google.cloud.dialogflow.v2.Documents.ImportDocuments", + "service": { + "short_name": "Documents", + "full_name": "google.cloud.dialogflow.v2.Documents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Documents_DeleteDocument_sync", + "title": "Snippet for the delete_document call in the Documents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#delete_document.", + "file": "documents/delete_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_document", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#delete_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Documents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" + }, + "method": { + "short_name": "DeleteDocument", + "full_name": "google.cloud.dialogflow.v2.Documents.DeleteDocument", + "service": { + "short_name": "Documents", + "full_name": "google.cloud.dialogflow.v2.Documents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Documents_UpdateDocument_sync", + "title": "Snippet for the update_document call in the Documents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#update_document.", + "file": "documents/update_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_document", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#update_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Documents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" + }, + "method": { + "short_name": "UpdateDocument", + "full_name": "google.cloud.dialogflow.v2.Documents.UpdateDocument", + "service": { + "short_name": "Documents", + "full_name": "google.cloud.dialogflow.v2.Documents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Documents_ReloadDocument_sync", + "title": "Snippet for the reload_document call in the Documents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#reload_document.", + "file": "documents/reload_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "reload_document", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#reload_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Documents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" + }, + "method": { + "short_name": "ReloadDocument", + "full_name": "google.cloud.dialogflow.v2.Documents.ReloadDocument", + "service": { + "short_name": "Documents", + "full_name": "google.cloud.dialogflow.v2.Documents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Documents_ExportDocument_sync", + "title": "Snippet for the export_document call in the Documents service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#export_document.", + "file": "documents/export_document.rb", + "language": "RUBY", + "client_method": { + "short_name": "export_document", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#export_document", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ExportDocumentRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Documents::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" + }, + "method": { + "short_name": "ExportDocument", + "full_name": "google.cloud.dialogflow.v2.Documents.ExportDocument", + "service": { + "short_name": "Documents", + "full_name": "google.cloud.dialogflow.v2.Documents" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync", + "title": "Snippet for the get_encryption_spec call in the EncryptionSpecService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client#get_encryption_spec.", + "file": "encryption_spec_service/get_encryption_spec.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_encryption_spec", + "full_name": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client#get_encryption_spec", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::EncryptionSpec", + "client": { + "short_name": "EncryptionSpecService::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client" + }, + "method": { + "short_name": "GetEncryptionSpec", + "full_name": "google.cloud.dialogflow.v2.EncryptionSpecService.GetEncryptionSpec", + "service": { + "short_name": "EncryptionSpecService", + "full_name": "google.cloud.dialogflow.v2.EncryptionSpecService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync", + "title": "Snippet for the initialize_encryption_spec call in the EncryptionSpecService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client#initialize_encryption_spec.", + "file": "encryption_spec_service/initialize_encryption_spec.rb", + "language": "RUBY", + "client_method": { + "short_name": "initialize_encryption_spec", + "full_name": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client#initialize_encryption_spec", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "EncryptionSpecService::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client" + }, + "method": { + "short_name": "InitializeEncryptionSpec", + "full_name": "google.cloud.dialogflow.v2.EncryptionSpecService.InitializeEncryptionSpec", + "service": { + "short_name": "EncryptionSpecService", + "full_name": "google.cloud.dialogflow.v2.EncryptionSpecService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Fulfillments_GetFulfillment_sync", + "title": "Snippet for the get_fulfillment call in the Fulfillments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Fulfillments::Client#get_fulfillment.", + "file": "fulfillments/get_fulfillment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_fulfillment", + "full_name": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client#get_fulfillment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Fulfillment", + "client": { + "short_name": "Fulfillments::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client" + }, + "method": { + "short_name": "GetFulfillment", + "full_name": "google.cloud.dialogflow.v2.Fulfillments.GetFulfillment", + "service": { + "short_name": "Fulfillments", + "full_name": "google.cloud.dialogflow.v2.Fulfillments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync", + "title": "Snippet for the update_fulfillment call in the Fulfillments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Fulfillments::Client#update_fulfillment.", + "file": "fulfillments/update_fulfillment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_fulfillment", + "full_name": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client#update_fulfillment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Fulfillment", + "client": { + "short_name": "Fulfillments::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client" + }, + "method": { + "short_name": "UpdateFulfillment", + "full_name": "google.cloud.dialogflow.v2.Fulfillments.UpdateFulfillment", + "service": { + "short_name": "Fulfillments", + "full_name": "google.cloud.dialogflow.v2.Fulfillments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Environments_ListEnvironments_sync", + "title": "Snippet for the list_environments call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#list_environments.", + "file": "environments/list_environments.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_environments", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#list_environments", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" + }, + "method": { + "short_name": "ListEnvironments", + "full_name": "google.cloud.dialogflow.v2.Environments.ListEnvironments", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.v2.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Environments_GetEnvironment_sync", + "title": "Snippet for the get_environment call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#get_environment.", + "file": "environments/get_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_environment", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Environment", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" + }, + "method": { + "short_name": "GetEnvironment", + "full_name": "google.cloud.dialogflow.v2.Environments.GetEnvironment", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.v2.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Environments_CreateEnvironment_sync", + "title": "Snippet for the create_environment call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#create_environment.", + "file": "environments/create_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_environment", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#create_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Environment", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" + }, + "method": { + "short_name": "CreateEnvironment", + "full_name": "google.cloud.dialogflow.v2.Environments.CreateEnvironment", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.v2.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Environments_UpdateEnvironment_sync", + "title": "Snippet for the update_environment call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#update_environment.", + "file": "environments/update_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_environment", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#update_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Environment", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" + }, + "method": { + "short_name": "UpdateEnvironment", + "full_name": "google.cloud.dialogflow.v2.Environments.UpdateEnvironment", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.v2.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Environments_DeleteEnvironment_sync", + "title": "Snippet for the delete_environment call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#delete_environment.", + "file": "environments/delete_environment.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_environment", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#delete_environment", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" + }, + "method": { + "short_name": "DeleteEnvironment", + "full_name": "google.cloud.dialogflow.v2.Environments.DeleteEnvironment", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.v2.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync", + "title": "Snippet for the get_environment_history call in the Environments service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#get_environment_history.", + "file": "environments/get_environment_history.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_environment_history", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment_history", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::EnvironmentHistory", + "client": { + "short_name": "Environments::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" + }, + "method": { + "short_name": "GetEnvironmentHistory", + "full_name": "google.cloud.dialogflow.v2.Environments.GetEnvironmentHistory", + "service": { + "short_name": "Environments", + "full_name": "google.cloud.dialogflow.v2.Environments" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_GeneratorEvaluations_CreateGeneratorEvaluation_sync", + "title": "Snippet for the create_generator_evaluation call in the GeneratorEvaluations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#create_generator_evaluation.", + "file": "generator_evaluations/create_generator_evaluation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_generator_evaluation", + "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#create_generator_evaluation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "GeneratorEvaluations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client" + }, + "method": { + "short_name": "CreateGeneratorEvaluation", + "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations.CreateGeneratorEvaluation", + "service": { + "short_name": "GeneratorEvaluations", + "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_GeneratorEvaluations_GetGeneratorEvaluation_sync", + "title": "Snippet for the get_generator_evaluation call in the GeneratorEvaluations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#get_generator_evaluation.", + "file": "generator_evaluations/get_generator_evaluation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_generator_evaluation", + "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#get_generator_evaluation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluation", + "client": { + "short_name": "GeneratorEvaluations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client" + }, + "method": { + "short_name": "GetGeneratorEvaluation", + "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations.GetGeneratorEvaluation", + "service": { + "short_name": "GeneratorEvaluations", + "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_GeneratorEvaluations_ListGeneratorEvaluations_sync", + "title": "Snippet for the list_generator_evaluations call in the GeneratorEvaluations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#list_generator_evaluations.", + "file": "generator_evaluations/list_generator_evaluations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_generator_evaluations", + "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#list_generator_evaluations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse", + "client": { + "short_name": "GeneratorEvaluations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client" + }, + "method": { + "short_name": "ListGeneratorEvaluations", + "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations.ListGeneratorEvaluations", + "service": { + "short_name": "GeneratorEvaluations", + "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_GeneratorEvaluations_DeleteGeneratorEvaluation_sync", + "title": "Snippet for the delete_generator_evaluation call in the GeneratorEvaluations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#delete_generator_evaluation.", + "file": "generator_evaluations/delete_generator_evaluation.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_generator_evaluation", + "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#delete_generator_evaluation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "GeneratorEvaluations::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client" + }, + "method": { + "short_name": "DeleteGeneratorEvaluation", + "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations.DeleteGeneratorEvaluation", + "service": { + "short_name": "GeneratorEvaluations", + "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync", + "title": "Snippet for the list_knowledge_bases call in the KnowledgeBases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases.", + "file": "knowledge_bases/list_knowledge_bases.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_knowledge_bases", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse", + "client": { + "short_name": "KnowledgeBases::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" + }, + "method": { + "short_name": "ListKnowledgeBases", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.ListKnowledgeBases", + "service": { + "short_name": "KnowledgeBases", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync", + "title": "Snippet for the get_knowledge_base call in the KnowledgeBases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#get_knowledge_base.", + "file": "knowledge_bases/get_knowledge_base.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_knowledge_base", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#get_knowledge_base", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::KnowledgeBase", + "client": { + "short_name": "KnowledgeBases::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" + }, + "method": { + "short_name": "GetKnowledgeBase", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.GetKnowledgeBase", + "service": { + "short_name": "KnowledgeBases", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync", + "title": "Snippet for the create_knowledge_base call in the KnowledgeBases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#create_knowledge_base.", + "file": "knowledge_bases/create_knowledge_base.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_knowledge_base", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#create_knowledge_base", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::KnowledgeBase", + "client": { + "short_name": "KnowledgeBases::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" + }, + "method": { + "short_name": "CreateKnowledgeBase", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.CreateKnowledgeBase", + "service": { + "short_name": "KnowledgeBases", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync", + "title": "Snippet for the delete_knowledge_base call in the KnowledgeBases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#delete_knowledge_base.", + "file": "knowledge_bases/delete_knowledge_base.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_knowledge_base", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#delete_knowledge_base", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "KnowledgeBases::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" + }, + "method": { + "short_name": "DeleteKnowledgeBase", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.DeleteKnowledgeBase", + "service": { + "short_name": "KnowledgeBases", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync", + "title": "Snippet for the update_knowledge_base call in the KnowledgeBases service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#update_knowledge_base.", + "file": "knowledge_bases/update_knowledge_base.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_knowledge_base", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#update_knowledge_base", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::KnowledgeBase", + "client": { + "short_name": "KnowledgeBases::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" + }, + "method": { + "short_name": "UpdateKnowledgeBase", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.UpdateKnowledgeBase", + "service": { + "short_name": "KnowledgeBases", + "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SipTrunks_CreateSipTrunk_sync", + "title": "Snippet for the create_sip_trunk call in the SipTrunks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#create_sip_trunk.", + "file": "sip_trunks/create_sip_trunk.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_sip_trunk", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#create_sip_trunk", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SipTrunk", + "client": { + "short_name": "SipTrunks::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" + }, + "method": { + "short_name": "CreateSipTrunk", + "full_name": "google.cloud.dialogflow.v2.SipTrunks.CreateSipTrunk", + "service": { + "short_name": "SipTrunks", + "full_name": "google.cloud.dialogflow.v2.SipTrunks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SipTrunks_DeleteSipTrunk_sync", + "title": "Snippet for the delete_sip_trunk call in the SipTrunks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#delete_sip_trunk.", + "file": "sip_trunks/delete_sip_trunk.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_sip_trunk", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#delete_sip_trunk", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SipTrunks::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" + }, + "method": { + "short_name": "DeleteSipTrunk", + "full_name": "google.cloud.dialogflow.v2.SipTrunks.DeleteSipTrunk", + "service": { + "short_name": "SipTrunks", + "full_name": "google.cloud.dialogflow.v2.SipTrunks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SipTrunks_ListSipTrunks_sync", + "title": "Snippet for the list_sip_trunks call in the SipTrunks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#list_sip_trunks.", + "file": "sip_trunks/list_sip_trunks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sip_trunks", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#list_sip_trunks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse", + "client": { + "short_name": "SipTrunks::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" + }, + "method": { + "short_name": "ListSipTrunks", + "full_name": "google.cloud.dialogflow.v2.SipTrunks.ListSipTrunks", + "service": { + "short_name": "SipTrunks", + "full_name": "google.cloud.dialogflow.v2.SipTrunks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SipTrunks_GetSipTrunk_sync", + "title": "Snippet for the get_sip_trunk call in the SipTrunks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#get_sip_trunk.", + "file": "sip_trunks/get_sip_trunk.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_sip_trunk", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#get_sip_trunk", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SipTrunk", + "client": { + "short_name": "SipTrunks::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" + }, + "method": { + "short_name": "GetSipTrunk", + "full_name": "google.cloud.dialogflow.v2.SipTrunks.GetSipTrunk", + "service": { + "short_name": "SipTrunks", + "full_name": "google.cloud.dialogflow.v2.SipTrunks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_SipTrunks_UpdateSipTrunk_sync", + "title": "Snippet for the update_sip_trunk call in the SipTrunks service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#update_sip_trunk.", + "file": "sip_trunks/update_sip_trunk.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_sip_trunk", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#update_sip_trunk", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::SipTrunk", + "client": { + "short_name": "SipTrunks::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" + }, + "method": { + "short_name": "UpdateSipTrunk", + "full_name": "google.cloud.dialogflow.v2.SipTrunks.UpdateSipTrunk", + "service": { + "short_name": "SipTrunks", + "full_name": "google.cloud.dialogflow.v2.SipTrunks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Versions_ListVersions_sync", + "title": "Snippet for the list_versions call in the Versions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#list_versions.", + "file": "versions/list_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_versions", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#list_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::ListVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::ListVersionsResponse", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" + }, + "method": { + "short_name": "ListVersions", + "full_name": "google.cloud.dialogflow.v2.Versions.ListVersions", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.v2.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Versions_GetVersion_sync", + "title": "Snippet for the get_version call in the Versions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#get_version.", + "file": "versions/get_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_version", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#get_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::GetVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Version", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" + }, + "method": { + "short_name": "GetVersion", + "full_name": "google.cloud.dialogflow.v2.Versions.GetVersion", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.v2.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Versions_CreateVersion_sync", + "title": "Snippet for the create_version call in the Versions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#create_version.", + "file": "versions/create_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_version", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#create_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::CreateVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Version", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" + }, + "method": { + "short_name": "CreateVersion", + "full_name": "google.cloud.dialogflow.v2.Versions.CreateVersion", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.v2.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Versions_UpdateVersion_sync", + "title": "Snippet for the update_version call in the Versions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#update_version.", + "file": "versions/update_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_version", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#update_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::UpdateVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::Version", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" + }, + "method": { + "short_name": "UpdateVersion", + "full_name": "google.cloud.dialogflow.v2.Versions.UpdateVersion", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.v2.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "dialogflow_v2_generated_Versions_DeleteVersion_sync", + "title": "Snippet for the delete_version call in the Versions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#delete_version.", + "file": "versions/delete_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_version", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#delete_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::DeleteVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Versions::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" + }, + "method": { + "short_name": "DeleteVersion", + "full_name": "google.cloud.dialogflow.v2.Versions.DeleteVersion", + "service": { + "short_name": "Versions", + "full_name": "google.cloud.dialogflow.v2.Versions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/create_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/create_tool.rb new file mode 100644 index 000000000000..9c37709895de --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/create_tool.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 dialogflow_v2_generated_Tools_CreateTool_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_tool call in the Tools 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::Dialogflow::V2::Tools::Client#create_tool. +# +def create_tool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateToolRequest.new + + # Call the create_tool method. + result = client.create_tool request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. + p result +end +# [END dialogflow_v2_generated_Tools_CreateTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/delete_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/delete_tool.rb new file mode 100644 index 000000000000..3d32f46f5a25 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/delete_tool.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 dialogflow_v2_generated_Tools_DeleteTool_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_tool call in the Tools 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::Dialogflow::V2::Tools::Client#delete_tool. +# +def delete_tool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteToolRequest.new + + # Call the delete_tool method. + result = client.delete_tool request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_Tools_DeleteTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/get_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/get_tool.rb new file mode 100644 index 000000000000..890099d79715 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/get_tool.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 dialogflow_v2_generated_Tools_GetTool_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_tool call in the Tools 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::Dialogflow::V2::Tools::Client#get_tool. +# +def get_tool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetToolRequest.new + + # Call the get_tool method. + result = client.get_tool request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. + p result +end +# [END dialogflow_v2_generated_Tools_GetTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/list_tools.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/list_tools.rb new file mode 100644 index 000000000000..f0146a19c307 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/list_tools.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 dialogflow_v2_generated_Tools_ListTools_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_tools call in the Tools 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::Dialogflow::V2::Tools::Client#list_tools. +# +def list_tools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListToolsRequest.new + + # Call the list_tools method. + result = client.list_tools 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::Dialogflow::V2::Tool. + p item + end +end +# [END dialogflow_v2_generated_Tools_ListTools_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/update_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/update_tool.rb new file mode 100644 index 000000000000..d0de3f591e1e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/update_tool.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 dialogflow_v2_generated_Tools_UpdateTool_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_tool call in the Tools 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::Dialogflow::V2::Tools::Client#update_tool. +# +def update_tool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Tools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateToolRequest.new + + # Call the update_tool method. + result = client.update_tool request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. + p result +end +# [END dialogflow_v2_generated_Tools_UpdateTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/create_version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/create_version.rb new file mode 100644 index 000000000000..0f1816b5f8da --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/create_version.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 dialogflow_v2_generated_Versions_CreateVersion_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the create_version call in the Versions 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::Dialogflow::V2::Versions::Client#create_version. +# +def create_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateVersionRequest.new + + # Call the create_version method. + result = client.create_version request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + p result +end +# [END dialogflow_v2_generated_Versions_CreateVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb new file mode 100644 index 000000000000..dd6b98be1c70 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/delete_version.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 dialogflow_v2_generated_Versions_DeleteVersion_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the delete_version call in the Versions 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::Dialogflow::V2::Versions::Client#delete_version. +# +def delete_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new + + # Call the delete_version method. + result = client.delete_version request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END dialogflow_v2_generated_Versions_DeleteVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/get_version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/get_version.rb new file mode 100644 index 000000000000..ab37f93925db --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/get_version.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 dialogflow_v2_generated_Versions_GetVersion_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the get_version call in the Versions 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::Dialogflow::V2::Versions::Client#get_version. +# +def get_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetVersionRequest.new + + # Call the get_version method. + result = client.get_version request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + p result +end +# [END dialogflow_v2_generated_Versions_GetVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb new file mode 100644 index 000000000000..a7976a2a05e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/list_versions.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 dialogflow_v2_generated_Versions_ListVersions_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the list_versions call in the Versions 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::Dialogflow::V2::Versions::Client#list_versions. +# +def list_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListVersionsRequest.new + + # Call the list_versions method. + result = client.list_versions 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::Dialogflow::V2::Version. + p item + end +end +# [END dialogflow_v2_generated_Versions_ListVersions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/update_version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/update_version.rb new file mode 100644 index 000000000000..ec630cbf260d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/update_version.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 dialogflow_v2_generated_Versions_UpdateVersion_sync] +require "google/cloud/dialogflow/v2" + +## +# Snippet for the update_version call in the Versions 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::Dialogflow::V2::Versions::Client#update_version. +# +def update_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new + + # Call the update_version method. + result = client.update_version request + + # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + p result +end +# [END dialogflow_v2_generated_Versions_UpdateVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb new file mode 100644 index 000000000000..1c34bdaceec5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_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/dialogflow/v2/agent_pb" +require "google/cloud/dialogflow/v2/agent_services_pb" +require "google/cloud/dialogflow/v2/agents" + +class ::Google::Cloud::Dialogflow::V2::Agents::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 + c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb new file mode 100644 index 000000000000..b193742e1549 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/agents" + +class ::Google::Cloud::Dialogflow::V2::Agents::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_agent_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0" + assert_equal "projects/value0/agent", path + + path = client.agent_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/agent", 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::Dialogflow::V2::Agents::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_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::Dialogflow::V2::Agents::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-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb new file mode 100644 index 000000000000..bf58bab734bb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb @@ -0,0 +1,592 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/agent_pb" +require "google/cloud/dialogflow/v2/agents/rest" + + +class ::Google::Cloud::Dialogflow::V2::Agents::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_agent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Agent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + get_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_get_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_agent({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_agent parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_agent ::Google::Cloud::Dialogflow::V2::GetAgentRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_agent({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_agent(::Google::Cloud::Dialogflow::V2::GetAgentRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_agent_client_stub.call_count + end + end + end + + def test_set_agent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Agent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + agent = {} + update_mask = {} + + set_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_set_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.set_agent({ agent: agent, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.set_agent agent: agent, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.set_agent ::Google::Cloud::Dialogflow::V2::SetAgentRequest.new(agent: agent, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.set_agent({ agent: agent, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.set_agent(::Google::Cloud::Dialogflow::V2::SetAgentRequest.new(agent: agent, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_agent_client_stub.call_count + end + end + end + + def test_delete_agent + # 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. + parent = "hello world" + + delete_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_delete_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_agent({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_agent parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_agent ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_agent({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_agent(::Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_agent_client_stub.call_count + end + end + end + + def test_search_agents + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse.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" + + search_agents_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_search_agents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_agents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.search_agents({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.search_agents parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.search_agents ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest.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 + c.search_agents({ 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 + c.search_agents(::Google::Cloud::Dialogflow::V2::SearchAgentsRequest.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, search_agents_client_stub.call_count + end + end + end + + def test_train_agent + # 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" + + train_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_train_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, train_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.train_agent({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.train_agent parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.train_agent ::Google::Cloud::Dialogflow::V2::TrainAgentRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.train_agent({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.train_agent(::Google::Cloud::Dialogflow::V2::TrainAgentRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, train_agent_client_stub.call_count + end + end + end + + def test_export_agent + # 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" + agent_uri = "hello world" + + export_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_export_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.export_agent({ parent: parent, agent_uri: agent_uri }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.export_agent parent: parent, agent_uri: agent_uri do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.export_agent ::Google::Cloud::Dialogflow::V2::ExportAgentRequest.new(parent: parent, agent_uri: agent_uri) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.export_agent({ parent: parent, agent_uri: agent_uri }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.export_agent(::Google::Cloud::Dialogflow::V2::ExportAgentRequest.new(parent: parent, agent_uri: agent_uri), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_agent_client_stub.call_count + end + end + end + + def test_import_agent + # 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" + agent_uri = "hello world" + + import_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_import_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.import_agent({ parent: parent, agent_uri: agent_uri }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.import_agent parent: parent, agent_uri: agent_uri do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.import_agent ::Google::Cloud::Dialogflow::V2::ImportAgentRequest.new(parent: parent, agent_uri: agent_uri) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.import_agent({ parent: parent, agent_uri: agent_uri }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.import_agent(::Google::Cloud::Dialogflow::V2::ImportAgentRequest.new(parent: parent, agent_uri: agent_uri), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_agent_client_stub.call_count + end + end + end + + def test_restore_agent + # 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" + agent_uri = "hello world" + + restore_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_restore_agent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, restore_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.restore_agent({ parent: parent, agent_uri: agent_uri }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.restore_agent parent: parent, agent_uri: agent_uri do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.restore_agent ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new(parent: parent, agent_uri: agent_uri) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.restore_agent({ parent: parent, agent_uri: agent_uri }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.restore_agent(::Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new(parent: parent, agent_uri: agent_uri), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, restore_agent_client_stub.call_count + end + end + end + + def test_get_validation_result + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ValidationResult.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + language_code = "hello world" + + get_validation_result_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_get_validation_result_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_validation_result_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_validation_result({ parent: parent, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_validation_result parent: parent, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_validation_result ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new(parent: parent, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_validation_result({ parent: parent, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_validation_result(::Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new(parent: parent, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_validation_result_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::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb new file mode 100644 index 000000000000..7e9217d8375f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb @@ -0,0 +1,681 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/agent_pb" +require "google/cloud/dialogflow/v2/agents" + +class ::Google::Cloud::Dialogflow::V2::Agents::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_agent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Agent.new + grpc_operation = GRPC::ActiveCall::Operation.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" + + get_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetAgentRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_agent({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_agent parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_agent ::Google::Cloud::Dialogflow::V2::GetAgentRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_agent({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_agent(::Google::Cloud::Dialogflow::V2::GetAgentRequest.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, get_agent_client_stub.call_rpc_count + end + end + + def test_set_agent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Agent.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + agent = {} + update_mask = {} + + set_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::SetAgentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Agent), request["agent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.set_agent({ agent: agent, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.set_agent agent: agent, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.set_agent ::Google::Cloud::Dialogflow::V2::SetAgentRequest.new(agent: agent, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.set_agent({ agent: agent, 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 + c.set_agent(::Google::Cloud::Dialogflow::V2::SetAgentRequest.new(agent: agent, 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, set_agent_client_stub.call_rpc_count + end + end + + def test_delete_agent + # 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. + parent = "hello world" + + delete_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_agent({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_agent parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_agent ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_agent({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_agent(::Google::Cloud::Dialogflow::V2::DeleteAgentRequest.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, delete_agent_client_stub.call_rpc_count + end + end + + def test_search_agents + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + + search_agents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_agents, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, 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, search_agents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.search_agents({ 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 + c.search_agents 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 + c.search_agents ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest.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 + c.search_agents({ 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 + c.search_agents(::Google::Cloud::Dialogflow::V2::SearchAgentsRequest.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, search_agents_client_stub.call_rpc_count + end + end + + def test_train_agent + # 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" + + train_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :train_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::TrainAgentRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, train_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.train_agent({ 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 + c.train_agent 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 + c.train_agent ::Google::Cloud::Dialogflow::V2::TrainAgentRequest.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 + c.train_agent({ 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 + c.train_agent(::Google::Cloud::Dialogflow::V2::TrainAgentRequest.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, train_agent_client_stub.call_rpc_count + end + end + + def test_export_agent + # 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" + agent_uri = "hello world" + + export_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ExportAgentRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["agent_uri"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.export_agent({ parent: parent, agent_uri: agent_uri }) 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 + c.export_agent parent: parent, agent_uri: agent_uri 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 + c.export_agent ::Google::Cloud::Dialogflow::V2::ExportAgentRequest.new(parent: parent, agent_uri: agent_uri) 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 + c.export_agent({ parent: parent, agent_uri: agent_uri }, 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 + c.export_agent(::Google::Cloud::Dialogflow::V2::ExportAgentRequest.new(parent: parent, agent_uri: agent_uri), 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, export_agent_client_stub.call_rpc_count + end + end + + def test_import_agent + # 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" + agent_uri = "hello world" + + import_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ImportAgentRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["agent_uri"] + assert_equal :agent_uri, request.agent + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.import_agent({ parent: parent, agent_uri: agent_uri }) 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 + c.import_agent parent: parent, agent_uri: agent_uri 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 + c.import_agent ::Google::Cloud::Dialogflow::V2::ImportAgentRequest.new(parent: parent, agent_uri: agent_uri) 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 + c.import_agent({ parent: parent, agent_uri: agent_uri }, 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 + c.import_agent(::Google::Cloud::Dialogflow::V2::ImportAgentRequest.new(parent: parent, agent_uri: agent_uri), 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_agent_client_stub.call_rpc_count + end + end + + def test_restore_agent + # 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" + agent_uri = "hello world" + + restore_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :restore_agent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["agent_uri"] + assert_equal :agent_uri, request.agent + refute_nil options + end + + Gapic::ServiceStub.stub :new, restore_agent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.restore_agent({ parent: parent, agent_uri: agent_uri }) 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 + c.restore_agent parent: parent, agent_uri: agent_uri 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 + c.restore_agent ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new(parent: parent, agent_uri: agent_uri) 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 + c.restore_agent({ parent: parent, agent_uri: agent_uri }, 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 + c.restore_agent(::Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new(parent: parent, agent_uri: agent_uri), 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, restore_agent_client_stub.call_rpc_count + end + end + + def test_get_validation_result + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ValidationResult.new + grpc_operation = GRPC::ActiveCall::Operation.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" + language_code = "hello world" + + get_validation_result_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_validation_result, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_validation_result_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_validation_result({ parent: parent, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_validation_result parent: parent, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_validation_result ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new(parent: parent, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_validation_result({ parent: parent, language_code: language_code }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_validation_result(::Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new(parent: parent, language_code: language_code), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_validation_result_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::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::V2::Agents::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb new file mode 100644 index 000000000000..1b571bda6bd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/answer_records" + +class ::Google::Cloud::Dialogflow::V2::AnswerRecords::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_record_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.answer_record_path project: "value0", answer_record: "value1" + assert_equal "projects/value0/answerRecords/value1", path + + path = client.answer_record_path project: "value0", location: "value1", answer_record: "value2" + assert_equal "projects/value0/locations/value1/answerRecords/value2", path + end + end + + def test_app_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.app_path project: "value0", location: "value1", app: "value2" + assert_equal "projects/value0/locations/value1/apps/value2", path + end + end + + def test_context_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.context_path project: "value0", session: "value1", context: "value2" + assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path + + path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path + + path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" + assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path + + path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/value5", path + end + end + + def test_intent_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intent_path project: "value0", intent: "value1" + assert_equal "projects/value0/agent/intents/value1", path + + path = client.intent_path project: "value0", location: "value1", intent: "value2" + assert_equal "projects/value0/locations/value1/agent/intents/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::Dialogflow::V2::AnswerRecords::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_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::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", tool: "value2" + assert_equal "projects/value0/locations/value1/tools/value2", path + + path = client.tool_path project: "value0", location: "value1", app: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/apps/value2/tools/value3", path + end + end + + def test_toolset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.toolset_path project: "value0", location: "value1", app: "value2", toolset: "value3" + assert_equal "projects/value0/locations/value1/apps/value2/toolsets/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb new file mode 100644 index 000000000000..00bc34fcbeb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_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/dialogflow/v2/answer_record_pb" +require "google/cloud/dialogflow/v2/answer_records/rest" + + +class ::Google::Cloud::Dialogflow::V2::AnswerRecords::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_answer_records + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse.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" + page_size = 42 + page_token = "hello world" + + list_answer_records_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::Dialogflow::V2::AnswerRecords::Rest::ServiceStub.stub :transcode_list_answer_records_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_answer_records_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_answer_records({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_answer_records parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_answer_records ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_answer_records({ parent: parent, filter: filter, 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 + c.list_answer_records(::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new(parent: parent, filter: filter, 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_answer_records_client_stub.call_count + end + end + end + + def test_update_answer_record + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::AnswerRecord.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + answer_record = {} + update_mask = {} + + update_answer_record_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::Dialogflow::V2::AnswerRecords::Rest::ServiceStub.stub :transcode_update_answer_record_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_answer_record_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_answer_record({ answer_record: answer_record, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_answer_record answer_record: answer_record, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_answer_record ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new(answer_record: answer_record, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_answer_record({ answer_record: answer_record, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_answer_record(::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new(answer_record: answer_record, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_answer_record_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::Dialogflow::V2::AnswerRecords::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::Dialogflow::V2::AnswerRecords::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb new file mode 100644 index 000000000000..28acedb01580 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb @@ -0,0 +1,233 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/answer_record_pb" +require "google/cloud/dialogflow/v2/answer_records" + +class ::Google::Cloud::Dialogflow::V2::AnswerRecords::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_answer_records + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + page_size = 42 + page_token = "hello world" + + list_answer_records_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_answer_records, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_answer_records_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_answer_records({ parent: parent, filter: filter, 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 + c.list_answer_records parent: parent, filter: filter, 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 + c.list_answer_records ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new(parent: parent, filter: filter, 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 + c.list_answer_records({ parent: parent, filter: filter, 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 + c.list_answer_records(::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new(parent: parent, filter: filter, 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_answer_records_client_stub.call_rpc_count + end + end + + def test_update_answer_record + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::AnswerRecord.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + answer_record = {} + update_mask = {} + + update_answer_record_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_answer_record, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AnswerRecord), request["answer_record"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_answer_record_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_answer_record({ answer_record: answer_record, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_answer_record answer_record: answer_record, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_answer_record ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new(answer_record: answer_record, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_answer_record({ answer_record: answer_record, 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 + c.update_answer_record(::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new(answer_record: answer_record, 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_answer_record_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::Dialogflow::V2::AnswerRecords::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::Dialogflow::V2::AnswerRecords::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::Dialogflow::V2::AnswerRecords::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb new file mode 100644 index 000000000000..238a7b3db9cb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_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/dialogflow/v2/contexts" + +class ::Google::Cloud::Dialogflow::V2::Contexts::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_context_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.context_path project: "value0", session: "value1", context: "value2" + assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path + + path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path + + path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" + assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path + + path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/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::Dialogflow::V2::Contexts::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", session: "value1" + assert_equal "projects/value0/agent/sessions/value1", path + + path = client.session_path project: "value0", environment: "value1", user: "value2", session: "value3" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3", path + + path = client.session_path project: "value0", location: "value1", session: "value2" + assert_equal "projects/value0/locations/value1/agent/sessions/value2", path + + path = client.session_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb new file mode 100644 index 000000000000..fb1751003f6e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb @@ -0,0 +1,427 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/context_pb" +require "google/cloud/dialogflow/v2/contexts/rest" + + +class ::Google::Cloud::Dialogflow::V2::Contexts::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_contexts + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListContextsResponse.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_contexts_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_list_contexts_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_contexts_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_contexts({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_contexts parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_contexts ::Google::Cloud::Dialogflow::V2::ListContextsRequest.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 + c.list_contexts({ 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 + c.list_contexts(::Google::Cloud::Dialogflow::V2::ListContextsRequest.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_contexts_client_stub.call_count + end + end + end + + def test_get_context + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Context.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_context_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_get_context_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_context_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_context({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_context name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_context ::Google::Cloud::Dialogflow::V2::GetContextRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_context({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_context(::Google::Cloud::Dialogflow::V2::GetContextRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_context_client_stub.call_count + end + end + end + + def test_create_context + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Context.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + context = {} + + create_context_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_create_context_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_context_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_context({ parent: parent, context: context }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_context parent: parent, context: context do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_context ::Google::Cloud::Dialogflow::V2::CreateContextRequest.new(parent: parent, context: context) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_context({ parent: parent, context: context }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_context(::Google::Cloud::Dialogflow::V2::CreateContextRequest.new(parent: parent, context: context), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_context_client_stub.call_count + end + end + end + + def test_update_context + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Context.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + context = {} + update_mask = {} + + update_context_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_update_context_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_context_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_context({ context: context, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_context context: context, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_context ::Google::Cloud::Dialogflow::V2::UpdateContextRequest.new(context: context, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_context({ context: context, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_context(::Google::Cloud::Dialogflow::V2::UpdateContextRequest.new(context: context, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_context_client_stub.call_count + end + end + end + + def test_delete_context + # 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_context_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_delete_context_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_context_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_context({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_context name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_context ::Google::Cloud::Dialogflow::V2::DeleteContextRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_context({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_context(::Google::Cloud::Dialogflow::V2::DeleteContextRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_context_client_stub.call_count + end + end + end + + def test_delete_all_contexts + # 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. + parent = "hello world" + + delete_all_contexts_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_delete_all_contexts_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_all_contexts_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_all_contexts({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_all_contexts parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_all_contexts ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_all_contexts({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_all_contexts(::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_all_contexts_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::Dialogflow::V2::Contexts::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::Dialogflow::V2::Contexts::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb new file mode 100644 index 000000000000..62b95cdcb9ee --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb @@ -0,0 +1,465 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/context_pb" +require "google/cloud/dialogflow/v2/contexts" + +class ::Google::Cloud::Dialogflow::V2::Contexts::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_contexts + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListContextsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_contexts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_contexts, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListContextsRequest, 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_contexts_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_contexts({ 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 + c.list_contexts 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 + c.list_contexts ::Google::Cloud::Dialogflow::V2::ListContextsRequest.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 + c.list_contexts({ 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 + c.list_contexts(::Google::Cloud::Dialogflow::V2::ListContextsRequest.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_contexts_client_stub.call_rpc_count + end + end + + def test_get_context + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Context.new + grpc_operation = GRPC::ActiveCall::Operation.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_context_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_context, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetContextRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_context_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_context({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_context name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_context ::Google::Cloud::Dialogflow::V2::GetContextRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_context({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_context(::Google::Cloud::Dialogflow::V2::GetContextRequest.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_context_client_stub.call_rpc_count + end + end + + def test_create_context + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Context.new + grpc_operation = GRPC::ActiveCall::Operation.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" + context = {} + + create_context_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_context, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateContextRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Context), request["context"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_context_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_context({ parent: parent, context: context }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_context parent: parent, context: context do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_context ::Google::Cloud::Dialogflow::V2::CreateContextRequest.new(parent: parent, context: context) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_context({ parent: parent, context: context }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_context(::Google::Cloud::Dialogflow::V2::CreateContextRequest.new(parent: parent, context: context), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_context_client_stub.call_rpc_count + end + end + + def test_update_context + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Context.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + context = {} + update_mask = {} + + update_context_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_context, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateContextRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Context), request["context"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_context_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_context({ context: context, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_context context: context, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_context ::Google::Cloud::Dialogflow::V2::UpdateContextRequest.new(context: context, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_context({ context: context, 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 + c.update_context(::Google::Cloud::Dialogflow::V2::UpdateContextRequest.new(context: context, 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_context_client_stub.call_rpc_count + end + end + + def test_delete_context + # 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_context_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_context, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteContextRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_context_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_context({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_context name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_context ::Google::Cloud::Dialogflow::V2::DeleteContextRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_context({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_context(::Google::Cloud::Dialogflow::V2::DeleteContextRequest.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_context_client_stub.call_rpc_count + end + end + + def test_delete_all_contexts + # 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. + parent = "hello world" + + delete_all_contexts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_all_contexts, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_all_contexts_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_all_contexts({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_all_contexts parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_all_contexts ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_all_contexts({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_all_contexts(::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.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, delete_all_contexts_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::Dialogflow::V2::Contexts::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::Dialogflow::V2::Contexts::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::Dialogflow::V2::Contexts::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Contexts::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb new file mode 100644 index 000000000000..6e77e97f16f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_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/dialogflow/v2/conversation_dataset_pb" +require "google/cloud/dialogflow/v2/conversation_dataset_services_pb" +require "google/cloud/dialogflow/v2/conversation_datasets" + +class ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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 + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb new file mode 100644 index 000000000000..548adf925bdb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_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/dialogflow/v2/conversation_datasets" + +class ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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_conversation_dataset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_dataset_path project: "value0", location: "value1", conversation_dataset: "value2" + assert_equal "projects/value0/locations/value1/conversationDatasets/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::Dialogflow::V2::ConversationDatasets::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-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb new file mode 100644 index 000000000000..16b7c2072cd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb @@ -0,0 +1,373 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_dataset_pb" +require "google/cloud/dialogflow/v2/conversation_datasets/rest" + + +class ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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_conversation_dataset + # 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" + conversation_dataset = {} + + create_conversation_dataset_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_create_conversation_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_conversation_dataset_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_conversation_dataset({ parent: parent, conversation_dataset: conversation_dataset }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_conversation_dataset parent: parent, conversation_dataset: conversation_dataset do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_conversation_dataset ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new(parent: parent, conversation_dataset: conversation_dataset) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_conversation_dataset({ parent: parent, conversation_dataset: conversation_dataset }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_conversation_dataset(::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new(parent: parent, conversation_dataset: conversation_dataset), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_conversation_dataset_client_stub.call_count + end + end + end + + def test_get_conversation_dataset + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ConversationDataset.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_conversation_dataset_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_get_conversation_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_conversation_dataset_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_conversation_dataset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_conversation_dataset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_conversation_dataset ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_conversation_dataset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_conversation_dataset(::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_conversation_dataset_client_stub.call_count + end + end + end + + def test_list_conversation_datasets + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse.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_conversation_datasets_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_list_conversation_datasets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_conversation_datasets_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_conversation_datasets({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_conversation_datasets parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_conversation_datasets ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.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 + c.list_conversation_datasets({ 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 + c.list_conversation_datasets(::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.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_conversation_datasets_client_stub.call_count + end + end + end + + def test_delete_conversation_dataset + # 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_conversation_dataset_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_delete_conversation_dataset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_conversation_dataset_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_conversation_dataset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_conversation_dataset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_conversation_dataset ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_conversation_dataset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_conversation_dataset(::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_conversation_dataset_client_stub.call_count + end + end + end + + def test_import_conversation_data + # 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" + input_config = {} + + import_conversation_data_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_import_conversation_data_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_conversation_data_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.import_conversation_data({ name: name, input_config: input_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.import_conversation_data name: name, input_config: input_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.import_conversation_data ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new(name: name, input_config: input_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.import_conversation_data({ name: name, input_config: input_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.import_conversation_data(::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new(name: name, input_config: input_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_conversation_data_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::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb new file mode 100644 index 000000000000..28dc7773b094 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb @@ -0,0 +1,436 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_dataset_pb" +require "google/cloud/dialogflow/v2/conversation_datasets" + +class ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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_conversation_dataset + # 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" + conversation_dataset = {} + + create_conversation_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_conversation_dataset, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationDataset), request["conversation_dataset"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_conversation_dataset_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_conversation_dataset({ parent: parent, conversation_dataset: conversation_dataset }) 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 + c.create_conversation_dataset parent: parent, conversation_dataset: conversation_dataset 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 + c.create_conversation_dataset ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new(parent: parent, conversation_dataset: conversation_dataset) 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 + c.create_conversation_dataset({ parent: parent, conversation_dataset: conversation_dataset }, 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 + c.create_conversation_dataset(::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new(parent: parent, conversation_dataset: conversation_dataset), 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_conversation_dataset_client_stub.call_rpc_count + end + end + + def test_get_conversation_dataset + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationDataset.new + grpc_operation = GRPC::ActiveCall::Operation.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_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_conversation_dataset, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_conversation_dataset_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_conversation_dataset({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_conversation_dataset name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_conversation_dataset ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_conversation_dataset({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_conversation_dataset(::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.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_dataset_client_stub.call_rpc_count + end + end + + def test_list_conversation_datasets + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_conversation_datasets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_conversation_datasets, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, 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_conversation_datasets_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_conversation_datasets({ 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 + c.list_conversation_datasets 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 + c.list_conversation_datasets ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.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 + c.list_conversation_datasets({ 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 + c.list_conversation_datasets(::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.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_conversation_datasets_client_stub.call_rpc_count + end + end + + def test_delete_conversation_dataset + # 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_conversation_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_conversation_dataset, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_conversation_dataset_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_conversation_dataset({ 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 + c.delete_conversation_dataset 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 + c.delete_conversation_dataset ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.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 + c.delete_conversation_dataset({ 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 + c.delete_conversation_dataset(::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.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_conversation_dataset_client_stub.call_rpc_count + end + end + + def test_import_conversation_data + # 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" + input_config = {} + + import_conversation_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_conversation_data, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::InputConfig), request["input_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_conversation_data_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.import_conversation_data({ name: name, input_config: input_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 + c.import_conversation_data name: name, input_config: input_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 + c.import_conversation_data ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new(name: name, input_config: input_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 + c.import_conversation_data({ name: name, input_config: input_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 + c.import_conversation_data(::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new(name: name, input_config: input_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_conversation_data_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::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb new file mode 100644 index 000000000000..0d5bb6d559b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_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/dialogflow/v2/conversation_model_pb" +require "google/cloud/dialogflow/v2/conversation_model_services_pb" +require "google/cloud/dialogflow/v2/conversation_models" + +class ::Google::Cloud::Dialogflow::V2::ConversationModels::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 + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb new file mode 100644 index 000000000000..37cd99f74d32 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_models" + +class ::Google::Cloud::Dialogflow::V2::ConversationModels::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_conversation_dataset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_dataset_path project: "value0", location: "value1", conversation_dataset: "value2" + assert_equal "projects/value0/locations/value1/conversationDatasets/value2", path + end + end + + def test_conversation_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_model_path project: "value0", location: "value1", conversation_model: "value2" + assert_equal "projects/value0/locations/value1/conversationModels/value2", path + + path = client.conversation_model_path project: "value0", conversation_model: "value1" + assert_equal "projects/value0/conversationModels/value1", path + end + end + + def test_conversation_model_evaluation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_model_evaluation_path project: "value0", conversation_model: "value1", evaluation: "value2" + assert_equal "projects/value0/conversationModels/value1/evaluations/value2", path + + path = client.conversation_model_evaluation_path project: "value0", location: "value1", conversation_model: "value2", evaluation: "value3" + assert_equal "projects/value0/locations/value1/conversationModels/value2/evaluations/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::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", knowledge_base: "value1", document: "value2" + assert_equal "projects/value0/knowledgeBases/value1/documents/value2", path + + path = client.document_path project: "value0", location: "value1", knowledge_base: "value2", document: "value3" + assert_equal "projects/value0/locations/value1/knowledgeBases/value2/documents/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb new file mode 100644 index 000000000000..58498f82b936 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.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 "helper" +require "gapic/rest" +require "google/cloud/dialogflow/v2/conversation_model_pb" +require "google/cloud/dialogflow/v2/conversation_models/rest" + + +class ::Google::Cloud::Dialogflow::V2::ConversationModels::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_conversation_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. + parent = "hello world" + conversation_model = {} + + create_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_create_conversation_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_conversation_model({ parent: parent, conversation_model: conversation_model }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_conversation_model parent: parent, conversation_model: conversation_model do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_conversation_model ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new(parent: parent, conversation_model: conversation_model) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_conversation_model({ parent: parent, conversation_model: conversation_model }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_conversation_model(::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new(parent: parent, conversation_model: conversation_model), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_conversation_model_client_stub.call_count + end + end + end + + def test_get_conversation_model + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ConversationModel.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_get_conversation_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_conversation_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_conversation_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_conversation_model ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_conversation_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_conversation_model(::Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_conversation_model_client_stub.call_count + end + end + end + + def test_list_conversation_models + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse.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_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_list_conversation_models_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_conversation_models_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_conversation_models({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_conversation_models parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_conversation_models ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.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 + c.list_conversation_models({ 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 + c.list_conversation_models(::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.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_conversation_models_client_stub.call_count + end + end + end + + def test_delete_conversation_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. + name = "hello world" + + delete_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_delete_conversation_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_conversation_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_conversation_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_conversation_model ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_conversation_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_conversation_model(::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_conversation_model_client_stub.call_count + end + end + end + + def test_deploy_conversation_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. + name = "hello world" + + deploy_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_deploy_conversation_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, deploy_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.deploy_conversation_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.deploy_conversation_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.deploy_conversation_model ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.deploy_conversation_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.deploy_conversation_model(::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, deploy_conversation_model_client_stub.call_count + end + end + end + + def test_undeploy_conversation_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. + name = "hello world" + + undeploy_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_undeploy_conversation_model_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undeploy_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.undeploy_conversation_model({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.undeploy_conversation_model name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.undeploy_conversation_model ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.undeploy_conversation_model({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.undeploy_conversation_model(::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undeploy_conversation_model_client_stub.call_count + end + end + end + + def test_get_conversation_model_evaluation + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_conversation_model_evaluation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_get_conversation_model_evaluation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_conversation_model_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_conversation_model_evaluation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_conversation_model_evaluation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_conversation_model_evaluation ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_conversation_model_evaluation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_conversation_model_evaluation(::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_conversation_model_evaluation_client_stub.call_count + end + end + end + + def test_list_conversation_model_evaluations + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse.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_conversation_model_evaluations_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_list_conversation_model_evaluations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_conversation_model_evaluations_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_conversation_model_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_conversation_model_evaluations parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_conversation_model_evaluations ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.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 + c.list_conversation_model_evaluations({ 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 + c.list_conversation_model_evaluations(::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.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_conversation_model_evaluations_client_stub.call_count + end + end + end + + def test_create_conversation_model_evaluation + # 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" + conversation_model_evaluation = {} + + create_conversation_model_evaluation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_create_conversation_model_evaluation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_conversation_model_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_conversation_model_evaluation({ parent: parent, conversation_model_evaluation: conversation_model_evaluation }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_conversation_model_evaluation parent: parent, conversation_model_evaluation: conversation_model_evaluation do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_conversation_model_evaluation ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new(parent: parent, conversation_model_evaluation: conversation_model_evaluation) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_conversation_model_evaluation({ parent: parent, conversation_model_evaluation: conversation_model_evaluation }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_conversation_model_evaluation(::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new(parent: parent, conversation_model_evaluation: conversation_model_evaluation), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_conversation_model_evaluation_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::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb new file mode 100644 index 000000000000..5ad5b77dc1b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb @@ -0,0 +1,687 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_model_pb" +require "google/cloud/dialogflow/v2/conversation_models" + +class ::Google::Cloud::Dialogflow::V2::ConversationModels::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_conversation_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. + parent = "hello world" + conversation_model = {} + + create_conversation_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_conversation_model, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationModel), request["conversation_model"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_conversation_model({ parent: parent, conversation_model: conversation_model }) 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 + c.create_conversation_model parent: parent, conversation_model: conversation_model 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 + c.create_conversation_model ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new(parent: parent, conversation_model: conversation_model) 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 + c.create_conversation_model({ parent: parent, conversation_model: conversation_model }, 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 + c.create_conversation_model(::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new(parent: parent, conversation_model: conversation_model), 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_conversation_model_client_stub.call_rpc_count + end + end + + def test_get_conversation_model + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationModel.new + grpc_operation = GRPC::ActiveCall::Operation.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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_conversation_model, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_conversation_model({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_conversation_model name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_conversation_model ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_conversation_model({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_conversation_model(::Google::Cloud::Dialogflow::V2::GetConversationModelRequest.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_model_client_stub.call_rpc_count + end + end + + def test_list_conversation_models + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_conversation_models_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_conversation_models, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, 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_conversation_models_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_conversation_models({ 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 + c.list_conversation_models 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 + c.list_conversation_models ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.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 + c.list_conversation_models({ 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 + c.list_conversation_models(::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.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_conversation_models_client_stub.call_rpc_count + end + end + + def test_delete_conversation_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. + name = "hello world" + + delete_conversation_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_conversation_model, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_conversation_model({ 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 + c.delete_conversation_model 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 + c.delete_conversation_model ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.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 + c.delete_conversation_model({ 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 + c.delete_conversation_model(::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.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_conversation_model_client_stub.call_rpc_count + end + end + + def test_deploy_conversation_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. + name = "hello world" + + deploy_conversation_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :deploy_conversation_model, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, deploy_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.deploy_conversation_model({ 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 + c.deploy_conversation_model 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 + c.deploy_conversation_model ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.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 + c.deploy_conversation_model({ 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 + c.deploy_conversation_model(::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.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, deploy_conversation_model_client_stub.call_rpc_count + end + end + + def test_undeploy_conversation_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. + name = "hello world" + + undeploy_conversation_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undeploy_conversation_model, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undeploy_conversation_model_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.undeploy_conversation_model({ 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 + c.undeploy_conversation_model 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 + c.undeploy_conversation_model ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.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 + c.undeploy_conversation_model({ 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 + c.undeploy_conversation_model(::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.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, undeploy_conversation_model_client_stub.call_rpc_count + end + end + + def test_get_conversation_model_evaluation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation.new + grpc_operation = GRPC::ActiveCall::Operation.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_model_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_conversation_model_evaluation, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_conversation_model_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_conversation_model_evaluation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_conversation_model_evaluation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_conversation_model_evaluation ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_conversation_model_evaluation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_conversation_model_evaluation(::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.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_model_evaluation_client_stub.call_rpc_count + end + end + + def test_list_conversation_model_evaluations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_conversation_model_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_conversation_model_evaluations, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, 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_conversation_model_evaluations_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_conversation_model_evaluations({ 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 + c.list_conversation_model_evaluations 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 + c.list_conversation_model_evaluations ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.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 + c.list_conversation_model_evaluations({ 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 + c.list_conversation_model_evaluations(::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.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_conversation_model_evaluations_client_stub.call_rpc_count + end + end + + def test_create_conversation_model_evaluation + # 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" + conversation_model_evaluation = {} + + create_conversation_model_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_conversation_model_evaluation, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation), request["conversation_model_evaluation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_conversation_model_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_conversation_model_evaluation({ parent: parent, conversation_model_evaluation: conversation_model_evaluation }) 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 + c.create_conversation_model_evaluation parent: parent, conversation_model_evaluation: conversation_model_evaluation 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 + c.create_conversation_model_evaluation ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new(parent: parent, conversation_model_evaluation: conversation_model_evaluation) 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 + c.create_conversation_model_evaluation({ parent: parent, conversation_model_evaluation: conversation_model_evaluation }, 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 + c.create_conversation_model_evaluation(::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new(parent: parent, conversation_model_evaluation: conversation_model_evaluation), 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_conversation_model_evaluation_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::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb new file mode 100644 index 000000000000..d6a34c793ce8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_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/dialogflow/v2/conversation_profile_pb" +require "google/cloud/dialogflow/v2/conversation_profile_services_pb" +require "google/cloud/dialogflow/v2/conversation_profiles" + +class ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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 + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb new file mode 100644 index 000000000000..3676a8730d69 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_profiles" + +class ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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_agent_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0" + assert_equal "projects/value0/agent", path + + path = client.agent_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/agent", path + end + end + + def test_cx_security_settings_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cx_security_settings_path project: "value0", location: "value1", security_settings: "value2" + assert_equal "projects/value0/locations/value1/securitySettings/value2", path + end + end + + def test_conversation_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_model_path project: "value0", location: "value1", conversation_model: "value2" + assert_equal "projects/value0/locations/value1/conversationModels/value2", path + + path = client.conversation_model_path project: "value0", conversation_model: "value1" + assert_equal "projects/value0/conversationModels/value1", path + end + end + + def test_conversation_profile_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_profile_path project: "value0", conversation_profile: "value1" + assert_equal "projects/value0/conversationProfiles/value1", path + + path = client.conversation_profile_path project: "value0", location: "value1", conversation_profile: "value2" + assert_equal "projects/value0/locations/value1/conversationProfiles/value2", 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::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", knowledge_base: "value1", document: "value2" + assert_equal "projects/value0/knowledgeBases/value1/documents/value2", path + + path = client.document_path project: "value0", location: "value1", knowledge_base: "value2", document: "value3" + assert_equal "projects/value0/locations/value1/knowledgeBases/value2/documents/value3", path + end + end + + def test_generator_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", generator: "value2" + assert_equal "projects/value0/locations/value1/generators/value2", path + end + end + + def test_knowledge_base_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.knowledge_base_path project: "value0", knowledge_base: "value1" + assert_equal "projects/value0/knowledgeBases/value1", path + + path = client.knowledge_base_path project: "value0", location: "value1", knowledge_base: "value2" + assert_equal "projects/value0/locations/value1/knowledgeBases/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::Dialogflow::V2::ConversationProfiles::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_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", path + 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::Dialogflow::V2::ConversationProfiles::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-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb new file mode 100644 index 000000000000..c12e81f5bde8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb @@ -0,0 +1,485 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_profile_pb" +require "google/cloud/dialogflow/v2/conversation_profiles/rest" + + +class ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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_conversation_profiles + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse.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_conversation_profiles_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_list_conversation_profiles_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_conversation_profiles_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_conversation_profiles({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_conversation_profiles parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_conversation_profiles ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.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 + c.list_conversation_profiles({ 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 + c.list_conversation_profiles(::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.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_conversation_profiles_client_stub.call_count + end + end + end + + def test_get_conversation_profile + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_conversation_profile_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_get_conversation_profile_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_conversation_profile_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_conversation_profile({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_conversation_profile name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_conversation_profile ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_conversation_profile({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_conversation_profile(::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_conversation_profile_client_stub.call_count + end + end + end + + def test_create_conversation_profile + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + conversation_profile = {} + + create_conversation_profile_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_create_conversation_profile_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_conversation_profile_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_conversation_profile({ parent: parent, conversation_profile: conversation_profile }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_conversation_profile parent: parent, conversation_profile: conversation_profile do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_conversation_profile ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new(parent: parent, conversation_profile: conversation_profile) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_conversation_profile({ parent: parent, conversation_profile: conversation_profile }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_conversation_profile(::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new(parent: parent, conversation_profile: conversation_profile), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_conversation_profile_client_stub.call_count + end + end + end + + def test_update_conversation_profile + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + conversation_profile = {} + update_mask = {} + + update_conversation_profile_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_update_conversation_profile_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_conversation_profile_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_conversation_profile({ conversation_profile: conversation_profile, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_conversation_profile conversation_profile: conversation_profile, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_conversation_profile ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new(conversation_profile: conversation_profile, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_conversation_profile({ conversation_profile: conversation_profile, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_conversation_profile(::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new(conversation_profile: conversation_profile, 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_profile_client_stub.call_count + end + end + end + + def test_delete_conversation_profile + # 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_profile_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_delete_conversation_profile_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_conversation_profile_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_conversation_profile({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_conversation_profile name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_conversation_profile ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_conversation_profile({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_conversation_profile(::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_conversation_profile_client_stub.call_count + end + end + end + + def test_set_suggestion_feature_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. + conversation_profile = "hello world" + participant_role = :ROLE_UNSPECIFIED + suggestion_feature_config = {} + + set_suggestion_feature_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_set_suggestion_feature_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_suggestion_feature_config_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.set_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.set_suggestion_feature_config conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.set_suggestion_feature_config ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.set_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.set_suggestion_feature_config(::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_suggestion_feature_config_client_stub.call_count + end + end + end + + def test_clear_suggestion_feature_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. + conversation_profile = "hello world" + participant_role = :ROLE_UNSPECIFIED + suggestion_feature_type = :TYPE_UNSPECIFIED + + clear_suggestion_feature_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_clear_suggestion_feature_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, clear_suggestion_feature_config_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.clear_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.clear_suggestion_feature_config conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.clear_suggestion_feature_config ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.clear_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.clear_suggestion_feature_config(::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, clear_suggestion_feature_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::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb new file mode 100644 index 000000000000..5647d2a482d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb @@ -0,0 +1,555 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_profile_pb" +require "google/cloud/dialogflow/v2/conversation_profiles" + +class ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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_conversation_profiles + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_conversation_profiles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_conversation_profiles, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest, 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_conversation_profiles_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_conversation_profiles({ 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 + c.list_conversation_profiles 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 + c.list_conversation_profiles ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.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 + c.list_conversation_profiles({ 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 + c.list_conversation_profiles(::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.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_conversation_profiles_client_stub.call_rpc_count + end + end + + def test_get_conversation_profile + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new + grpc_operation = GRPC::ActiveCall::Operation.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_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_conversation_profile, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_conversation_profile_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_conversation_profile({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_conversation_profile name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_conversation_profile ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_conversation_profile({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_conversation_profile(::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.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_profile_client_stub.call_rpc_count + end + end + + def test_create_conversation_profile + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new + grpc_operation = GRPC::ActiveCall::Operation.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_profile = {} + + create_conversation_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_conversation_profile, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationProfile), request["conversation_profile"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_conversation_profile_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_conversation_profile({ parent: parent, conversation_profile: conversation_profile }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_conversation_profile parent: parent, conversation_profile: conversation_profile do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_conversation_profile ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new(parent: parent, conversation_profile: conversation_profile) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_conversation_profile({ parent: parent, conversation_profile: conversation_profile }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_conversation_profile(::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new(parent: parent, conversation_profile: conversation_profile), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_conversation_profile_client_stub.call_rpc_count + end + end + + def test_update_conversation_profile + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new + grpc_operation = GRPC::ActiveCall::Operation.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_profile = {} + update_mask = {} + + update_conversation_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_conversation_profile, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationProfile), request["conversation_profile"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_conversation_profile_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_conversation_profile({ conversation_profile: conversation_profile, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_conversation_profile conversation_profile: conversation_profile, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_conversation_profile ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new(conversation_profile: conversation_profile, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_conversation_profile({ conversation_profile: conversation_profile, 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 + c.update_conversation_profile(::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new(conversation_profile: conversation_profile, 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_profile_client_stub.call_rpc_count + end + end + + def test_delete_conversation_profile + # 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_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_conversation_profile, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_conversation_profile_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_conversation_profile({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_conversation_profile name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_conversation_profile ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_conversation_profile({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_conversation_profile(::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.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_profile_client_stub.call_rpc_count + end + end + + def test_set_suggestion_feature_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. + conversation_profile = "hello world" + participant_role = :ROLE_UNSPECIFIED + suggestion_feature_config = {} + + set_suggestion_feature_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_suggestion_feature_config, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest, request + assert_equal "hello world", request["conversation_profile"] + assert_equal :ROLE_UNSPECIFIED, request["participant_role"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig), request["suggestion_feature_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_suggestion_feature_config_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.set_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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 + c.set_suggestion_feature_config conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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 + c.set_suggestion_feature_config ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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 + c.set_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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 + c.set_suggestion_feature_config(::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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, set_suggestion_feature_config_client_stub.call_rpc_count + end + end + + def test_clear_suggestion_feature_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. + conversation_profile = "hello world" + participant_role = :ROLE_UNSPECIFIED + suggestion_feature_type = :TYPE_UNSPECIFIED + + clear_suggestion_feature_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :clear_suggestion_feature_config, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest, request + assert_equal "hello world", request["conversation_profile"] + assert_equal :ROLE_UNSPECIFIED, request["participant_role"] + assert_equal :TYPE_UNSPECIFIED, request["suggestion_feature_type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, clear_suggestion_feature_config_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.clear_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type }) 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 + c.clear_suggestion_feature_config conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type 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 + c.clear_suggestion_feature_config ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type) 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 + c.clear_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type }, 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 + c.clear_suggestion_feature_config(::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type), 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, clear_suggestion_feature_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::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb new file mode 100644 index 000000000000..761bf3173e36 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversations" + +class ::Google::Cloud::Dialogflow::V2::Conversations::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_agent_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0" + assert_equal "projects/value0/agent", path + + path = client.agent_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/agent", path + end + end + + def test_app_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.app_path project: "value0", location: "value1", app: "value2" + assert_equal "projects/value0/locations/value1/apps/value2", path + end + end + + def test_cx_security_settings_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cx_security_settings_path project: "value0", location: "value1", security_settings: "value2" + assert_equal "projects/value0/locations/value1/securitySettings/value2", 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::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_path project: "value0", conversation: "value1" + assert_equal "projects/value0/conversations/value1", path + + path = client.conversation_path project: "value0", location: "value1", conversation: "value2" + assert_equal "projects/value0/locations/value1/conversations/value2", path + end + end + + def test_conversation_model_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_model_path project: "value0", location: "value1", conversation_model: "value2" + assert_equal "projects/value0/locations/value1/conversationModels/value2", path + + path = client.conversation_model_path project: "value0", conversation_model: "value1" + assert_equal "projects/value0/conversationModels/value1", path + end + end + + def test_conversation_profile_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_profile_path project: "value0", conversation_profile: "value1" + assert_equal "projects/value0/conversationProfiles/value1", path + + path = client.conversation_profile_path project: "value0", location: "value1", conversation_profile: "value2" + assert_equal "projects/value0/locations/value1/conversationProfiles/value2", 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::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + 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 + + path = client.data_store_path project: "value0", location: "value1", data_store: "value2" + assert_equal "projects/value0/locations/value1/dataStores/value2", 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::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", knowledge_base: "value1", document: "value2" + assert_equal "projects/value0/knowledgeBases/value1/documents/value2", path + + path = client.document_path project: "value0", location: "value1", knowledge_base: "value2", document: "value3" + assert_equal "projects/value0/locations/value1/knowledgeBases/value2/documents/value3", path + end + end + + def test_generator_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", generator: "value2" + assert_equal "projects/value0/locations/value1/generators/value2", path + end + end + + def test_knowledge_base_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.knowledge_base_path project: "value0", knowledge_base: "value1" + assert_equal "projects/value0/knowledgeBases/value1", path + + path = client.knowledge_base_path project: "value0", location: "value1", knowledge_base: "value2" + assert_equal "projects/value0/locations/value1/knowledgeBases/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::Dialogflow::V2::Conversations::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_message_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.message_path project: "value0", conversation: "value1", message: "value2" + assert_equal "projects/value0/conversations/value1/messages/value2", path + + path = client.message_path project: "value0", location: "value1", conversation: "value2", message: "value3" + assert_equal "projects/value0/locations/value1/conversations/value2/messages/value3", path + end + end + + def test_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", path + 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::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", tool: "value2" + assert_equal "projects/value0/locations/value1/tools/value2", path + + path = client.tool_path project: "value0", location: "value1", app: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/apps/value2/tools/value3", path + end + end + + def test_toolset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.toolset_path project: "value0", location: "value1", app: "value2", toolset: "value3" + assert_equal "projects/value0/locations/value1/apps/value2/toolsets/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb new file mode 100644 index 000000000000..4f7911dab6f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb @@ -0,0 +1,724 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_pb" +require "google/cloud/dialogflow/v2/conversations/rest" + + +class ::Google::Cloud::Dialogflow::V2::Conversations::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_conversation + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Conversation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + conversation = {} + conversation_id = "hello world" + + 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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_create_conversation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_conversation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_conversation({ parent: parent, conversation: conversation, conversation_id: conversation_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_conversation parent: parent, conversation: conversation, conversation_id: conversation_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_conversation ::Google::Cloud::Dialogflow::V2::CreateConversationRequest.new(parent: parent, conversation: conversation, conversation_id: conversation_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_conversation({ parent: parent, conversation: conversation, conversation_id: conversation_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_conversation(::Google::Cloud::Dialogflow::V2::CreateConversationRequest.new(parent: parent, conversation: conversation, conversation_id: conversation_id), 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_list_conversations + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::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" + + 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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_list_conversations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_conversations_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_conversations({ 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 + c.list_conversations 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 + c.list_conversations ::Google::Cloud::Dialogflow::V2::ListConversationsRequest.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 + c.list_conversations({ 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 + c.list_conversations(::Google::Cloud::Dialogflow::V2::ListConversationsRequest.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_conversations_client_stub.call_count + end + end + end + + def test_get_conversation + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_get_conversation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_conversation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_conversation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_conversation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_conversation ::Google::Cloud::Dialogflow::V2::GetConversationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_conversation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_conversation(::Google::Cloud::Dialogflow::V2::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_complete_conversation + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Conversation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + complete_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_complete_conversation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, complete_conversation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.complete_conversation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.complete_conversation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.complete_conversation ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.complete_conversation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.complete_conversation(::Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, complete_conversation_client_stub.call_count + end + end + end + + def test_ingest_context_references + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + conversation = "hello world" + context_references = {} + + ingest_context_references_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_ingest_context_references_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, ingest_context_references_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.ingest_context_references({ conversation: conversation, context_references: context_references }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.ingest_context_references conversation: conversation, context_references: context_references do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.ingest_context_references ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new(conversation: conversation, context_references: context_references) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.ingest_context_references({ conversation: conversation, context_references: context_references }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.ingest_context_references(::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new(conversation: conversation, context_references: context_references), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, ingest_context_references_client_stub.call_count + end + end + end + + def test_list_messages + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListMessagesResponse.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" + page_size = 42 + page_token = "hello world" + + list_messages_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_list_messages_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_messages_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_messages({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_messages parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_messages ::Google::Cloud::Dialogflow::V2::ListMessagesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_messages({ parent: parent, filter: filter, 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 + c.list_messages(::Google::Cloud::Dialogflow::V2::ListMessagesRequest.new(parent: parent, filter: filter, 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_messages_client_stub.call_count + end + end + end + + def test_suggest_conversation_summary + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + conversation = "hello world" + latest_message = "hello world" + context_size = 42 + assist_query_params = {} + + suggest_conversation_summary_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_suggest_conversation_summary_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, suggest_conversation_summary_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.suggest_conversation_summary({ conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.suggest_conversation_summary conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.suggest_conversation_summary ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new(conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.suggest_conversation_summary({ conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.suggest_conversation_summary(::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new(conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, suggest_conversation_summary_client_stub.call_count + end + end + end + + def test_generate_stateless_summary + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + stateless_conversation = {} + conversation_profile = {} + latest_message = "hello world" + max_context_size = 42 + + generate_stateless_summary_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_generate_stateless_summary_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_stateless_summary_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.generate_stateless_summary({ stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.generate_stateless_summary stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.generate_stateless_summary ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new(stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.generate_stateless_summary({ stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.generate_stateless_summary(::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new(stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_stateless_summary_client_stub.call_count + end + end + end + + def test_generate_stateless_suggestion + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + generator = {} + context_references = {} + conversation_context = {} + trigger_events = [:TRIGGER_EVENT_UNSPECIFIED] + security_settings = "hello world" + + generate_stateless_suggestion_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_generate_stateless_suggestion_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_stateless_suggestion_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.generate_stateless_suggestion({ parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.generate_stateless_suggestion parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.generate_stateless_suggestion ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new(parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.generate_stateless_suggestion({ parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.generate_stateless_suggestion(::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new(parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_stateless_suggestion_client_stub.call_count + end + end + end + + def test_search_knowledge + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + query = {} + conversation_profile = "hello world" + session_id = "hello world" + conversation = "hello world" + latest_message = "hello world" + query_source = :QUERY_SOURCE_UNSPECIFIED + end_user_metadata = {} + search_config = {} + exact_search = true + + search_knowledge_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_search_knowledge_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_knowledge_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.search_knowledge({ parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.search_knowledge parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.search_knowledge ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new(parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.search_knowledge({ parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.search_knowledge(::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new(parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_knowledge_client_stub.call_count + end + end + end + + def test_generate_suggestions + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + conversation = "hello world" + latest_message = "hello world" + trigger_events = [:TRIGGER_EVENT_UNSPECIFIED] + + generate_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_generate_suggestions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_suggestions_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.generate_suggestions({ conversation: conversation, latest_message: latest_message, trigger_events: trigger_events }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.generate_suggestions conversation: conversation, latest_message: latest_message, trigger_events: trigger_events do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.generate_suggestions ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new(conversation: conversation, latest_message: latest_message, trigger_events: trigger_events) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.generate_suggestions({ conversation: conversation, latest_message: latest_message, trigger_events: trigger_events }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.generate_suggestions(::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new(conversation: conversation, latest_message: latest_message, trigger_events: trigger_events), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_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::Dialogflow::V2::Conversations::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::Dialogflow::V2::Conversations::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb new file mode 100644 index 000000000000..e47901da7441 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb @@ -0,0 +1,815 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/conversation_pb" +require "google/cloud/dialogflow/v2/conversations" + +class ::Google::Cloud::Dialogflow::V2::Conversations::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_conversation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::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 = {} + conversation_id = "hello world" + + create_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_conversation, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Conversation), request["conversation"] + assert_equal "hello world", request["conversation_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_conversation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_conversation({ parent: parent, conversation: conversation, conversation_id: conversation_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_conversation parent: parent, conversation: conversation, conversation_id: conversation_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_conversation ::Google::Cloud::Dialogflow::V2::CreateConversationRequest.new(parent: parent, conversation: conversation, conversation_id: conversation_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_conversation({ parent: parent, conversation: conversation, conversation_id: conversation_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_conversation(::Google::Cloud::Dialogflow::V2::CreateConversationRequest.new(parent: parent, conversation: conversation, conversation_id: conversation_id), 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_list_conversations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::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" + + list_conversations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_conversations, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::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"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_conversations_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_conversations({ 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 + c.list_conversations 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 + c.list_conversations ::Google::Cloud::Dialogflow::V2::ListConversationsRequest.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 + c.list_conversations({ 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 + c.list_conversations(::Google::Cloud::Dialogflow::V2::ListConversationsRequest.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_conversations_client_stub.call_rpc_count + end + end + + def test_get_conversation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::GetConversationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_conversation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_conversation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_conversation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_conversation ::Google::Cloud::Dialogflow::V2::GetConversationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.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 + c.get_conversation(::Google::Cloud::Dialogflow::V2::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_complete_conversation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::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" + + complete_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :complete_conversation, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, complete_conversation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.complete_conversation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.complete_conversation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.complete_conversation ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.complete_conversation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.complete_conversation(::Google::Cloud::Dialogflow::V2::CompleteConversationRequest.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, complete_conversation_client_stub.call_rpc_count + end + end + + def test_ingest_context_references + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + context_references = {} + + ingest_context_references_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :ingest_context_references, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest, request + assert_equal "hello world", request["conversation"] + assert_equal({}, request["context_references"].to_h) + refute_nil options + end + + Gapic::ServiceStub.stub :new, ingest_context_references_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.ingest_context_references({ conversation: conversation, context_references: context_references }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.ingest_context_references conversation: conversation, context_references: context_references do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.ingest_context_references ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new(conversation: conversation, context_references: context_references) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.ingest_context_references({ conversation: conversation, context_references: context_references }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.ingest_context_references(::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new(conversation: conversation, context_references: context_references), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, ingest_context_references_client_stub.call_rpc_count + end + end + + def test_list_messages + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListMessagesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + page_size = 42 + page_token = "hello world" + + list_messages_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_messages, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListMessagesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_messages_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_messages({ parent: parent, filter: filter, 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 + c.list_messages parent: parent, filter: filter, 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 + c.list_messages ::Google::Cloud::Dialogflow::V2::ListMessagesRequest.new(parent: parent, filter: filter, 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 + c.list_messages({ parent: parent, filter: filter, 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 + c.list_messages(::Google::Cloud::Dialogflow::V2::ListMessagesRequest.new(parent: parent, filter: filter, 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_messages_client_stub.call_rpc_count + end + end + + def test_suggest_conversation_summary + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + latest_message = "hello world" + context_size = 42 + assist_query_params = {} + + suggest_conversation_summary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :suggest_conversation_summary, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest, request + assert_equal "hello world", request["conversation"] + assert_equal "hello world", request["latest_message"] + assert_equal 42, request["context_size"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), request["assist_query_params"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, suggest_conversation_summary_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.suggest_conversation_summary({ conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.suggest_conversation_summary conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.suggest_conversation_summary ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new(conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.suggest_conversation_summary({ conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.suggest_conversation_summary(::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new(conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, suggest_conversation_summary_client_stub.call_rpc_count + end + end + + def test_generate_stateless_summary + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + stateless_conversation = {} + conversation_profile = {} + latest_message = "hello world" + max_context_size = 42 + + generate_stateless_summary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_stateless_summary, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest::MinimalConversation), request["stateless_conversation"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationProfile), request["conversation_profile"] + assert_equal "hello world", request["latest_message"] + assert_equal 42, request["max_context_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_stateless_summary_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.generate_stateless_summary({ stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.generate_stateless_summary stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.generate_stateless_summary ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new(stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.generate_stateless_summary({ stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.generate_stateless_summary(::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new(stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_stateless_summary_client_stub.call_rpc_count + end + end + + def test_generate_stateless_suggestion + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + generator = {} + context_references = {} + conversation_context = {} + trigger_events = [:TRIGGER_EVENT_UNSPECIFIED] + security_settings = "hello world" + + generate_stateless_suggestion_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_stateless_suggestion, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Generator), request["generator"] + assert_equal :generator, request.generator_resource + assert_equal({}, request["context_references"].to_h) + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationContext), request["conversation_context"] + assert_equal [:TRIGGER_EVENT_UNSPECIFIED], request["trigger_events"] + assert_equal "hello world", request["security_settings"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_stateless_suggestion_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.generate_stateless_suggestion({ parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.generate_stateless_suggestion parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.generate_stateless_suggestion ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new(parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.generate_stateless_suggestion({ parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.generate_stateless_suggestion(::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new(parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_stateless_suggestion_client_stub.call_rpc_count + end + end + + def test_search_knowledge + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + query = {} + conversation_profile = "hello world" + session_id = "hello world" + conversation = "hello world" + latest_message = "hello world" + query_source = :QUERY_SOURCE_UNSPECIFIED + end_user_metadata = {} + search_config = {} + exact_search = true + + search_knowledge_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_knowledge, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::TextInput), request["query"] + assert_equal "hello world", request["conversation_profile"] + assert_equal "hello world", request["session_id"] + assert_equal "hello world", request["conversation"] + assert_equal "hello world", request["latest_message"] + assert_equal :QUERY_SOURCE_UNSPECIFIED, request["query_source"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["end_user_metadata"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig), request["search_config"] + assert_equal true, request["exact_search"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_knowledge_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.search_knowledge({ parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.search_knowledge parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.search_knowledge ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new(parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.search_knowledge({ parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.search_knowledge(::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new(parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_knowledge_client_stub.call_rpc_count + end + end + + def test_generate_suggestions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + latest_message = "hello world" + trigger_events = [:TRIGGER_EVENT_UNSPECIFIED] + + generate_suggestions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_suggestions, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest, request + assert_equal "hello world", request["conversation"] + assert_equal "hello world", request["latest_message"] + assert_equal [:TRIGGER_EVENT_UNSPECIFIED], request["trigger_events"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_suggestions_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.generate_suggestions({ conversation: conversation, latest_message: latest_message, trigger_events: trigger_events }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.generate_suggestions conversation: conversation, latest_message: latest_message, trigger_events: trigger_events do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.generate_suggestions ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new(conversation: conversation, latest_message: latest_message, trigger_events: trigger_events) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.generate_suggestions({ conversation: conversation, latest_message: latest_message, trigger_events: trigger_events }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.generate_suggestions(::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new(conversation: conversation, latest_message: latest_message, trigger_events: trigger_events), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_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::Dialogflow::V2::Conversations::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::Dialogflow::V2::Conversations::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::Dialogflow::V2::Conversations::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Conversations::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb new file mode 100644 index 000000000000..f250723d2be3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_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/dialogflow/v2/document_pb" +require "google/cloud/dialogflow/v2/document_services_pb" +require "google/cloud/dialogflow/v2/documents" + +class ::Google::Cloud::Dialogflow::V2::Documents::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 + c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb new file mode 100644 index 000000000000..25179732e8c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_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/dialogflow/v2/documents" + +class ::Google::Cloud::Dialogflow::V2::Documents::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_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::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.document_path project: "value0", knowledge_base: "value1", document: "value2" + assert_equal "projects/value0/knowledgeBases/value1/documents/value2", path + + path = client.document_path project: "value0", location: "value1", knowledge_base: "value2", document: "value3" + assert_equal "projects/value0/locations/value1/knowledgeBases/value2/documents/value3", path + end + end + + def test_knowledge_base_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.knowledge_base_path project: "value0", knowledge_base: "value1" + assert_equal "projects/value0/knowledgeBases/value1", path + + path = client.knowledge_base_path project: "value0", location: "value1", knowledge_base: "value2" + assert_equal "projects/value0/locations/value1/knowledgeBases/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb new file mode 100644 index 000000000000..5f9051d968a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb @@ -0,0 +1,545 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/document_pb" +require "google/cloud/dialogflow/v2/documents/rest" + + +class ::Google::Cloud::Dialogflow::V2::Documents::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_documents + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::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" + filter = "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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_list_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_documents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_documents({ 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 + c.list_documents 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 + c.list_documents ::Google::Cloud::Dialogflow::V2::ListDocumentsRequest.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 + c.list_documents({ 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 + c.list_documents(::Google::Cloud::Dialogflow::V2::ListDocumentsRequest.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_documents_client_stub.call_count + end + end + end + + def test_get_document + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_get_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_document({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_document name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_document ::Google::Cloud::Dialogflow::V2::GetDocumentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_document({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_document(::Google::Cloud::Dialogflow::V2::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_create_document + # 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" + document = {} + + 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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_create_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_document({ parent: parent, document: document }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_document parent: parent, document: document do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_document ::Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new(parent: parent, document: document) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_document({ parent: parent, document: document }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_document(::Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new(parent: parent, document: document), 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_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. + parent = "hello world" + gcs_source = {} + document_template = {} + import_gcs_custom_metadata = 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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_import_documents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_documents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.import_documents({ parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.import_documents parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.import_documents ::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new(parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.import_documents({ parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.import_documents(::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new(parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata), 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_delete_document + # 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_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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_delete_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_document({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_document name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_document ::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_document({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_document(::Google::Cloud::Dialogflow::V2::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_update_document + # 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. + document = {} + 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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_update_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_document({ document: document, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_document document: document, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_document ::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new(document: document, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_document({ document: document, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_document(::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new(document: document, 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_reload_document + # 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" + content_uri = "hello world" + import_gcs_custom_metadata = true + smart_messaging_partial_update = true + + reload_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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_reload_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reload_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.reload_document({ name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.reload_document name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.reload_document ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new(name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.reload_document({ name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.reload_document(::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new(name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reload_document_client_stub.call_count + end + end + end + + def test_export_document + # 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" + gcs_destination = {} + export_full_content = true + smart_messaging_partial_update = true + + export_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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_export_document_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, export_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.export_document({ name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.export_document name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.export_document ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new(name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.export_document({ name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.export_document(::Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new(name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, export_document_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::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb new file mode 100644 index 000000000000..691ae755215c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb @@ -0,0 +1,648 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/document_pb" +require "google/cloud/dialogflow/v2/documents" + +class ::Google::Cloud::Dialogflow::V2::Documents::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_documents + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::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" + filter = "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::Dialogflow::V2::ListDocumentsRequest, 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_documents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_documents({ 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 + c.list_documents 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 + c.list_documents ::Google::Cloud::Dialogflow::V2::ListDocumentsRequest.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 + c.list_documents({ 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 + c.list_documents(::Google::Cloud::Dialogflow::V2::ListDocumentsRequest.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_documents_client_stub.call_rpc_count + end + end + + def test_get_document + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::GetDocumentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_document({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_document name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_document ::Google::Cloud::Dialogflow::V2::GetDocumentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.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 + c.get_document(::Google::Cloud::Dialogflow::V2::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_create_document + # 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" + document = {} + + create_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_document, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateDocumentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Document), request["document"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_document({ parent: parent, document: document }) 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 + c.create_document parent: parent, document: document 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 + c.create_document ::Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new(parent: parent, document: document) 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 + c.create_document({ parent: parent, document: document }, 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 + c.create_document(::Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new(parent: parent, document: document), 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_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. + parent = "hello world" + gcs_source = {} + document_template = {} + import_gcs_custom_metadata = 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::Dialogflow::V2::ImportDocumentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::GcsSources), request["gcs_source"] + assert_equal :gcs_source, request.source + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ImportDocumentTemplate), request["document_template"] + assert_equal true, request["import_gcs_custom_metadata"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_documents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.import_documents({ parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata }) 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 + c.import_documents parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata 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 + c.import_documents ::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new(parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata) 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 + c.import_documents({ parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata }, 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 + c.import_documents(::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new(parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata), 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_delete_document + # 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_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_document, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_document({ 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 + c.delete_document 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 + c.delete_document ::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.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 + c.delete_document({ 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 + c.delete_document(::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.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_document_client_stub.call_rpc_count + end + end + + def test_update_document + # 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. + document = {} + 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::Dialogflow::V2::UpdateDocumentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Document), request["document"] + 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 + c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_document({ document: document, update_mask: update_mask }) 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 + c.update_document document: document, update_mask: update_mask 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 + c.update_document ::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new(document: document, update_mask: update_mask) 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 + c.update_document({ document: document, update_mask: update_mask }, 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 + c.update_document(::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new(document: document, update_mask: update_mask), 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_document_client_stub.call_rpc_count + end + end + + def test_reload_document + # 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" + content_uri = "hello world" + import_gcs_custom_metadata = true + smart_messaging_partial_update = true + + reload_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reload_document, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["content_uri"] + assert_equal :content_uri, request.source + assert_equal true, request["import_gcs_custom_metadata"] + assert_equal true, request["smart_messaging_partial_update"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reload_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.reload_document({ name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update }) 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 + c.reload_document name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update 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 + c.reload_document ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new(name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update) 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 + c.reload_document({ name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update }, 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 + c.reload_document(::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new(name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update), 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, reload_document_client_stub.call_rpc_count + end + end + + def test_export_document + # 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" + gcs_destination = {} + export_full_content = true + smart_messaging_partial_update = true + + export_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :export_document, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::GcsDestination), request["gcs_destination"] + assert_equal :gcs_destination, request.destination + assert_equal true, request["export_full_content"] + assert_equal true, request["smart_messaging_partial_update"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, export_document_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.export_document({ name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update }) 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 + c.export_document name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update 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 + c.export_document ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new(name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update) 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 + c.export_document({ name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update }, 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 + c.export_document(::Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new(name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update), 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, export_document_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::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::V2::Documents::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_operations_test.rb new file mode 100644 index 000000000000..79ee72e1d1eb --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/encryption_spec_pb" +require "google/cloud/dialogflow/v2/encryption_spec_services_pb" +require "google/cloud/dialogflow/v2/encryption_spec_service" + +class ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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 + c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_paths_test.rb new file mode 100644 index 000000000000..5741e3b25302 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/encryption_spec_service" + +class ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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_encryption_spec_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.encryption_spec_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/encryptionSpec", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_rest_test.rb new file mode 100644 index 000000000000..a27919780fac --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_rest_test.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! + +require "helper" +require "gapic/rest" +require "google/cloud/dialogflow/v2/encryption_spec_pb" +require "google/cloud/dialogflow/v2/encryption_spec_service/rest" + + +class ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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_encryption_spec + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::EncryptionSpec.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_encryption_spec_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::Dialogflow::V2::EncryptionSpecService::Rest::ServiceStub.stub :transcode_get_encryption_spec_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_encryption_spec_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_encryption_spec({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_encryption_spec name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_encryption_spec ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_encryption_spec({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_encryption_spec(::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_encryption_spec_client_stub.call_count + end + end + end + + def test_initialize_encryption_spec + # 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. + encryption_spec = {} + + initialize_encryption_spec_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::Dialogflow::V2::EncryptionSpecService::Rest::ServiceStub.stub :transcode_initialize_encryption_spec_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, initialize_encryption_spec_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.initialize_encryption_spec({ encryption_spec: encryption_spec }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.initialize_encryption_spec encryption_spec: encryption_spec do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.initialize_encryption_spec ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new(encryption_spec: encryption_spec) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.initialize_encryption_spec({ encryption_spec: encryption_spec }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.initialize_encryption_spec(::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new(encryption_spec: encryption_spec), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, initialize_encryption_spec_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::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_test.rb new file mode 100644 index 000000000000..ee38aa1ad0c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_test.rb @@ -0,0 +1,239 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/encryption_spec_pb" +require "google/cloud/dialogflow/v2/encryption_spec_service" + +class ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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_encryption_spec + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::EncryptionSpec.new + grpc_operation = GRPC::ActiveCall::Operation.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_encryption_spec_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_encryption_spec, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_encryption_spec_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_encryption_spec({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_encryption_spec name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_encryption_spec ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_encryption_spec({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_encryption_spec(::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.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_encryption_spec_client_stub.call_rpc_count + end + end + + def test_initialize_encryption_spec + # 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. + encryption_spec = {} + + initialize_encryption_spec_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :initialize_encryption_spec, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::EncryptionSpec), request["encryption_spec"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, initialize_encryption_spec_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.initialize_encryption_spec({ encryption_spec: encryption_spec }) 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 + c.initialize_encryption_spec encryption_spec: encryption_spec 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 + c.initialize_encryption_spec ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new(encryption_spec: encryption_spec) 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 + c.initialize_encryption_spec({ encryption_spec: encryption_spec }, 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 + c.initialize_encryption_spec(::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new(encryption_spec: encryption_spec), 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, initialize_encryption_spec_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::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb new file mode 100644 index 000000000000..540375d99656 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_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/dialogflow/v2/entity_type_pb" +require "google/cloud/dialogflow/v2/entity_type_services_pb" +require "google/cloud/dialogflow/v2/entity_types" + +class ::Google::Cloud::Dialogflow::V2::EntityTypes::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 + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb new file mode 100644 index 000000000000..7770fc0cb21e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_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/dialogflow/v2/entity_types" + +class ::Google::Cloud::Dialogflow::V2::EntityTypes::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_agent_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0" + assert_equal "projects/value0/agent", path + + path = client.agent_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/agent", path + end + end + + def test_entity_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.entity_type_path project: "value0", entity_type: "value1" + assert_equal "projects/value0/agent/entityTypes/value1", path + + path = client.entity_type_path project: "value0", location: "value1", entity_type: "value2" + assert_equal "projects/value0/locations/value1/agent/entityTypes/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb new file mode 100644 index 000000000000..d7686ee630ac --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb @@ -0,0 +1,658 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/entity_type_pb" +require "google/cloud/dialogflow/v2/entity_types/rest" + + +class ::Google::Cloud::Dialogflow::V2::EntityTypes::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_entity_types + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + language_code = "hello world" + page_size = 42 + page_token = "hello world" + + list_entity_types_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_list_entity_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_entity_types_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_entity_types({ parent: parent, language_code: language_code, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_entity_types parent: parent, language_code: language_code, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_entity_types ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new(parent: parent, language_code: language_code, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_entity_types({ parent: parent, language_code: language_code, 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 + c.list_entity_types(::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new(parent: parent, language_code: language_code, 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_entity_types_client_stub.call_count + end + end + end + + def test_get_entity_type + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::EntityType.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + language_code = "hello world" + + get_entity_type_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_get_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_entity_type({ name: name, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_entity_type name: name, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_entity_type ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new(name: name, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_entity_type({ name: name, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_entity_type(::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new(name: name, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_entity_type_client_stub.call_count + end + end + end + + def test_create_entity_type + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::EntityType.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + entity_type = {} + language_code = "hello world" + + create_entity_type_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_create_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_entity_type({ parent: parent, entity_type: entity_type, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_entity_type parent: parent, entity_type: entity_type, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_entity_type ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new(parent: parent, entity_type: entity_type, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_entity_type({ parent: parent, entity_type: entity_type, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_entity_type(::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new(parent: parent, entity_type: entity_type, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_entity_type_client_stub.call_count + end + end + end + + def test_update_entity_type + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::EntityType.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + entity_type = {} + language_code = "hello world" + update_mask = {} + + update_entity_type_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_update_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_entity_type({ entity_type: entity_type, language_code: language_code, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_entity_type entity_type: entity_type, language_code: language_code, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_entity_type ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new(entity_type: entity_type, language_code: language_code, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_entity_type({ entity_type: entity_type, language_code: language_code, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_entity_type(::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new(entity_type: entity_type, language_code: language_code, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_entity_type_client_stub.call_count + end + end + end + + def test_delete_entity_type + # 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_entity_type_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_delete_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_entity_type({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_entity_type name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_entity_type ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_entity_type({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_entity_type(::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_entity_type_client_stub.call_count + end + end + end + + def test_batch_update_entity_types + # 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" + entity_type_batch_uri = "hello world" + language_code = "hello world" + update_mask = {} + + batch_update_entity_types_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_update_entity_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_update_entity_types_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.batch_update_entity_types({ parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.batch_update_entity_types parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.batch_update_entity_types ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new(parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.batch_update_entity_types({ parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.batch_update_entity_types(::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new(parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_update_entity_types_client_stub.call_count + end + end + end + + def test_batch_delete_entity_types + # 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" + entity_type_names = ["hello world"] + + batch_delete_entity_types_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_delete_entity_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_delete_entity_types_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.batch_delete_entity_types({ parent: parent, entity_type_names: entity_type_names }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.batch_delete_entity_types parent: parent, entity_type_names: entity_type_names do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.batch_delete_entity_types ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new(parent: parent, entity_type_names: entity_type_names) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.batch_delete_entity_types({ parent: parent, entity_type_names: entity_type_names }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.batch_delete_entity_types(::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new(parent: parent, entity_type_names: entity_type_names), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_delete_entity_types_client_stub.call_count + end + end + end + + def test_batch_create_entities + # 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" + entities = [{}] + language_code = "hello world" + + batch_create_entities_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_create_entities_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_create_entities_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.batch_create_entities({ parent: parent, entities: entities, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.batch_create_entities parent: parent, entities: entities, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.batch_create_entities ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.batch_create_entities({ parent: parent, entities: entities, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.batch_create_entities(::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_create_entities_client_stub.call_count + end + end + end + + def test_batch_update_entities + # 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" + entities = [{}] + language_code = "hello world" + update_mask = {} + + batch_update_entities_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_update_entities_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_update_entities_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.batch_update_entities({ parent: parent, entities: entities, language_code: language_code, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.batch_update_entities parent: parent, entities: entities, language_code: language_code, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.batch_update_entities ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.batch_update_entities({ parent: parent, entities: entities, language_code: language_code, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.batch_update_entities(::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_update_entities_client_stub.call_count + end + end + end + + def test_batch_delete_entities + # 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" + entity_values = ["hello world"] + language_code = "hello world" + + batch_delete_entities_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_delete_entities_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_delete_entities_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.batch_delete_entities({ parent: parent, entity_values: entity_values, language_code: language_code }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.batch_delete_entities parent: parent, entity_values: entity_values, language_code: language_code do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.batch_delete_entities ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new(parent: parent, entity_values: entity_values, language_code: language_code) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.batch_delete_entities({ parent: parent, entity_values: entity_values, language_code: language_code }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.batch_delete_entities(::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new(parent: parent, entity_values: entity_values, language_code: language_code), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_delete_entities_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::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb new file mode 100644 index 000000000000..b500addee8a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb @@ -0,0 +1,767 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/entity_type_pb" +require "google/cloud/dialogflow/v2/entity_types" + +class ::Google::Cloud::Dialogflow::V2::EntityTypes::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_entity_types + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + language_code = "hello world" + page_size = 42 + page_token = "hello world" + + list_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_entity_types, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["language_code"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_entity_types_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_entity_types({ parent: parent, language_code: language_code, 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 + c.list_entity_types parent: parent, language_code: language_code, 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 + c.list_entity_types ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new(parent: parent, language_code: language_code, 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 + c.list_entity_types({ parent: parent, language_code: language_code, 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 + c.list_entity_types(::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new(parent: parent, language_code: language_code, 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_entity_types_client_stub.call_rpc_count + end + end + + def test_get_entity_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::EntityType.new + grpc_operation = GRPC::ActiveCall::Operation.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" + language_code = "hello world" + + get_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_entity_type, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_entity_type({ name: name, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_entity_type name: name, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_entity_type ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new(name: name, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_entity_type({ name: name, language_code: language_code }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_entity_type(::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new(name: name, language_code: language_code), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_entity_type_client_stub.call_rpc_count + end + end + + def test_create_entity_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::EntityType.new + grpc_operation = GRPC::ActiveCall::Operation.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" + entity_type = {} + language_code = "hello world" + + create_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_entity_type, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::EntityType), request["entity_type"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_entity_type({ parent: parent, entity_type: entity_type, language_code: language_code }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_entity_type parent: parent, entity_type: entity_type, language_code: language_code do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_entity_type ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new(parent: parent, entity_type: entity_type, language_code: language_code) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_entity_type({ parent: parent, entity_type: entity_type, language_code: language_code }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_entity_type(::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new(parent: parent, entity_type: entity_type, language_code: language_code), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_entity_type_client_stub.call_rpc_count + end + end + + def test_update_entity_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::EntityType.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + entity_type = {} + language_code = "hello world" + update_mask = {} + + update_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_entity_type, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::EntityType), request["entity_type"] + assert_equal "hello world", request["language_code"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_entity_type({ entity_type: entity_type, language_code: language_code, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_entity_type entity_type: entity_type, language_code: language_code, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_entity_type ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new(entity_type: entity_type, language_code: language_code, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_entity_type({ entity_type: entity_type, language_code: language_code, 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 + c.update_entity_type(::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new(entity_type: entity_type, language_code: language_code, 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_entity_type_client_stub.call_rpc_count + end + end + + def test_delete_entity_type + # 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_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_entity_type, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_entity_type({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_entity_type name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_entity_type ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_entity_type({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_entity_type(::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.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_entity_type_client_stub.call_rpc_count + end + end + + def test_batch_update_entity_types + # 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" + entity_type_batch_uri = "hello world" + language_code = "hello world" + update_mask = {} + + batch_update_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_update_entity_types, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["entity_type_batch_uri"] + assert_equal :entity_type_batch_uri, request.entity_type_batch + assert_equal "hello world", request["language_code"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_update_entity_types_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.batch_update_entity_types({ parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask }) 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 + c.batch_update_entity_types parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask 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 + c.batch_update_entity_types ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new(parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask) 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 + c.batch_update_entity_types({ parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask }, 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 + c.batch_update_entity_types(::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new(parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask), 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_entity_types_client_stub.call_rpc_count + end + end + + def test_batch_delete_entity_types + # 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" + entity_type_names = ["hello world"] + + batch_delete_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_delete_entity_types, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["entity_type_names"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_delete_entity_types_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.batch_delete_entity_types({ parent: parent, entity_type_names: entity_type_names }) 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 + c.batch_delete_entity_types parent: parent, entity_type_names: entity_type_names 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 + c.batch_delete_entity_types ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new(parent: parent, entity_type_names: entity_type_names) 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 + c.batch_delete_entity_types({ parent: parent, entity_type_names: entity_type_names }, 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 + c.batch_delete_entity_types(::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new(parent: parent, entity_type_names: entity_type_names), 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_delete_entity_types_client_stub.call_rpc_count + end + end + + def test_batch_create_entities + # 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" + entities = [{}] + language_code = "hello world" + + batch_create_entities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_create_entities, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Dialogflow::V2::EntityType::Entity, request["entities"].first + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_create_entities_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.batch_create_entities({ parent: parent, entities: entities, language_code: language_code }) 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 + c.batch_create_entities parent: parent, entities: entities, language_code: language_code 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 + c.batch_create_entities ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code) 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 + c.batch_create_entities({ parent: parent, entities: entities, language_code: language_code }, 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 + c.batch_create_entities(::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code), 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_entities_client_stub.call_rpc_count + end + end + + def test_batch_update_entities + # 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" + entities = [{}] + language_code = "hello world" + update_mask = {} + + batch_update_entities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_update_entities, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Dialogflow::V2::EntityType::Entity, request["entities"].first + assert_equal "hello world", request["language_code"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_update_entities_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.batch_update_entities({ parent: parent, entities: entities, language_code: language_code, update_mask: update_mask }) 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 + c.batch_update_entities parent: parent, entities: entities, language_code: language_code, update_mask: update_mask 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 + c.batch_update_entities ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code, update_mask: update_mask) 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 + c.batch_update_entities({ parent: parent, entities: entities, language_code: language_code, update_mask: update_mask }, 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 + c.batch_update_entities(::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code, update_mask: update_mask), 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_entities_client_stub.call_rpc_count + end + end + + def test_batch_delete_entities + # 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" + entity_values = ["hello world"] + language_code = "hello world" + + batch_delete_entities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_delete_entities, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, request + assert_equal "hello world", request["parent"] + assert_equal ["hello world"], request["entity_values"] + assert_equal "hello world", request["language_code"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_delete_entities_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.batch_delete_entities({ parent: parent, entity_values: entity_values, language_code: language_code }) 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 + c.batch_delete_entities parent: parent, entity_values: entity_values, language_code: language_code 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 + c.batch_delete_entities ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new(parent: parent, entity_values: entity_values, language_code: language_code) 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 + c.batch_delete_entities({ parent: parent, entity_values: entity_values, language_code: language_code }, 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 + c.batch_delete_entities(::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new(parent: parent, entity_values: entity_values, language_code: language_code), 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_delete_entities_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::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb new file mode 100644 index 000000000000..9b04be0bfedd --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_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/dialogflow/v2/environments" + +class ::Google::Cloud::Dialogflow::V2::Environments::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_agent_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0" + assert_equal "projects/value0/agent", path + + path = client.agent_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/agent", path + end + end + + def test_environment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.environment_path project: "value0", environment: "value1" + assert_equal "projects/value0/agent/environments/value1", path + + path = client.environment_path project: "value0", location: "value1", environment: "value2" + assert_equal "projects/value0/locations/value1/agent/environments/value2", path + end + end + + def test_fulfillment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.fulfillment_path project: "value0" + assert_equal "projects/value0/agent/fulfillment", path + + path = client.fulfillment_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/agent/fulfillment", path + end + end + + def test_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.version_path project: "value0", version: "value1" + assert_equal "projects/value0/agent/versions/value1", path + + path = client.version_path project: "value0", location: "value1", version: "value2" + assert_equal "projects/value0/locations/value1/agent/versions/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb new file mode 100644 index 000000000000..a2374d556b56 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb @@ -0,0 +1,431 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/environment_pb" +require "google/cloud/dialogflow/v2/environments/rest" + + +class ::Google::Cloud::Dialogflow::V2::Environments::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_environments + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse.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_environments_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_list_environments_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_environments_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_environments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_environments parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_environments ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.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 + c.list_environments({ 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 + c.list_environments(::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.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_environments_client_stub.call_count + end + end + end + + def test_get_environment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Environment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_environment_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_get_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_environment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_environment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_environment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_environment ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_environment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_environment(::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_environment_client_stub.call_count + end + end + end + + def test_create_environment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Environment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + environment = {} + environment_id = "hello world" + + create_environment_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_create_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_environment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_environment({ parent: parent, environment: environment, environment_id: environment_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_environment parent: parent, environment: environment, environment_id: environment_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_environment ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new(parent: parent, environment: environment, environment_id: environment_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_environment({ parent: parent, environment: environment, environment_id: environment_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_environment(::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new(parent: parent, environment: environment, environment_id: environment_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_environment_client_stub.call_count + end + end + end + + def test_update_environment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Environment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + environment = {} + update_mask = {} + allow_load_to_draft_and_discard_changes = true + + update_environment_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_update_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_environment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_environment({ environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_environment environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_environment ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_environment({ environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_environment(::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_environment_client_stub.call_count + end + end + end + + def test_delete_environment + # 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_environment_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_delete_environment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_environment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_environment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_environment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_environment ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_environment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_environment(::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_environment_client_stub.call_count + end + end + end + + def test_get_environment_history + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::EnvironmentHistory.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" + + get_environment_history_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_get_environment_history_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_environment_history_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_environment_history({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_environment_history parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_environment_history ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.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 + c.get_environment_history({ 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 + c.get_environment_history(::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.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, get_environment_history_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::Dialogflow::V2::Environments::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::Dialogflow::V2::Environments::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb new file mode 100644 index 000000000000..68d88444600c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/v2/environment_pb" +require "google/cloud/dialogflow/v2/environments" + +class ::Google::Cloud::Dialogflow::V2::Environments::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_environments + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_environments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_environments, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, 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_environments_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_environments({ 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 + c.list_environments 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 + c.list_environments ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.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 + c.list_environments({ 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 + c.list_environments(::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.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_environments_client_stub.call_rpc_count + end + end + + def test_get_environment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Environment.new + grpc_operation = GRPC::ActiveCall::Operation.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_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_environment, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_environment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_environment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_environment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_environment ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_environment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_environment(::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.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_environment_client_stub.call_rpc_count + end + end + + def test_create_environment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Environment.new + grpc_operation = GRPC::ActiveCall::Operation.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" + environment = {} + environment_id = "hello world" + + create_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_environment, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Environment), request["environment"] + assert_equal "hello world", request["environment_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_environment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_environment({ parent: parent, environment: environment, environment_id: environment_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_environment parent: parent, environment: environment, environment_id: environment_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_environment ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new(parent: parent, environment: environment, environment_id: environment_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_environment({ parent: parent, environment: environment, environment_id: environment_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_environment(::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new(parent: parent, environment: environment, environment_id: environment_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_environment_client_stub.call_rpc_count + end + end + + def test_update_environment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Environment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + environment = {} + update_mask = {} + allow_load_to_draft_and_discard_changes = true + + update_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_environment, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Environment), request["environment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["allow_load_to_draft_and_discard_changes"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_environment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_environment({ environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_environment environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_environment ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_environment({ environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.update_environment(::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_environment_client_stub.call_rpc_count + end + end + + def test_delete_environment + # 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_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_environment, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_environment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_environment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_environment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_environment ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_environment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_environment(::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.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_environment_client_stub.call_rpc_count + end + end + + def test_get_environment_history + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::EnvironmentHistory.new + grpc_operation = GRPC::ActiveCall::Operation.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" + + get_environment_history_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_environment_history, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, 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, get_environment_history_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_environment_history({ 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 + c.get_environment_history 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 + c.get_environment_history ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.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 + c.get_environment_history({ 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 + c.get_environment_history(::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.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, get_environment_history_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::Dialogflow::V2::Environments::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::Dialogflow::V2::Environments::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::Dialogflow::V2::Environments::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Environments::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb new file mode 100644 index 000000000000..3c9cb3678141 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_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/dialogflow/v2/fulfillments" + +class ::Google::Cloud::Dialogflow::V2::Fulfillments::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_fulfillment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.fulfillment_path project: "value0" + assert_equal "projects/value0/agent/fulfillment", path + + path = client.fulfillment_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/agent/fulfillment", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb new file mode 100644 index 000000000000..a35cef0b88b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb @@ -0,0 +1,208 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/fulfillment_pb" +require "google/cloud/dialogflow/v2/fulfillments/rest" + + +class ::Google::Cloud::Dialogflow::V2::Fulfillments::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_fulfillment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Fulfillment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_fulfillment_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::Dialogflow::V2::Fulfillments::Rest::ServiceStub.stub :transcode_get_fulfillment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_fulfillment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_fulfillment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_fulfillment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_fulfillment ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_fulfillment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_fulfillment(::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_fulfillment_client_stub.call_count + end + end + end + + def test_update_fulfillment + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Fulfillment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + fulfillment = {} + update_mask = {} + + update_fulfillment_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::Dialogflow::V2::Fulfillments::Rest::ServiceStub.stub :transcode_update_fulfillment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_fulfillment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_fulfillment({ fulfillment: fulfillment, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_fulfillment fulfillment: fulfillment, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_fulfillment ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new(fulfillment: fulfillment, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_fulfillment({ fulfillment: fulfillment, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_fulfillment(::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new(fulfillment: fulfillment, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_fulfillment_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::Dialogflow::V2::Fulfillments::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::Dialogflow::V2::Fulfillments::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb new file mode 100644 index 000000000000..5d8dabcf5b99 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/dialogflow/v2/fulfillment_pb" +require "google/cloud/dialogflow/v2/fulfillments" + +class ::Google::Cloud::Dialogflow::V2::Fulfillments::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_fulfillment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Fulfillment.new + grpc_operation = GRPC::ActiveCall::Operation.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_fulfillment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_fulfillment, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_fulfillment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_fulfillment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_fulfillment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_fulfillment ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_fulfillment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_fulfillment(::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.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_fulfillment_client_stub.call_rpc_count + end + end + + def test_update_fulfillment + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Fulfillment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + fulfillment = {} + update_mask = {} + + update_fulfillment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_fulfillment, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Fulfillment), request["fulfillment"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_fulfillment_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_fulfillment({ fulfillment: fulfillment, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_fulfillment fulfillment: fulfillment, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_fulfillment ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new(fulfillment: fulfillment, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_fulfillment({ fulfillment: fulfillment, 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 + c.update_fulfillment(::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new(fulfillment: fulfillment, 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_fulfillment_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::Dialogflow::V2::Fulfillments::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::Dialogflow::V2::Fulfillments::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::Dialogflow::V2::Fulfillments::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Fulfillments::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_operations_test.rb new file mode 100644 index 000000000000..9623271b5940 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_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/dialogflow/v2/generator_evaluation_pb" +require "google/cloud/dialogflow/v2/generator_evaluation_services_pb" +require "google/cloud/dialogflow/v2/generator_evaluations" + +class ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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 + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_paths_test.rb new file mode 100644 index 000000000000..dc218735054b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_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/dialogflow/v2/generator_evaluations" + +class ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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_app_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.app_path project: "value0", location: "value1", app: "value2" + assert_equal "projects/value0/locations/value1/apps/value2", path + end + end + + def test_generator_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", generator: "value2" + assert_equal "projects/value0/locations/value1/generators/value2", path + end + end + + def test_generator_evaluation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_evaluation_path project: "value0", location: "value1", generator: "value2", evaluation: "value3" + assert_equal "projects/value0/locations/value1/generators/value2/evaluations/value3", path + end + end + + def test_tool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", tool: "value2" + assert_equal "projects/value0/locations/value1/tools/value2", path + + path = client.tool_path project: "value0", location: "value1", app: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/apps/value2/tools/value3", path + end + end + + def test_toolset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.toolset_path project: "value0", location: "value1", app: "value2", toolset: "value3" + assert_equal "projects/value0/locations/value1/apps/value2/toolsets/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_rest_test.rb new file mode 100644 index 000000000000..84dd661cb81d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_rest_test.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/generator_evaluation_pb" +require "google/cloud/dialogflow/v2/generator_evaluations/rest" + + +class ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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_generator_evaluation + # 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" + generator_evaluation = {} + + create_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.stub :transcode_create_generator_evaluation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_generator_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_generator_evaluation({ parent: parent, generator_evaluation: generator_evaluation }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_generator_evaluation parent: parent, generator_evaluation: generator_evaluation do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_generator_evaluation ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new(parent: parent, generator_evaluation: generator_evaluation) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_generator_evaluation({ parent: parent, generator_evaluation: generator_evaluation }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_generator_evaluation(::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new(parent: parent, generator_evaluation: generator_evaluation), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_generator_evaluation_client_stub.call_count + end + end + end + + def test_get_generator_evaluation + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.stub :transcode_get_generator_evaluation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_generator_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_generator_evaluation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_generator_evaluation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_generator_evaluation ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_generator_evaluation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_generator_evaluation(::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_generator_evaluation_client_stub.call_count + end + end + end + + def test_list_generator_evaluations + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse.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_generator_evaluations_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::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.stub :transcode_list_generator_evaluations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_generator_evaluations_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_generator_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_generator_evaluations parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_generator_evaluations ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.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 + c.list_generator_evaluations({ 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 + c.list_generator_evaluations(::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.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_generator_evaluations_client_stub.call_count + end + end + end + + def test_delete_generator_evaluation + # 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_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.stub :transcode_delete_generator_evaluation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_generator_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_generator_evaluation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_generator_evaluation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_generator_evaluation ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_generator_evaluation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_generator_evaluation(::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_test.rb new file mode 100644 index 000000000000..5230c5804a9e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_test.rb @@ -0,0 +1,366 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/generator_evaluation_pb" +require "google/cloud/dialogflow/v2/generator_evaluations" + +class ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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_generator_evaluation + # 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" + generator_evaluation = {} + + create_generator_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_generator_evaluation, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation), request["generator_evaluation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_generator_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_generator_evaluation({ parent: parent, generator_evaluation: generator_evaluation }) 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 + c.create_generator_evaluation parent: parent, generator_evaluation: generator_evaluation 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 + c.create_generator_evaluation ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new(parent: parent, generator_evaluation: generator_evaluation) 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 + c.create_generator_evaluation({ parent: parent, generator_evaluation: generator_evaluation }, 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 + c.create_generator_evaluation(::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new(parent: parent, generator_evaluation: generator_evaluation), 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_generator_evaluation_client_stub.call_rpc_count + end + end + + def test_get_generator_evaluation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation.new + grpc_operation = GRPC::ActiveCall::Operation.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_generator_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_generator_evaluation, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_generator_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_generator_evaluation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_generator_evaluation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_generator_evaluation ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_generator_evaluation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_generator_evaluation(::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.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_generator_evaluation_client_stub.call_rpc_count + end + end + + def test_list_generator_evaluations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_generator_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_generator_evaluations, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest, 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_generator_evaluations_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_generator_evaluations({ 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 + c.list_generator_evaluations 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 + c.list_generator_evaluations ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.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 + c.list_generator_evaluations({ 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 + c.list_generator_evaluations(::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.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_generator_evaluations_client_stub.call_rpc_count + end + end + + def test_delete_generator_evaluation + # 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_generator_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_generator_evaluation, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_generator_evaluation_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_generator_evaluation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_generator_evaluation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_generator_evaluation ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_generator_evaluation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_generator_evaluation(::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.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_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_paths_test.rb new file mode 100644 index 000000000000..5854e75f9f37 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_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/dialogflow/v2/generators" + +class ::Google::Cloud::Dialogflow::V2::Generators::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_app_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.app_path project: "value0", location: "value1", app: "value2" + assert_equal "projects/value0/locations/value1/apps/value2", path + end + end + + def test_generator_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.generator_path project: "value0", location: "value1", generator: "value2" + assert_equal "projects/value0/locations/value1/generators/value2", path + 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::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_tool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", tool: "value2" + assert_equal "projects/value0/locations/value1/tools/value2", path + + path = client.tool_path project: "value0", location: "value1", app: "value2", tool: "value3" + assert_equal "projects/value0/locations/value1/apps/value2/tools/value3", path + end + end + + def test_toolset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.toolset_path project: "value0", location: "value1", app: "value2", toolset: "value3" + assert_equal "projects/value0/locations/value1/apps/value2/toolsets/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_rest_test.rb new file mode 100644 index 000000000000..3202e981c81e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_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/dialogflow/v2/generator_pb" +require "google/cloud/dialogflow/v2/generators/rest" + + +class ::Google::Cloud::Dialogflow::V2::Generators::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_generator + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Generator.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + generator = {} + generator_id = "hello world" + + create_generator_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_create_generator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_generator_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_generator({ parent: parent, generator: generator, generator_id: generator_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_generator parent: parent, generator: generator, generator_id: generator_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_generator ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new(parent: parent, generator: generator, generator_id: generator_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_generator({ parent: parent, generator: generator, generator_id: generator_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_generator(::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new(parent: parent, generator: generator, generator_id: generator_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_generator_client_stub.call_count + end + end + end + + def test_get_generator + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Generator.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_generator_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_get_generator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_generator_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_generator({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_generator name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_generator ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_generator({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_generator(::Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_generator_client_stub.call_count + end + end + end + + def test_list_generators + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse.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_generators_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_list_generators_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_generators_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_generators({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_generators parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_generators ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.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 + c.list_generators({ 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 + c.list_generators(::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.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_generators_client_stub.call_count + end + end + end + + def test_delete_generator + # 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_generator_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_delete_generator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_generator_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_generator({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_generator name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_generator ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_generator({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_generator(::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_generator_client_stub.call_count + end + end + end + + def test_update_generator + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Generator.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + generator = {} + update_mask = {} + + update_generator_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_update_generator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_generator_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_generator({ generator: generator, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_generator generator: generator, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_generator ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new(generator: generator, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_generator({ generator: generator, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_generator(::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new(generator: generator, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_generator_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::Dialogflow::V2::Generators::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::Dialogflow::V2::Generators::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_test.rb new file mode 100644 index 000000000000..4647975e11d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_test.rb @@ -0,0 +1,409 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/generator_pb" +require "google/cloud/dialogflow/v2/generators" + +class ::Google::Cloud::Dialogflow::V2::Generators::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_generator + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Generator.new + grpc_operation = GRPC::ActiveCall::Operation.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" + generator = {} + generator_id = "hello world" + + create_generator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_generator, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Generator), request["generator"] + assert_equal "hello world", request["generator_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_generator_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_generator({ parent: parent, generator: generator, generator_id: generator_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_generator parent: parent, generator: generator, generator_id: generator_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_generator ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new(parent: parent, generator: generator, generator_id: generator_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_generator({ parent: parent, generator: generator, generator_id: generator_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_generator(::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new(parent: parent, generator: generator, generator_id: generator_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_generator_client_stub.call_rpc_count + end + end + + def test_get_generator + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Generator.new + grpc_operation = GRPC::ActiveCall::Operation.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_generator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_generator, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_generator_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_generator({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_generator name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_generator ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_generator({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_generator(::Google::Cloud::Dialogflow::V2::GetGeneratorRequest.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_generator_client_stub.call_rpc_count + end + end + + def test_list_generators + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_generators_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_generators, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest, 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_generators_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_generators({ 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 + c.list_generators 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 + c.list_generators ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.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 + c.list_generators({ 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 + c.list_generators(::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.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_generators_client_stub.call_rpc_count + end + end + + def test_delete_generator + # 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_generator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_generator, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_generator_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_generator({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_generator name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_generator ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_generator({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_generator(::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.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_generator_client_stub.call_rpc_count + end + end + + def test_update_generator + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Generator.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + generator = {} + update_mask = {} + + update_generator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_generator, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Generator), request["generator"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_generator_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_generator({ generator: generator, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_generator generator: generator, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_generator ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new(generator: generator, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_generator({ generator: generator, 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 + c.update_generator(::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new(generator: generator, 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_generator_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::Dialogflow::V2::Generators::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::Dialogflow::V2::Generators::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::Dialogflow::V2::Generators::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Generators::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb new file mode 100644 index 000000000000..2b3deb5fd6b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_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/dialogflow/v2/intent_pb" +require "google/cloud/dialogflow/v2/intent_services_pb" +require "google/cloud/dialogflow/v2/intents" + +class ::Google::Cloud::Dialogflow::V2::Intents::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 + c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb new file mode 100644 index 000000000000..3b92d86f739c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_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/dialogflow/v2/intents" + +class ::Google::Cloud::Dialogflow::V2::Intents::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_agent_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0" + assert_equal "projects/value0/agent", path + + path = client.agent_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/agent", path + end + end + + def test_context_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.context_path project: "value0", session: "value1", context: "value2" + assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path + + path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path + + path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" + assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path + + path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/value5", path + end + end + + def test_intent_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intent_path project: "value0", intent: "value1" + assert_equal "projects/value0/agent/intents/value1", path + + path = client.intent_path project: "value0", location: "value1", intent: "value2" + assert_equal "projects/value0/locations/value1/agent/intents/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb new file mode 100644 index 000000000000..a69d18c94ba0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb @@ -0,0 +1,494 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/intent_pb" +require "google/cloud/dialogflow/v2/intents/rest" + + +class ::Google::Cloud::Dialogflow::V2::Intents::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_intents + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListIntentsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + language_code = "hello world" + intent_view = :INTENT_VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_intents_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_list_intents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_intents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_intents({ parent: parent, language_code: language_code, intent_view: intent_view, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_intents parent: parent, language_code: language_code, intent_view: intent_view, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_intents ::Google::Cloud::Dialogflow::V2::ListIntentsRequest.new(parent: parent, language_code: language_code, intent_view: intent_view, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_intents({ parent: parent, language_code: language_code, intent_view: intent_view, 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 + c.list_intents(::Google::Cloud::Dialogflow::V2::ListIntentsRequest.new(parent: parent, language_code: language_code, intent_view: intent_view, 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_intents_client_stub.call_count + end + end + end + + def test_get_intent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Intent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + language_code = "hello world" + intent_view = :INTENT_VIEW_UNSPECIFIED + + get_intent_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_get_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_intent({ name: name, language_code: language_code, intent_view: intent_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_intent name: name, language_code: language_code, intent_view: intent_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_intent ::Google::Cloud::Dialogflow::V2::GetIntentRequest.new(name: name, language_code: language_code, intent_view: intent_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_intent({ name: name, language_code: language_code, intent_view: intent_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_intent(::Google::Cloud::Dialogflow::V2::GetIntentRequest.new(name: name, language_code: language_code, intent_view: intent_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_intent_client_stub.call_count + end + end + end + + def test_create_intent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Intent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + intent = {} + language_code = "hello world" + intent_view = :INTENT_VIEW_UNSPECIFIED + + create_intent_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_create_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_intent({ parent: parent, intent: intent, language_code: language_code, intent_view: intent_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_intent parent: parent, intent: intent, language_code: language_code, intent_view: intent_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_intent ::Google::Cloud::Dialogflow::V2::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code, intent_view: intent_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_intent({ parent: parent, intent: intent, language_code: language_code, intent_view: intent_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_intent(::Google::Cloud::Dialogflow::V2::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code, intent_view: intent_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_intent_client_stub.call_count + end + end + end + + def test_update_intent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Intent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + intent = {} + language_code = "hello world" + update_mask = {} + intent_view = :INTENT_VIEW_UNSPECIFIED + + update_intent_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_update_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_intent intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_intent ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_intent(::Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_intent_client_stub.call_count + end + end + end + + def test_delete_intent + # 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_intent_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_delete_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_intent({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_intent name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_intent ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_intent({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_intent(::Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_intent_client_stub.call_count + end + end + end + + def test_batch_update_intents + # 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" + intent_batch_uri = "hello world" + language_code = "hello world" + update_mask = {} + intent_view = :INTENT_VIEW_UNSPECIFIED + + batch_update_intents_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_batch_update_intents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_update_intents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.batch_update_intents({ parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.batch_update_intents parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.batch_update_intents ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new(parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.batch_update_intents({ parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.batch_update_intents(::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new(parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_update_intents_client_stub.call_count + end + end + end + + def test_batch_delete_intents + # 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" + intents = [{}] + + batch_delete_intents_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_batch_delete_intents_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_delete_intents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.batch_delete_intents({ parent: parent, intents: intents }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.batch_delete_intents parent: parent, intents: intents do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.batch_delete_intents ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new(parent: parent, intents: intents) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.batch_delete_intents({ parent: parent, intents: intents }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.batch_delete_intents(::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new(parent: parent, intents: intents), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_delete_intents_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::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb new file mode 100644 index 000000000000..4ae748e5c8c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb @@ -0,0 +1,574 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/intent_pb" +require "google/cloud/dialogflow/v2/intents" + +class ::Google::Cloud::Dialogflow::V2::Intents::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_intents + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListIntentsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + language_code = "hello world" + intent_view = :INTENT_VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + + list_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_intents, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListIntentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["language_code"] + assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_intents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_intents({ parent: parent, language_code: language_code, intent_view: intent_view, 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 + c.list_intents parent: parent, language_code: language_code, intent_view: intent_view, 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 + c.list_intents ::Google::Cloud::Dialogflow::V2::ListIntentsRequest.new(parent: parent, language_code: language_code, intent_view: intent_view, 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 + c.list_intents({ parent: parent, language_code: language_code, intent_view: intent_view, 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 + c.list_intents(::Google::Cloud::Dialogflow::V2::ListIntentsRequest.new(parent: parent, language_code: language_code, intent_view: intent_view, 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_intents_client_stub.call_rpc_count + end + end + + def test_get_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Intent.new + grpc_operation = GRPC::ActiveCall::Operation.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" + language_code = "hello world" + intent_view = :INTENT_VIEW_UNSPECIFIED + + get_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_intent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetIntentRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["language_code"] + assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_intent({ name: name, language_code: language_code, intent_view: intent_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_intent name: name, language_code: language_code, intent_view: intent_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_intent ::Google::Cloud::Dialogflow::V2::GetIntentRequest.new(name: name, language_code: language_code, intent_view: intent_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_intent({ name: name, language_code: language_code, intent_view: intent_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_intent(::Google::Cloud::Dialogflow::V2::GetIntentRequest.new(name: name, language_code: language_code, intent_view: intent_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_intent_client_stub.call_rpc_count + end + end + + def test_create_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Intent.new + grpc_operation = GRPC::ActiveCall::Operation.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" + intent = {} + language_code = "hello world" + intent_view = :INTENT_VIEW_UNSPECIFIED + + create_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_intent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateIntentRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Intent), request["intent"] + assert_equal "hello world", request["language_code"] + assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_intent({ parent: parent, intent: intent, language_code: language_code, intent_view: intent_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_intent parent: parent, intent: intent, language_code: language_code, intent_view: intent_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_intent ::Google::Cloud::Dialogflow::V2::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code, intent_view: intent_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_intent({ parent: parent, intent: intent, language_code: language_code, intent_view: intent_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_intent(::Google::Cloud::Dialogflow::V2::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code, intent_view: intent_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_intent_client_stub.call_rpc_count + end + end + + def test_update_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Intent.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + intent = {} + language_code = "hello world" + update_mask = {} + intent_view = :INTENT_VIEW_UNSPECIFIED + + update_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_intent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Intent), request["intent"] + assert_equal "hello world", request["language_code"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_intent intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_intent ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.update_intent(::Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_intent_client_stub.call_rpc_count + end + end + + def test_delete_intent + # 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_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_intent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_intent({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_intent name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_intent ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_intent({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_intent(::Google::Cloud::Dialogflow::V2::DeleteIntentRequest.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_intent_client_stub.call_rpc_count + end + end + + def test_batch_update_intents + # 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" + intent_batch_uri = "hello world" + language_code = "hello world" + update_mask = {} + intent_view = :INTENT_VIEW_UNSPECIFIED + + batch_update_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_update_intents, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["intent_batch_uri"] + assert_equal :intent_batch_uri, request.intent_batch + assert_equal "hello world", request["language_code"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_update_intents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.batch_update_intents({ parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view }) 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 + c.batch_update_intents parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view 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 + c.batch_update_intents ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new(parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view) 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 + c.batch_update_intents({ parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view }, 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 + c.batch_update_intents(::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new(parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view), 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_intents_client_stub.call_rpc_count + end + end + + def test_batch_delete_intents + # 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" + intents = [{}] + + batch_delete_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_delete_intents, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::Dialogflow::V2::Intent, request["intents"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_delete_intents_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.batch_delete_intents({ parent: parent, intents: intents }) 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 + c.batch_delete_intents parent: parent, intents: intents 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 + c.batch_delete_intents ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new(parent: parent, intents: intents) 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 + c.batch_delete_intents({ parent: parent, intents: intents }, 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 + c.batch_delete_intents(::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new(parent: parent, intents: intents), 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_delete_intents_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::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Dialogflow::V2::Intents::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb new file mode 100644 index 000000000000..4161ee267dcc --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/knowledge_bases" + +class ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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_knowledge_base_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.knowledge_base_path project: "value0", knowledge_base: "value1" + assert_equal "projects/value0/knowledgeBases/value1", path + + path = client.knowledge_base_path project: "value0", location: "value1", knowledge_base: "value2" + assert_equal "projects/value0/locations/value1/knowledgeBases/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::Dialogflow::V2::KnowledgeBases::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_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::Dialogflow::V2::KnowledgeBases::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-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb new file mode 100644 index 000000000000..69bad67da39d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_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/dialogflow/v2/knowledge_base_pb" +require "google/cloud/dialogflow/v2/knowledge_bases/rest" + + +class ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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_knowledge_bases + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse.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_knowledge_bases_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_list_knowledge_bases_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_knowledge_bases_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_knowledge_bases({ 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 + c.list_knowledge_bases 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 + c.list_knowledge_bases ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.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 + c.list_knowledge_bases({ 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 + c.list_knowledge_bases(::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.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_knowledge_bases_client_stub.call_count + end + end + end + + def test_get_knowledge_base + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_knowledge_base_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_get_knowledge_base_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_knowledge_base_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_knowledge_base({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_knowledge_base name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_knowledge_base ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_knowledge_base({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_knowledge_base(::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_knowledge_base_client_stub.call_count + end + end + end + + def test_create_knowledge_base + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + knowledge_base = {} + + create_knowledge_base_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_create_knowledge_base_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_knowledge_base_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_knowledge_base({ parent: parent, knowledge_base: knowledge_base }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_knowledge_base parent: parent, knowledge_base: knowledge_base do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_knowledge_base ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new(parent: parent, knowledge_base: knowledge_base) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_knowledge_base({ parent: parent, knowledge_base: knowledge_base }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_knowledge_base(::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new(parent: parent, knowledge_base: knowledge_base), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_knowledge_base_client_stub.call_count + end + end + end + + def test_delete_knowledge_base + # 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" + force = true + + delete_knowledge_base_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_delete_knowledge_base_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_knowledge_base_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_knowledge_base({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_knowledge_base name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_knowledge_base ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_knowledge_base({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_knowledge_base(::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new(name: name, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_knowledge_base_client_stub.call_count + end + end + end + + def test_update_knowledge_base + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + knowledge_base = {} + update_mask = {} + + update_knowledge_base_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_update_knowledge_base_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_knowledge_base_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_knowledge_base({ knowledge_base: knowledge_base, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_knowledge_base knowledge_base: knowledge_base, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_knowledge_base ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new(knowledge_base: knowledge_base, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_knowledge_base({ knowledge_base: knowledge_base, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_knowledge_base(::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new(knowledge_base: knowledge_base, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_knowledge_base_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::Dialogflow::V2::KnowledgeBases::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::Dialogflow::V2::KnowledgeBases::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb new file mode 100644 index 000000000000..62fb20c1c93b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_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/dialogflow/v2/knowledge_base_pb" +require "google/cloud/dialogflow/v2/knowledge_bases" + +class ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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_knowledge_bases + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_knowledge_bases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_knowledge_bases, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest, 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_knowledge_bases_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_knowledge_bases({ 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 + c.list_knowledge_bases 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 + c.list_knowledge_bases ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.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 + c.list_knowledge_bases({ 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 + c.list_knowledge_bases(::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.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_knowledge_bases_client_stub.call_rpc_count + end + end + + def test_get_knowledge_base + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new + grpc_operation = GRPC::ActiveCall::Operation.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_knowledge_base_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_knowledge_base, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_knowledge_base_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_knowledge_base({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_knowledge_base name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_knowledge_base ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_knowledge_base({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_knowledge_base(::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.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_knowledge_base_client_stub.call_rpc_count + end + end + + def test_create_knowledge_base + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new + grpc_operation = GRPC::ActiveCall::Operation.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" + knowledge_base = {} + + create_knowledge_base_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_knowledge_base, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::KnowledgeBase), request["knowledge_base"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_knowledge_base_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_knowledge_base({ parent: parent, knowledge_base: knowledge_base }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_knowledge_base parent: parent, knowledge_base: knowledge_base do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_knowledge_base ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new(parent: parent, knowledge_base: knowledge_base) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_knowledge_base({ parent: parent, knowledge_base: knowledge_base }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_knowledge_base(::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new(parent: parent, knowledge_base: knowledge_base), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_knowledge_base_client_stub.call_rpc_count + end + end + + def test_delete_knowledge_base + # 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" + force = true + + delete_knowledge_base_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_knowledge_base, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_knowledge_base_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_knowledge_base({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_knowledge_base name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_knowledge_base ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_knowledge_base({ name: name, force: force }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_knowledge_base(::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new(name: name, force: force), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_knowledge_base_client_stub.call_rpc_count + end + end + + def test_update_knowledge_base + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + knowledge_base = {} + update_mask = {} + + update_knowledge_base_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_knowledge_base, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::KnowledgeBase), request["knowledge_base"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_knowledge_base_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_knowledge_base({ knowledge_base: knowledge_base, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_knowledge_base knowledge_base: knowledge_base, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_knowledge_base ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new(knowledge_base: knowledge_base, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_knowledge_base({ knowledge_base: knowledge_base, 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 + c.update_knowledge_base(::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new(knowledge_base: knowledge_base, 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_knowledge_base_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::Dialogflow::V2::KnowledgeBases::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::Dialogflow::V2::KnowledgeBases::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::Dialogflow::V2::KnowledgeBases::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb new file mode 100644 index 000000000000..be8e08f8567b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/participants" + +class ::Google::Cloud::Dialogflow::V2::Participants::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_context_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.context_path project: "value0", session: "value1", context: "value2" + assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path + + path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path + + path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" + assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path + + path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/value5", 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::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.conversation_path project: "value0", conversation: "value1" + assert_equal "projects/value0/conversations/value1", path + + path = client.conversation_path project: "value0", location: "value1", conversation: "value2" + assert_equal "projects/value0/locations/value1/conversations/value2", path + end + end + + def test_message_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.message_path project: "value0", conversation: "value1", message: "value2" + assert_equal "projects/value0/conversations/value1/messages/value2", path + + path = client.message_path project: "value0", location: "value1", conversation: "value2", message: "value3" + assert_equal "projects/value0/locations/value1/conversations/value2/messages/value3", path + end + end + + def test_participant_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.participant_path project: "value0", conversation: "value1", participant: "value2" + assert_equal "projects/value0/conversations/value1/participants/value2", path + + path = client.participant_path project: "value0", location: "value1", conversation: "value2", participant: "value3" + assert_equal "projects/value0/locations/value1/conversations/value2/participants/value3", path + end + end + + def test_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", path + end + end + + def test_session_entity_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_entity_type_path project: "value0", session: "value1", entity_type: "value2" + assert_equal "projects/value0/agent/sessions/value1/entityTypes/value2", path + + path = client.session_entity_type_path project: "value0", environment: "value1", user: "value2", session: "value3", entity_type: "value4" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/entityTypes/value4", path + + path = client.session_entity_type_path project: "value0", location: "value1", session: "value2", entity_type: "value3" + assert_equal "projects/value0/locations/value1/agent/sessions/value2/entityTypes/value3", path + + path = client.session_entity_type_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", entity_type: "value5" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/entityTypes/value5", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb new file mode 100644 index 000000000000..a469b23ae7f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb @@ -0,0 +1,607 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/participant_pb" +require "google/cloud/dialogflow/v2/participants/rest" + + +class ::Google::Cloud::Dialogflow::V2::Participants::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_participant + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Participant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + participant = {} + + create_participant_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_create_participant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_participant_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_participant({ parent: parent, participant: participant }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_participant parent: parent, participant: participant do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_participant ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new(parent: parent, participant: participant) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_participant({ parent: parent, participant: participant }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_participant(::Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new(parent: parent, participant: participant), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_participant_client_stub.call_count + end + end + end + + def test_get_participant + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Participant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_participant_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_get_participant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_participant_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_participant({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_participant name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_participant ::Google::Cloud::Dialogflow::V2::GetParticipantRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_participant({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_participant(::Google::Cloud::Dialogflow::V2::GetParticipantRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_participant_client_stub.call_count + end + end + end + + def test_list_participants + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListParticipantsResponse.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_participants_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_list_participants_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_participants_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_participants({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_participants parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_participants ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest.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 + c.list_participants({ 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 + c.list_participants(::Google::Cloud::Dialogflow::V2::ListParticipantsRequest.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_participants_client_stub.call_count + end + end + end + + def test_update_participant + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Participant.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + participant = {} + update_mask = {} + + update_participant_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_update_participant_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_participant_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_participant({ participant: participant, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_participant participant: participant, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_participant ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new(participant: participant, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_participant({ participant: participant, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_participant(::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new(participant: participant, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_participant_client_stub.call_count + end + end + end + + def test_analyze_content + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + participant = "hello world" + text_input = {} + reply_audio_config = {} + query_params = {} + assist_query_params = {} + cx_parameters = {} + request_id = "hello world" + + analyze_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_analyze_content_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, analyze_content_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.analyze_content({ participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.analyze_content participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.analyze_content ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new(participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.analyze_content({ participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.analyze_content(::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new(participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, analyze_content_client_stub.call_count + end + end + end + + def test_suggest_articles + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + latest_message = "hello world" + context_size = 42 + assist_query_params = {} + + suggest_articles_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_suggest_articles_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, suggest_articles_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.suggest_articles({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.suggest_articles parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.suggest_articles ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.suggest_articles({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.suggest_articles(::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, suggest_articles_client_stub.call_count + end + end + end + + def test_suggest_faq_answers + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + latest_message = "hello world" + context_size = 42 + assist_query_params = {} + + suggest_faq_answers_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_suggest_faq_answers_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, suggest_faq_answers_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.suggest_faq_answers({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.suggest_faq_answers parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.suggest_faq_answers ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.suggest_faq_answers({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.suggest_faq_answers(::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, suggest_faq_answers_client_stub.call_count + end + end + end + + def test_suggest_smart_replies + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + current_text_input = {} + latest_message = "hello world" + context_size = 42 + + suggest_smart_replies_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_suggest_smart_replies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, suggest_smart_replies_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.suggest_smart_replies({ parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.suggest_smart_replies parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.suggest_smart_replies ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new(parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.suggest_smart_replies({ parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.suggest_smart_replies(::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new(parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, suggest_smart_replies_client_stub.call_count + end + end + end + + def test_suggest_knowledge_assist + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + latest_message = "hello world" + context_size = 42 + previous_suggested_query = "hello world" + + suggest_knowledge_assist_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_suggest_knowledge_assist_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, suggest_knowledge_assist_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.suggest_knowledge_assist({ parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.suggest_knowledge_assist parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.suggest_knowledge_assist ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.suggest_knowledge_assist({ parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.suggest_knowledge_assist(::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, suggest_knowledge_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::Dialogflow::V2::Participants::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::Dialogflow::V2::Participants::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb new file mode 100644 index 000000000000..758d586e2abf --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb @@ -0,0 +1,786 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/participant_pb" +require "google/cloud/dialogflow/v2/participants" + +class ::Google::Cloud::Dialogflow::V2::Participants::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_participant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Participant.new + grpc_operation = GRPC::ActiveCall::Operation.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" + participant = {} + + create_participant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_participant, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Participant), request["participant"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_participant_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_participant({ parent: parent, participant: participant }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_participant parent: parent, participant: participant do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_participant ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new(parent: parent, participant: participant) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_participant({ parent: parent, participant: participant }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_participant(::Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new(parent: parent, participant: participant), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_participant_client_stub.call_rpc_count + end + end + + def test_get_participant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Participant.new + grpc_operation = GRPC::ActiveCall::Operation.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_participant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_participant, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetParticipantRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_participant_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_participant({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_participant name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_participant ::Google::Cloud::Dialogflow::V2::GetParticipantRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_participant({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_participant(::Google::Cloud::Dialogflow::V2::GetParticipantRequest.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_participant_client_stub.call_rpc_count + end + end + + def test_list_participants + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListParticipantsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_participants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_participants, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, 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_participants_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_participants({ 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 + c.list_participants 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 + c.list_participants ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest.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 + c.list_participants({ 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 + c.list_participants(::Google::Cloud::Dialogflow::V2::ListParticipantsRequest.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_participants_client_stub.call_rpc_count + end + end + + def test_update_participant + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Participant.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + participant = {} + update_mask = {} + + update_participant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_participant, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Participant), request["participant"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_participant_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_participant({ participant: participant, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_participant participant: participant, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_participant ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new(participant: participant, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_participant({ participant: participant, 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 + c.update_participant(::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new(participant: participant, 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_participant_client_stub.call_rpc_count + end + end + + def test_analyze_content + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + participant = "hello world" + text_input = {} + reply_audio_config = {} + query_params = {} + assist_query_params = {} + cx_parameters = {} + request_id = "hello world" + + analyze_content_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :analyze_content, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, request + assert_equal "hello world", request["participant"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::TextInput), request["text_input"] + assert_equal :text_input, request.input + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::OutputAudioConfig), request["reply_audio_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryParameters), request["query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), request["assist_query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["cx_parameters"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, analyze_content_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.analyze_content({ participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.analyze_content participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.analyze_content ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new(participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.analyze_content({ participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.analyze_content(::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new(participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, analyze_content_client_stub.call_rpc_count + end + end + + def test_streaming_analyze_content + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse.new + grpc_operation = GRPC::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. + participant = "hello world" + audio_config = {} + reply_audio_config = {} + input_audio = "hello world" + query_params = {} + assist_query_params = {} + cx_parameters = {} + enable_extended_streaming = true + enable_partial_automated_agent_reply = true + output_multiple_utterances = true + enable_debugging_info = true + + streaming_analyze_content_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_analyze_content, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_analyze_content_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info + enum_input = [request_hash, request_proto].to_enum + c.streaming_analyze_content enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info + stream_input = Gapic::StreamInput.new + c.streaming_analyze_content stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, 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 = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info + enum_input = [request_hash, request_proto].to_enum + c.streaming_analyze_content enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info + stream_input = Gapic::StreamInput.new + c.streaming_analyze_content stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, 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, streaming_analyze_content_client_stub.call_rpc_count + streaming_analyze_content_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest, r + assert_equal "hello world", r["participant"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::InputAudioConfig), r["audio_config"] + assert_equal :audio_config, r.config + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::OutputAudioConfig), r["reply_audio_config"] + assert_equal "hello world", r["input_audio"] + assert_equal :input_audio, r.input + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryParameters), r["query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), r["assist_query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), r["cx_parameters"] + assert_equal true, r["enable_extended_streaming"] + assert_equal true, r["enable_partial_automated_agent_reply"] + assert_equal true, r["output_multiple_utterances"] + assert_equal true, r["enable_debugging_info"] + end + end + end + end + + def test_suggest_articles + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + latest_message = "hello world" + context_size = 42 + assist_query_params = {} + + suggest_articles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :suggest_articles, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["latest_message"] + assert_equal 42, request["context_size"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), request["assist_query_params"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, suggest_articles_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.suggest_articles({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.suggest_articles parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.suggest_articles ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.suggest_articles({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.suggest_articles(::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, suggest_articles_client_stub.call_rpc_count + end + end + + def test_suggest_faq_answers + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + latest_message = "hello world" + context_size = 42 + assist_query_params = {} + + suggest_faq_answers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :suggest_faq_answers, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["latest_message"] + assert_equal 42, request["context_size"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), request["assist_query_params"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, suggest_faq_answers_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.suggest_faq_answers({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.suggest_faq_answers parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.suggest_faq_answers ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.suggest_faq_answers({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.suggest_faq_answers(::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, suggest_faq_answers_client_stub.call_rpc_count + end + end + + def test_suggest_smart_replies + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + current_text_input = {} + latest_message = "hello world" + context_size = 42 + + suggest_smart_replies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :suggest_smart_replies, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::TextInput), request["current_text_input"] + assert_equal "hello world", request["latest_message"] + assert_equal 42, request["context_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, suggest_smart_replies_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.suggest_smart_replies({ parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.suggest_smart_replies parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.suggest_smart_replies ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new(parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.suggest_smart_replies({ parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.suggest_smart_replies(::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new(parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, suggest_smart_replies_client_stub.call_rpc_count + end + end + + def test_suggest_knowledge_assist + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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" + latest_message = "hello world" + context_size = 42 + previous_suggested_query = "hello world" + + suggest_knowledge_assist_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :suggest_knowledge_assist, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["latest_message"] + assert_equal 42, request["context_size"] + assert_equal "hello world", request["previous_suggested_query"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, suggest_knowledge_assist_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.suggest_knowledge_assist({ parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.suggest_knowledge_assist parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.suggest_knowledge_assist ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.suggest_knowledge_assist({ parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.suggest_knowledge_assist(::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, suggest_knowledge_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::Dialogflow::V2::Participants::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::Dialogflow::V2::Participants::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::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Participants::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb new file mode 100644 index 000000000000..bca72ee4ce4d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_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/dialogflow/v2/session_entity_types" + +class ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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_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::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", session: "value1" + assert_equal "projects/value0/agent/sessions/value1", path + + path = client.session_path project: "value0", environment: "value1", user: "value2", session: "value3" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3", path + + path = client.session_path project: "value0", location: "value1", session: "value2" + assert_equal "projects/value0/locations/value1/agent/sessions/value2", path + + path = client.session_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4", path + end + end + + def test_session_entity_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_entity_type_path project: "value0", session: "value1", entity_type: "value2" + assert_equal "projects/value0/agent/sessions/value1/entityTypes/value2", path + + path = client.session_entity_type_path project: "value0", environment: "value1", user: "value2", session: "value3", entity_type: "value4" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/entityTypes/value4", path + + path = client.session_entity_type_path project: "value0", location: "value1", session: "value2", entity_type: "value3" + assert_equal "projects/value0/locations/value1/agent/sessions/value2/entityTypes/value3", path + + path = client.session_entity_type_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", entity_type: "value5" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/entityTypes/value5", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb new file mode 100644 index 000000000000..f6deec2a6f55 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb @@ -0,0 +1,373 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/session_entity_type_pb" +require "google/cloud/dialogflow/v2/session_entity_types/rest" + + +class ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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_session_entity_types + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse.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_session_entity_types_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_list_session_entity_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_session_entity_types_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_session_entity_types({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_session_entity_types parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_session_entity_types ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.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 + c.list_session_entity_types({ 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 + c.list_session_entity_types(::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.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_session_entity_types_client_stub.call_count + end + end + end + + def test_get_session_entity_type + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_session_entity_type_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_get_session_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_session_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_session_entity_type({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_session_entity_type name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_session_entity_type ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_session_entity_type({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_session_entity_type(::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_session_entity_type_client_stub.call_count + end + end + end + + def test_create_session_entity_type + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + session_entity_type = {} + + create_session_entity_type_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_create_session_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_session_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_session_entity_type({ parent: parent, session_entity_type: session_entity_type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_session_entity_type parent: parent, session_entity_type: session_entity_type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_session_entity_type ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new(parent: parent, session_entity_type: session_entity_type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_session_entity_type({ parent: parent, session_entity_type: session_entity_type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_session_entity_type(::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new(parent: parent, session_entity_type: session_entity_type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_session_entity_type_client_stub.call_count + end + end + end + + def test_update_session_entity_type + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + session_entity_type = {} + update_mask = {} + + update_session_entity_type_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_update_session_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_session_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_session_entity_type({ session_entity_type: session_entity_type, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_session_entity_type session_entity_type: session_entity_type, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_session_entity_type ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new(session_entity_type: session_entity_type, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_session_entity_type({ session_entity_type: session_entity_type, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_session_entity_type(::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new(session_entity_type: session_entity_type, 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_entity_type_client_stub.call_count + end + end + end + + def test_delete_session_entity_type + # 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_entity_type_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_delete_session_entity_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_session_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_session_entity_type({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_session_entity_type name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_session_entity_type ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_session_entity_type({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_session_entity_type(::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_session_entity_type_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::Dialogflow::V2::SessionEntityTypes::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::Dialogflow::V2::SessionEntityTypes::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb new file mode 100644 index 000000000000..b82fb67220d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb @@ -0,0 +1,407 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/session_entity_type_pb" +require "google/cloud/dialogflow/v2/session_entity_types" + +class ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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_session_entity_types + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_session_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_session_entity_types, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, 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_session_entity_types_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_session_entity_types({ 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 + c.list_session_entity_types 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 + c.list_session_entity_types ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.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 + c.list_session_entity_types({ 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 + c.list_session_entity_types(::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.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_session_entity_types_client_stub.call_rpc_count + end + end + + def test_get_session_entity_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new + grpc_operation = GRPC::ActiveCall::Operation.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_session_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_session_entity_type, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_session_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_session_entity_type({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_session_entity_type name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_session_entity_type ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_session_entity_type({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_session_entity_type(::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.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_session_entity_type_client_stub.call_rpc_count + end + end + + def test_create_session_entity_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new + grpc_operation = GRPC::ActiveCall::Operation.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_entity_type = {} + + create_session_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_session_entity_type, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SessionEntityType), request["session_entity_type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_session_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_session_entity_type({ parent: parent, session_entity_type: session_entity_type }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_session_entity_type parent: parent, session_entity_type: session_entity_type do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_session_entity_type ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new(parent: parent, session_entity_type: session_entity_type) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_session_entity_type({ parent: parent, session_entity_type: session_entity_type }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_session_entity_type(::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new(parent: parent, session_entity_type: session_entity_type), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_session_entity_type_client_stub.call_rpc_count + end + end + + def test_update_session_entity_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new + grpc_operation = GRPC::ActiveCall::Operation.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_entity_type = {} + update_mask = {} + + update_session_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_session_entity_type, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SessionEntityType), request["session_entity_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_session_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_session_entity_type({ session_entity_type: session_entity_type, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_session_entity_type session_entity_type: session_entity_type, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_session_entity_type ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new(session_entity_type: session_entity_type, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_session_entity_type({ session_entity_type: session_entity_type, 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 + c.update_session_entity_type(::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new(session_entity_type: session_entity_type, 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_entity_type_client_stub.call_rpc_count + end + end + + def test_delete_session_entity_type + # 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_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_session_entity_type, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_session_entity_type_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_session_entity_type({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_session_entity_type name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_session_entity_type ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_session_entity_type({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_session_entity_type(::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.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_entity_type_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::Dialogflow::V2::SessionEntityTypes::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::Dialogflow::V2::SessionEntityTypes::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::Dialogflow::V2::SessionEntityTypes::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb new file mode 100644 index 000000000000..dcecf281b3ff --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/sessions" + +class ::Google::Cloud::Dialogflow::V2::Sessions::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_context_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.context_path project: "value0", session: "value1", context: "value2" + assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path + + path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path + + path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" + assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path + + path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/value5", path + end + end + + def test_phrase_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" + assert_equal "projects/value0/locations/value1/phraseSets/value2", 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::Dialogflow::V2::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_path project: "value0", session: "value1" + assert_equal "projects/value0/agent/sessions/value1", path + + path = client.session_path project: "value0", environment: "value1", user: "value2", session: "value3" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3", path + + path = client.session_path project: "value0", location: "value1", session: "value2" + assert_equal "projects/value0/locations/value1/agent/sessions/value2", path + + path = client.session_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4", path + end + end + + def test_session_entity_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.session_entity_type_path project: "value0", session: "value1", entity_type: "value2" + assert_equal "projects/value0/agent/sessions/value1/entityTypes/value2", path + + path = client.session_entity_type_path project: "value0", environment: "value1", user: "value2", session: "value3", entity_type: "value4" + assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/entityTypes/value4", path + + path = client.session_entity_type_path project: "value0", location: "value1", session: "value2", entity_type: "value3" + assert_equal "projects/value0/locations/value1/agent/sessions/value2/entityTypes/value3", path + + path = client.session_entity_type_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", entity_type: "value5" + assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/entityTypes/value5", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb new file mode 100644 index 000000000000..e69255c6c078 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_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/dialogflow/v2/session_pb" +require "google/cloud/dialogflow/v2/sessions/rest" + + +class ::Google::Cloud::Dialogflow::V2::Sessions::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_detect_intent + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::DetectIntentResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + session = "hello world" + query_params = {} + query_input = {} + output_audio_config = {} + output_audio_config_mask = {} + input_audio = "hello world" + + detect_intent_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::Dialogflow::V2::Sessions::Rest::ServiceStub.stub :transcode_detect_intent_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, detect_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.detect_intent ::Google::Cloud::Dialogflow::V2::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.detect_intent(::Google::Cloud::Dialogflow::V2::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, detect_intent_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::Dialogflow::V2::Sessions::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::Dialogflow::V2::Sessions::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb new file mode 100644 index 000000000000..5d8620b0372e --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb @@ -0,0 +1,274 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/session_pb" +require "google/cloud/dialogflow/v2/sessions" + +class ::Google::Cloud::Dialogflow::V2::Sessions::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_detect_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::DetectIntentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" + query_params = {} + query_input = {} + output_audio_config = {} + output_audio_config_mask = {} + input_audio = "hello world" + + detect_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :detect_intent, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DetectIntentRequest, request + assert_equal "hello world", request["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryParameters), request["query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryInput), request["query_input"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::OutputAudioConfig), request["output_audio_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["output_audio_config_mask"] + assert_equal "hello world", request["input_audio"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, detect_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.detect_intent ::Google::Cloud::Dialogflow::V2::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.detect_intent(::Google::Cloud::Dialogflow::V2::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, detect_intent_client_stub.call_rpc_count + end + end + + def test_streaming_detect_intent + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse.new + grpc_operation = GRPC::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. + session = "hello world" + query_params = {} + query_input = {} + single_utterance = true + output_audio_config = {} + output_audio_config_mask = {} + input_audio = "hello world" + enable_debugging_info = true + + streaming_detect_intent_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_detect_intent, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_detect_intent_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info + enum_input = [request_hash, request_proto].to_enum + c.streaming_detect_intent enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info + stream_input = Gapic::StreamInput.new + c.streaming_detect_intent stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse, 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 = { session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info + enum_input = [request_hash, request_proto].to_enum + c.streaming_detect_intent enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info + stream_input = Gapic::StreamInput.new + c.streaming_detect_intent stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse, 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, streaming_detect_intent_client_stub.call_rpc_count + streaming_detect_intent_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest, r + assert_equal "hello world", r["session"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryParameters), r["query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryInput), r["query_input"] + assert_equal true, r["single_utterance"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::OutputAudioConfig), r["output_audio_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), r["output_audio_config_mask"] + assert_equal "hello world", r["input_audio"] + assert_equal true, r["enable_debugging_info"] + end + end + 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::Dialogflow::V2::Sessions::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::Dialogflow::V2::Sessions::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::Dialogflow::V2::Sessions::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Sessions::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_paths_test.rb new file mode 100644 index 000000000000..b23ff6b61d6b --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_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/dialogflow/v2/sip_trunks" + +class ::Google::Cloud::Dialogflow::V2::SipTrunks::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_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::Dialogflow::V2::SipTrunks::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_sip_trunk_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.sip_trunk_path project: "value0", location: "value1", siptrunk: "value2" + assert_equal "projects/value0/locations/value1/sipTrunks/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_rest_test.rb new file mode 100644 index 000000000000..4686a0bf59c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_rest_test.rb @@ -0,0 +1,373 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/sip_trunk_pb" +require "google/cloud/dialogflow/v2/sip_trunks/rest" + + +class ::Google::Cloud::Dialogflow::V2::SipTrunks::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_sip_trunk + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SipTrunk.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + sip_trunk = {} + + create_sip_trunk_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_create_sip_trunk_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_sip_trunk_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_sip_trunk({ parent: parent, sip_trunk: sip_trunk }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_sip_trunk parent: parent, sip_trunk: sip_trunk do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_sip_trunk ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new(parent: parent, sip_trunk: sip_trunk) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_sip_trunk({ parent: parent, sip_trunk: sip_trunk }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_sip_trunk(::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new(parent: parent, sip_trunk: sip_trunk), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_sip_trunk_client_stub.call_count + end + end + end + + def test_delete_sip_trunk + # 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_sip_trunk_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_delete_sip_trunk_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_sip_trunk_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_sip_trunk({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_sip_trunk name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_sip_trunk ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_sip_trunk({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_sip_trunk(::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_sip_trunk_client_stub.call_count + end + end + end + + def test_list_sip_trunks + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse.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_sip_trunks_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_list_sip_trunks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sip_trunks_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_sip_trunks({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_sip_trunks parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_sip_trunks ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.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 + c.list_sip_trunks({ 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 + c.list_sip_trunks(::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.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_sip_trunks_client_stub.call_count + end + end + end + + def test_get_sip_trunk + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SipTrunk.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_sip_trunk_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_get_sip_trunk_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_sip_trunk_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_sip_trunk({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_sip_trunk name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_sip_trunk ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_sip_trunk({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_sip_trunk(::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_sip_trunk_client_stub.call_count + end + end + end + + def test_update_sip_trunk + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::SipTrunk.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + sip_trunk = {} + update_mask = {} + + update_sip_trunk_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_update_sip_trunk_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_sip_trunk_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_sip_trunk({ sip_trunk: sip_trunk, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_sip_trunk sip_trunk: sip_trunk, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_sip_trunk ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new(sip_trunk: sip_trunk, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_sip_trunk({ sip_trunk: sip_trunk, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_sip_trunk(::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new(sip_trunk: sip_trunk, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_sip_trunk_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::Dialogflow::V2::SipTrunks::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::Dialogflow::V2::SipTrunks::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_test.rb new file mode 100644 index 000000000000..faa605dde435 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_test.rb @@ -0,0 +1,407 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/sip_trunk_pb" +require "google/cloud/dialogflow/v2/sip_trunks" + +class ::Google::Cloud::Dialogflow::V2::SipTrunks::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_sip_trunk + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SipTrunk.new + grpc_operation = GRPC::ActiveCall::Operation.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" + sip_trunk = {} + + create_sip_trunk_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_sip_trunk, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SipTrunk), request["sip_trunk"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_sip_trunk_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_sip_trunk({ parent: parent, sip_trunk: sip_trunk }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_sip_trunk parent: parent, sip_trunk: sip_trunk do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_sip_trunk ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new(parent: parent, sip_trunk: sip_trunk) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_sip_trunk({ parent: parent, sip_trunk: sip_trunk }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_sip_trunk(::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new(parent: parent, sip_trunk: sip_trunk), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_sip_trunk_client_stub.call_rpc_count + end + end + + def test_delete_sip_trunk + # 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_sip_trunk_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_sip_trunk, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_sip_trunk_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_sip_trunk({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_sip_trunk name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_sip_trunk ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_sip_trunk({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_sip_trunk(::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.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_sip_trunk_client_stub.call_rpc_count + end + end + + def test_list_sip_trunks + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_sip_trunks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sip_trunks, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest, 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_sip_trunks_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_sip_trunks({ 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 + c.list_sip_trunks 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 + c.list_sip_trunks ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.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 + c.list_sip_trunks({ 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 + c.list_sip_trunks(::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.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_sip_trunks_client_stub.call_rpc_count + end + end + + def test_get_sip_trunk + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SipTrunk.new + grpc_operation = GRPC::ActiveCall::Operation.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_sip_trunk_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_sip_trunk, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_sip_trunk_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_sip_trunk({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_sip_trunk name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_sip_trunk ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_sip_trunk({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_sip_trunk(::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.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_sip_trunk_client_stub.call_rpc_count + end + end + + def test_update_sip_trunk + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::SipTrunk.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + sip_trunk = {} + update_mask = {} + + update_sip_trunk_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_sip_trunk, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SipTrunk), request["sip_trunk"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_sip_trunk_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_sip_trunk({ sip_trunk: sip_trunk, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_sip_trunk sip_trunk: sip_trunk, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_sip_trunk ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new(sip_trunk: sip_trunk, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_sip_trunk({ sip_trunk: sip_trunk, 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 + c.update_sip_trunk(::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new(sip_trunk: sip_trunk, 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_sip_trunk_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::Dialogflow::V2::SipTrunks::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::Dialogflow::V2::SipTrunks::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::Dialogflow::V2::SipTrunks::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::SipTrunks::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_paths_test.rb new file mode 100644 index 000000000000..7b5d667c1cde --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_paths_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/tools" + +class ::Google::Cloud::Dialogflow::V2::Tools::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_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::Dialogflow::V2::Tools::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_secret_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_version_path project: "value0", secret: "value1", version: "value2" + assert_equal "projects/value0/secrets/value1/versions/value2", path + end + end + + def test_service_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" + assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path + end + end + + def test_tool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.tool_path project: "value0", location: "value1", tool: "value2" + assert_equal "projects/value0/locations/value1/tools/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_rest_test.rb new file mode 100644 index 000000000000..07443b35c95c --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_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/dialogflow/v2/tool_pb" +require "google/cloud/dialogflow/v2/tools/rest" + + +class ::Google::Cloud::Dialogflow::V2::Tools::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_tool + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Tool.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + tool = {} + tool_id = "hello world" + + create_tool_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_create_tool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_tool_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_tool({ parent: parent, tool: tool, tool_id: tool_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_tool parent: parent, tool: tool, tool_id: tool_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_tool ::Google::Cloud::Dialogflow::V2::CreateToolRequest.new(parent: parent, tool: tool, tool_id: tool_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_tool({ parent: parent, tool: tool, tool_id: tool_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_tool(::Google::Cloud::Dialogflow::V2::CreateToolRequest.new(parent: parent, tool: tool, tool_id: tool_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_tool_client_stub.call_count + end + end + end + + def test_get_tool + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Tool.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_tool_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_get_tool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_tool_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_tool({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_tool name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_tool ::Google::Cloud::Dialogflow::V2::GetToolRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_tool({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_tool(::Google::Cloud::Dialogflow::V2::GetToolRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_tool_client_stub.call_count + end + end + end + + def test_list_tools + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListToolsResponse.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_tools_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_list_tools_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tools_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_tools({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_tools parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_tools ::Google::Cloud::Dialogflow::V2::ListToolsRequest.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 + c.list_tools({ 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 + c.list_tools(::Google::Cloud::Dialogflow::V2::ListToolsRequest.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_tools_client_stub.call_count + end + end + end + + def test_delete_tool + # 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_tool_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_delete_tool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_tool_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_tool({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_tool name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_tool ::Google::Cloud::Dialogflow::V2::DeleteToolRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_tool({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_tool(::Google::Cloud::Dialogflow::V2::DeleteToolRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_tool_client_stub.call_count + end + end + end + + def test_update_tool + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Tool.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + tool = {} + update_mask = {} + + update_tool_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_update_tool_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_tool_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_tool({ tool: tool, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_tool tool: tool, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_tool ::Google::Cloud::Dialogflow::V2::UpdateToolRequest.new(tool: tool, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_tool({ tool: tool, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_tool(::Google::Cloud::Dialogflow::V2::UpdateToolRequest.new(tool: tool, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_tool_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::Dialogflow::V2::Tools::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::Dialogflow::V2::Tools::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_test.rb new file mode 100644 index 000000000000..9aeca6468aae --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_test.rb @@ -0,0 +1,409 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/tool_pb" +require "google/cloud/dialogflow/v2/tools" + +class ::Google::Cloud::Dialogflow::V2::Tools::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_tool + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Tool.new + grpc_operation = GRPC::ActiveCall::Operation.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" + tool = {} + tool_id = "hello world" + + create_tool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_tool, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateToolRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Tool), request["tool"] + assert_equal "hello world", request["tool_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_tool_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_tool({ parent: parent, tool: tool, tool_id: tool_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_tool parent: parent, tool: tool, tool_id: tool_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_tool ::Google::Cloud::Dialogflow::V2::CreateToolRequest.new(parent: parent, tool: tool, tool_id: tool_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_tool({ parent: parent, tool: tool, tool_id: tool_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_tool(::Google::Cloud::Dialogflow::V2::CreateToolRequest.new(parent: parent, tool: tool, tool_id: tool_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_tool_client_stub.call_rpc_count + end + end + + def test_get_tool + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Tool.new + grpc_operation = GRPC::ActiveCall::Operation.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_tool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_tool, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetToolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_tool_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_tool({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_tool name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_tool ::Google::Cloud::Dialogflow::V2::GetToolRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_tool({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_tool(::Google::Cloud::Dialogflow::V2::GetToolRequest.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_tool_client_stub.call_rpc_count + end + end + + def test_list_tools + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListToolsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_tools_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tools, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListToolsRequest, 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_tools_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_tools({ 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 + c.list_tools 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 + c.list_tools ::Google::Cloud::Dialogflow::V2::ListToolsRequest.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 + c.list_tools({ 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 + c.list_tools(::Google::Cloud::Dialogflow::V2::ListToolsRequest.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_tools_client_stub.call_rpc_count + end + end + + def test_delete_tool + # 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_tool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_tool, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteToolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_tool_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_tool({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_tool name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_tool ::Google::Cloud::Dialogflow::V2::DeleteToolRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_tool({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_tool(::Google::Cloud::Dialogflow::V2::DeleteToolRequest.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_tool_client_stub.call_rpc_count + end + end + + def test_update_tool + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Tool.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + tool = {} + update_mask = {} + + update_tool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_tool, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateToolRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Tool), request["tool"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_tool_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_tool({ tool: tool, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_tool tool: tool, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_tool ::Google::Cloud::Dialogflow::V2::UpdateToolRequest.new(tool: tool, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_tool({ tool: tool, 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 + c.update_tool(::Google::Cloud::Dialogflow::V2::UpdateToolRequest.new(tool: tool, 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_tool_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::Dialogflow::V2::Tools::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::Dialogflow::V2::Tools::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::Dialogflow::V2::Tools::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Tools::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb new file mode 100644 index 000000000000..2bb427ceb75f --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_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/dialogflow/v2/versions" + +class ::Google::Cloud::Dialogflow::V2::Versions::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_agent_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.agent_path project: "value0" + assert_equal "projects/value0/agent", path + + path = client.agent_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/agent", path + end + end + + def test_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.version_path project: "value0", version: "value1" + assert_equal "projects/value0/agent/versions/value1", path + + path = client.version_path project: "value0", location: "value1", version: "value2" + assert_equal "projects/value0/locations/value1/agent/versions/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb new file mode 100644 index 000000000000..5c056f0c2d42 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb @@ -0,0 +1,373 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/version_pb" +require "google/cloud/dialogflow/v2/versions/rest" + + +class ::Google::Cloud::Dialogflow::V2::Versions::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_versions + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::ListVersionsResponse.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_versions_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_list_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_versions_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_versions parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_versions ::Google::Cloud::Dialogflow::V2::ListVersionsRequest.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 + c.list_versions({ 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 + c.list_versions(::Google::Cloud::Dialogflow::V2::ListVersionsRequest.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_versions_client_stub.call_count + end + end + end + + def test_get_version + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Version.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_version_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_get_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_version_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_version ::Google::Cloud::Dialogflow::V2::GetVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_version(::Google::Cloud::Dialogflow::V2::GetVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_version_client_stub.call_count + end + end + end + + def test_create_version + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Version.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + version = {} + + create_version_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_create_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_version_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_version({ parent: parent, version: version }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_version parent: parent, version: version do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_version ::Google::Cloud::Dialogflow::V2::CreateVersionRequest.new(parent: parent, version: version) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_version({ parent: parent, version: version }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_version(::Google::Cloud::Dialogflow::V2::CreateVersionRequest.new(parent: parent, version: version), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_version_client_stub.call_count + end + end + end + + def test_update_version + # Create test objects. + client_result = ::Google::Cloud::Dialogflow::V2::Version.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + version = {} + update_mask = {} + + update_version_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_update_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_version_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_version({ version: version, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_version version: version, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_version ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new(version: version, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_version({ version: version, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_version(::Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new(version: version, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_version_client_stub.call_count + end + end + end + + def test_delete_version + # 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_version_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_delete_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_version_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_version ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_version(::Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_version_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::Dialogflow::V2::Versions::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::Dialogflow::V2::Versions::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb new file mode 100644 index 000000000000..1136213b188d --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb @@ -0,0 +1,407 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/dialogflow/v2/version_pb" +require "google/cloud/dialogflow/v2/versions" + +class ::Google::Cloud::Dialogflow::V2::Versions::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_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::ListVersionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.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_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_versions, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::ListVersionsRequest, 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_versions_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_versions({ 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 + c.list_versions 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 + c.list_versions ::Google::Cloud::Dialogflow::V2::ListVersionsRequest.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 + c.list_versions({ 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 + c.list_versions(::Google::Cloud::Dialogflow::V2::ListVersionsRequest.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_versions_client_stub.call_rpc_count + end + end + + def test_get_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Version.new + grpc_operation = GRPC::ActiveCall::Operation.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_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_version, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::GetVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_version_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_version ::Google::Cloud::Dialogflow::V2::GetVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_version(::Google::Cloud::Dialogflow::V2::GetVersionRequest.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_version_client_stub.call_rpc_count + end + end + + def test_create_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Version.new + grpc_operation = GRPC::ActiveCall::Operation.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" + version = {} + + create_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_version, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Version), request["version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_version_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_version({ parent: parent, version: version }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_version parent: parent, version: version do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_version ::Google::Cloud::Dialogflow::V2::CreateVersionRequest.new(parent: parent, version: version) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_version({ parent: parent, version: version }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_version(::Google::Cloud::Dialogflow::V2::CreateVersionRequest.new(parent: parent, version: version), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_version_client_stub.call_rpc_count + end + end + + def test_update_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::Version.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + version = {} + update_mask = {} + + update_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_version, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Version), request["version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_version_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_version({ version: version, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_version version: version, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_version ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new(version: version, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_version({ version: version, 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 + c.update_version(::Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new(version: version, 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_version_client_stub.call_rpc_count + end + end + + def test_delete_version + # 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_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_version, name + assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_version_client_stub do + # Create client + c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_version ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_version(::Google::Cloud::Dialogflow::V2::DeleteVersionRequest.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_version_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::Dialogflow::V2::Versions::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::Dialogflow::V2::Versions::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::Dialogflow::V2::Versions::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Dialogflow::V2::Versions::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/helper.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dialogflow-v2/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" From c3532ced0c1f85e6c4fd8ea92ab3e995c306d8d6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 18 Jun 2026 23:47:55 +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 --- .../cloud/dialogflow/v2/audio_config_pb.rb | 2 +- .../google/cloud/dialogflow/v2/ces_app_pb.rb | 2 +- .../cloud/dialogflow/v2/conversation_pb.rb | 2 +- .../dialogflow/v2/conversation_profile_pb.rb | 3 +- .../cloud/dialogflow/v2/participant_pb.rb | 6 +- .../cloud/dialogflow/v2/audio_config.rb | 2 +- .../google/cloud/dialogflow/v2/ces_app.rb | 12 + .../cloud/dialogflow/v2/conversation.rb | 6 + .../dialogflow/v2/conversation_profile.rb | 50 + .../google/cloud/dialogflow/v2/participant.rb | 105 +- .../google/cloud/dialogflow/v2/session.rb | 25 +- .../google-cloud-dialogflow-v2/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-dialogflow-v2/.rubocop.yml | 33 - .../google-cloud-dialogflow-v2/.toys.rb | 28 - .../google-cloud-dialogflow-v2/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-dialogflow-v2/CHANGELOG.md | 2 - .../google-cloud-dialogflow-v2/Gemfile | 14 - .../google-cloud-dialogflow-v2/LICENSE.md | 201 - .../google-cloud-dialogflow-v2/README.md | 154 - .../google-cloud-dialogflow-v2/Rakefile | 169 - .../gapic_metadata.json | 857 --- .../google-cloud-dialogflow-v2.gemspec | 29 - .../lib/google-cloud-dialogflow-v2.rb | 21 - .../lib/google/cloud/dialogflow/v2.rb | 66 - .../v2/agent_coaching_instruction_pb.rb | 26 - .../google/cloud/dialogflow/v2/agent_pb.rb | 45 - .../cloud/dialogflow/v2/agent_services_pb.rb | 144 - .../lib/google/cloud/dialogflow/v2/agents.rb | 56 - .../cloud/dialogflow/v2/agents/client.rb | 1434 ----- .../cloud/dialogflow/v2/agents/credentials.rb | 52 - .../cloud/dialogflow/v2/agents/operations.rb | 843 --- .../cloud/dialogflow/v2/agents/paths.rb | 100 - .../google/cloud/dialogflow/v2/agents/rest.rb | 54 - .../cloud/dialogflow/v2/agents/rest/client.rb | 1336 ----- .../dialogflow/v2/agents/rest/operations.rb | 947 --- .../dialogflow/v2/agents/rest/service_stub.rb | 703 --- .../cloud/dialogflow/v2/answer_record_pb.rb | 43 - .../v2/answer_record_services_pb.rb | 49 - .../cloud/dialogflow/v2/answer_records.rb | 56 - .../dialogflow/v2/answer_records/client.rb | 627 -- .../v2/answer_records/credentials.rb | 52 - .../dialogflow/v2/answer_records/paths.rb | 316 - .../dialogflow/v2/answer_records/rest.rb | 54 - .../v2/answer_records/rest/client.rb | 578 -- .../v2/answer_records/rest/service_stub.rb | 219 - .../cloud/dialogflow/v2/audio_config_pb.rb | 39 - .../cloud/dialogflow/v2/bindings_override.rb | 75 - .../google/cloud/dialogflow/v2/ces_app_pb.rb | 25 - .../google/cloud/dialogflow/v2/ces_tool_pb.rb | 25 - .../google/cloud/dialogflow/v2/context_pb.rb | 36 - .../dialogflow/v2/context_services_pb.rb | 57 - .../google/cloud/dialogflow/v2/contexts.rb | 55 - .../cloud/dialogflow/v2/contexts/client.rb | 999 ---- .../dialogflow/v2/contexts/credentials.rb | 52 - .../cloud/dialogflow/v2/contexts/paths.rb | 195 - .../cloud/dialogflow/v2/contexts/rest.rb | 53 - .../dialogflow/v2/contexts/rest/client.rb | 922 --- .../v2/contexts/rest/service_stub.rb | 581 -- .../dialogflow/v2/conversation_dataset_pb.rb | 43 - .../v2/conversation_dataset_services_pb.rb | 86 - .../dialogflow/v2/conversation_datasets.rb | 59 - .../v2/conversation_datasets/client.rb | 962 --- .../v2/conversation_datasets/credentials.rb | 52 - .../v2/conversation_datasets/operations.rb | 843 --- .../v2/conversation_datasets/paths.rb | 69 - .../v2/conversation_datasets/rest.rb | 57 - .../v2/conversation_datasets/rest/client.rb | 892 --- .../conversation_datasets/rest/operations.rb | 947 --- .../rest/service_stub.rb | 410 -- .../dialogflow/v2/conversation_event_pb.rb | 28 - .../dialogflow/v2/conversation_model_pb.rb | 58 - .../v2/conversation_model_services_pb.rb | 103 - .../dialogflow/v2/conversation_models.rb | 56 - .../v2/conversation_models/client.rb | 1371 ----- .../v2/conversation_models/credentials.rb | 52 - .../v2/conversation_models/operations.rb | 843 --- .../v2/conversation_models/paths.rb | 183 - .../dialogflow/v2/conversation_models/rest.rb | 54 - .../v2/conversation_models/rest/client.rb | 1273 ---- .../v2/conversation_models/rest/operations.rb | 947 --- .../conversation_models/rest/service_stub.rb | 693 --- .../cloud/dialogflow/v2/conversation_pb.rb | 81 - .../dialogflow/v2/conversation_profile_pb.rb | 69 - .../v2/conversation_profile_services_pb.rb | 99 - .../dialogflow/v2/conversation_profiles.rb | 57 - .../v2/conversation_profiles/client.rb | 1158 ---- .../v2/conversation_profiles/credentials.rb | 52 - .../v2/conversation_profiles/operations.rb | 843 --- .../v2/conversation_profiles/paths.rb | 325 - .../v2/conversation_profiles/rest.rb | 55 - .../v2/conversation_profiles/rest/client.rb | 1074 ---- .../conversation_profiles/rest/operations.rb | 947 --- .../rest/service_stub.rb | 565 -- .../dialogflow/v2/conversation_services_pb.rb | 98 - .../cloud/dialogflow/v2/conversations.rb | 56 - .../dialogflow/v2/conversations/client.rb | 1639 ------ .../v2/conversations/credentials.rb | 52 - .../dialogflow/v2/conversations/paths.rb | 541 -- .../cloud/dialogflow/v2/conversations/rest.rb | 54 - .../v2/conversations/rest/client.rb | 1527 ----- .../v2/conversations/rest/service_stub.rb | 845 --- .../google/cloud/dialogflow/v2/document_pb.rb | 49 - .../dialogflow/v2/document_services_pb.rb | 119 - .../google/cloud/dialogflow/v2/documents.rb | 57 - .../cloud/dialogflow/v2/documents/client.rb | 1354 ----- .../dialogflow/v2/documents/credentials.rb | 52 - .../dialogflow/v2/documents/operations.rb | 843 --- .../cloud/dialogflow/v2/documents/paths.rb | 119 - .../cloud/dialogflow/v2/documents/rest.rb | 55 - .../dialogflow/v2/documents/rest/client.rb | 1263 ---- .../v2/documents/rest/operations.rb | 947 --- .../v2/documents/rest/service_stub.rb | 680 --- .../cloud/dialogflow/v2/encryption_spec_pb.rb | 31 - .../dialogflow/v2/encryption_spec_service.rb | 56 - .../v2/encryption_spec_service/client.rb | 619 -- .../v2/encryption_spec_service/credentials.rb | 52 - .../v2/encryption_spec_service/operations.rb | 843 --- .../v2/encryption_spec_service/paths.rb | 50 - .../v2/encryption_spec_service/rest.rb | 54 - .../v2/encryption_spec_service/rest/client.rb | 570 -- .../rest/operations.rb | 947 --- .../rest/service_stub.rb | 204 - .../v2/encryption_spec_services_pb.rb | 51 - .../cloud/dialogflow/v2/entity_type_pb.rb | 46 - .../dialogflow/v2/entity_type_services_pb.rb | 143 - .../cloud/dialogflow/v2/entity_types.rb | 56 - .../dialogflow/v2/entity_types/client.rb | 1561 ----- .../dialogflow/v2/entity_types/credentials.rb | 52 - .../dialogflow/v2/entity_types/operations.rb | 843 --- .../cloud/dialogflow/v2/entity_types/paths.rb | 110 - .../cloud/dialogflow/v2/entity_types/rest.rb | 54 - .../dialogflow/v2/entity_types/rest/client.rb | 1456 ----- .../v2/entity_types/rest/operations.rb | 947 --- .../v2/entity_types/rest/service_stub.rb | 775 --- .../cloud/dialogflow/v2/environment_pb.rb | 42 - .../dialogflow/v2/environment_services_pb.rb | 66 - .../cloud/dialogflow/v2/environments.rb | 55 - .../dialogflow/v2/environments/client.rb | 1030 ---- .../dialogflow/v2/environments/credentials.rb | 52 - .../cloud/dialogflow/v2/environments/paths.rb | 187 - .../cloud/dialogflow/v2/environments/rest.rb | 53 - .../dialogflow/v2/environments/rest/client.rb | 953 --- .../v2/environments/rest/service_stub.rb | 493 -- .../cloud/dialogflow/v2/fulfillment_pb.rb | 32 - .../dialogflow/v2/fulfillment_services_pb.rb | 47 - .../cloud/dialogflow/v2/fulfillments.rb | 55 - .../dialogflow/v2/fulfillments/client.rb | 593 -- .../dialogflow/v2/fulfillments/credentials.rb | 52 - .../cloud/dialogflow/v2/fulfillments/paths.rb | 69 - .../cloud/dialogflow/v2/fulfillments/rest.rb | 53 - .../dialogflow/v2/fulfillments/rest/client.rb | 544 -- .../v2/fulfillments/rest/service_stub.rb | 219 - .../lib/google/cloud/dialogflow/v2/gcs_pb.rb | 24 - .../dialogflow/v2/generator_evaluation_pb.rb | 58 - .../v2/generator_evaluation_services_pb.rb | 51 - .../dialogflow/v2/generator_evaluations.rb | 56 - .../v2/generator_evaluations/client.rb | 817 --- .../v2/generator_evaluations/credentials.rb | 52 - .../v2/generator_evaluations/operations.rb | 843 --- .../v2/generator_evaluations/paths.rb | 158 - .../v2/generator_evaluations/rest.rb | 54 - .../v2/generator_evaluations/rest/client.rb | 754 --- .../generator_evaluations/rest/operations.rb | 947 --- .../rest/service_stub.rb | 326 -- .../cloud/dialogflow/v2/generator_pb.rb | 68 - .../dialogflow/v2/generator_services_pb.rb | 57 - .../google/cloud/dialogflow/v2/generators.rb | 59 - .../cloud/dialogflow/v2/generators/client.rb | 900 --- .../dialogflow/v2/generators/credentials.rb | 52 - .../cloud/dialogflow/v2/generators/paths.rb | 151 - .../cloud/dialogflow/v2/generators/rest.rb | 57 - .../dialogflow/v2/generators/rest/client.rb | 830 --- .../v2/generators/rest/service_stub.rb | 403 -- .../v2/human_agent_assistant_event_pb.rb | 23 - .../google/cloud/dialogflow/v2/intent_pb.rb | 81 - .../cloud/dialogflow/v2/intent_services_pb.rb | 95 - .../lib/google/cloud/dialogflow/v2/intents.rb | 56 - .../cloud/dialogflow/v2/intents/client.rb | 1204 ---- .../dialogflow/v2/intents/credentials.rb | 52 - .../cloud/dialogflow/v2/intents/operations.rb | 843 --- .../cloud/dialogflow/v2/intents/paths.rb | 195 - .../cloud/dialogflow/v2/intents/rest.rb | 54 - .../dialogflow/v2/intents/rest/client.rb | 1120 ---- .../dialogflow/v2/intents/rest/operations.rb | 947 --- .../v2/intents/rest/service_stub.rb | 579 -- .../cloud/dialogflow/v2/knowledge_base_pb.rb | 34 - .../v2/knowledge_base_services_pb.rb | 54 - .../cloud/dialogflow/v2/knowledge_bases.rb | 56 - .../dialogflow/v2/knowledge_bases/client.rb | 919 --- .../v2/knowledge_bases/credentials.rb | 52 - .../dialogflow/v2/knowledge_bases/paths.rb | 105 - .../dialogflow/v2/knowledge_bases/rest.rb | 54 - .../v2/knowledge_bases/rest/client.rb | 849 --- .../v2/knowledge_bases/rest/service_stub.rb | 462 -- .../cloud/dialogflow/v2/operations_pb.rb | 24 - .../cloud/dialogflow/v2/participant_pb.rb | 92 - .../dialogflow/v2/participant_services_pb.rb | 85 - .../cloud/dialogflow/v2/participants.rb | 55 - .../dialogflow/v2/participants/client.rb | 1469 ----- .../dialogflow/v2/participants/credentials.rb | 52 - .../cloud/dialogflow/v2/participants/paths.rb | 353 -- .../cloud/dialogflow/v2/participants/rest.rb | 53 - .../dialogflow/v2/participants/rest/client.rb | 1270 ---- .../v2/participants/rest/service_stub.rb | 707 --- .../lib/google/cloud/dialogflow/v2/rest.rb | 59 - .../dialogflow/v2/session_entity_type_pb.rb | 36 - .../v2/session_entity_type_services_pb.rb | 77 - .../dialogflow/v2/session_entity_types.rb | 56 - .../v2/session_entity_types/client.rb | 926 --- .../v2/session_entity_types/credentials.rb | 52 - .../v2/session_entity_types/paths.rb | 195 - .../v2/session_entity_types/rest.rb | 54 - .../v2/session_entity_types/rest/client.rb | 856 --- .../session_entity_types/rest/service_stub.rb | 499 -- .../google/cloud/dialogflow/v2/session_pb.rb | 49 - .../dialogflow/v2/session_services_pb.rb | 77 - .../google/cloud/dialogflow/v2/sessions.rb | 58 - .../cloud/dialogflow/v2/sessions/client.rb | 663 --- .../dialogflow/v2/sessions/credentials.rb | 52 - .../cloud/dialogflow/v2/sessions/paths.rb | 299 - .../cloud/dialogflow/v2/sessions/rest.rb | 56 - .../dialogflow/v2/sessions/rest/client.rb | 521 -- .../v2/sessions/rest/service_stub.rb | 167 - .../cloud/dialogflow/v2/sip_trunk_pb.rb | 39 - .../dialogflow/v2/sip_trunk_services_pb.rb | 53 - .../google/cloud/dialogflow/v2/sip_trunks.rb | 55 - .../cloud/dialogflow/v2/sip_trunks/client.rb | 887 --- .../dialogflow/v2/sip_trunks/credentials.rb | 52 - .../cloud/dialogflow/v2/sip_trunks/paths.rb | 69 - .../cloud/dialogflow/v2/sip_trunks/rest.rb | 53 - .../dialogflow/v2/sip_trunks/rest/client.rb | 817 --- .../v2/sip_trunks/rest/service_stub.rb | 388 -- .../cloud/dialogflow/v2/tool_call_pb.rb | 29 - .../lib/google/cloud/dialogflow/v2/tool_pb.rb | 56 - .../cloud/dialogflow/v2/tool_services_pb.rb | 55 - .../lib/google/cloud/dialogflow/v2/tools.rb | 57 - .../cloud/dialogflow/v2/tools/client.rb | 899 --- .../cloud/dialogflow/v2/tools/credentials.rb | 52 - .../google/cloud/dialogflow/v2/tools/paths.rb | 109 - .../google/cloud/dialogflow/v2/tools/rest.rb | 55 - .../cloud/dialogflow/v2/tools/rest/client.rb | 829 --- .../dialogflow/v2/tools/rest/service_stub.rb | 388 -- .../google/cloud/dialogflow/v2/toolset_pb.rb | 25 - .../dialogflow/v2/validation_result_pb.rb | 23 - .../lib/google/cloud/dialogflow/v2/version.rb | 28 - .../google/cloud/dialogflow/v2/version_pb.rb | 36 - .../dialogflow/v2/version_services_pb.rb | 59 - .../google/cloud/dialogflow/v2/versions.rb | 55 - .../cloud/dialogflow/v2/versions/client.rb | 909 --- .../dialogflow/v2/versions/credentials.rb | 52 - .../cloud/dialogflow/v2/versions/paths.rb | 110 - .../cloud/dialogflow/v2/versions/rest.rb | 53 - .../dialogflow/v2/versions/rest/client.rb | 839 --- .../v2/versions/rest/service_stub.rb | 425 -- .../google/cloud/dialogflow/v2/webhook_pb.rb | 30 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/dialogflow/v2/agent.rb | 338 -- .../v2/agent_coaching_instruction.rb | 109 - .../cloud/dialogflow/v2/answer_record.rb | 360 -- .../cloud/dialogflow/v2/audio_config.rb | 573 -- .../google/cloud/dialogflow/v2/ces_app.rb | 51 - .../google/cloud/dialogflow/v2/ces_tool.rb | 39 - .../google/cloud/dialogflow/v2/context.rb | 200 - .../cloud/dialogflow/v2/conversation.rb | 1150 ---- .../dialogflow/v2/conversation_dataset.rb | 229 - .../cloud/dialogflow/v2/conversation_event.rb | 98 - .../cloud/dialogflow/v2/conversation_model.rb | 577 -- .../dialogflow/v2/conversation_profile.rb | 923 --- .../google/cloud/dialogflow/v2/document.rb | 442 -- .../cloud/dialogflow/v2/encryption_spec.rb | 81 - .../google/cloud/dialogflow/v2/entity_type.rb | 374 -- .../google/cloud/dialogflow/v2/environment.rb | 311 - .../google/cloud/dialogflow/v2/fulfillment.rb | 153 - .../google/cloud/dialogflow/v2/gcs.rb | 50 - .../google/cloud/dialogflow/v2/generator.rb | 659 --- .../dialogflow/v2/generator_evaluation.rb | 539 -- .../v2/human_agent_assistant_event.rb | 45 - .../google/cloud/dialogflow/v2/intent.rb | 1089 ---- .../cloud/dialogflow/v2/knowledge_base.rb | 173 - .../google/cloud/dialogflow/v2/operations.rb | 39 - .../google/cloud/dialogflow/v2/participant.rb | 1689 ------ .../google/cloud/dialogflow/v2/session.rb | 762 --- .../dialogflow/v2/session_entity_type.rb | 181 - .../google/cloud/dialogflow/v2/sip_trunk.rb | 211 - .../google/cloud/dialogflow/v2/tool.rb | 552 -- .../google/cloud/dialogflow/v2/tool_call.rb | 161 - .../google/cloud/dialogflow/v2/toolset.rb | 44 - .../cloud/dialogflow/v2/validation_result.rb | 81 - .../google/cloud/dialogflow/v2/version.rb | 188 - .../google/cloud/dialogflow/v2/webhook.rb | 155 - .../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/latlng.rb | 38 - .../snippets/Gemfile | 32 - .../snippets/agents/delete_agent.rb | 47 - .../snippets/agents/export_agent.rb | 54 - .../snippets/agents/get_agent.rb | 47 - .../snippets/agents/get_validation_result.rb | 47 - .../snippets/agents/import_agent.rb | 54 - .../snippets/agents/restore_agent.rb | 54 - .../snippets/agents/search_agents.rb | 51 - .../snippets/agents/set_agent.rb | 47 - .../snippets/agents/train_agent.rb | 54 - .../answer_records/list_answer_records.rb | 51 - .../answer_records/update_answer_record.rb | 47 - .../snippets/contexts/create_context.rb | 47 - .../snippets/contexts/delete_all_contexts.rb | 47 - .../snippets/contexts/delete_context.rb | 47 - .../snippets/contexts/get_context.rb | 47 - .../snippets/contexts/list_contexts.rb | 51 - .../snippets/contexts/update_context.rb | 47 - .../create_conversation_dataset.rb | 54 - .../delete_conversation_dataset.rb | 54 - .../get_conversation_dataset.rb | 47 - .../import_conversation_data.rb | 54 - .../list_conversation_datasets.rb | 51 - .../create_conversation_model.rb | 54 - .../create_conversation_model_evaluation.rb | 54 - .../delete_conversation_model.rb | 54 - .../deploy_conversation_model.rb | 54 - .../get_conversation_model.rb | 47 - .../get_conversation_model_evaluation.rb | 47 - .../list_conversation_model_evaluations.rb | 51 - .../list_conversation_models.rb | 51 - .../undeploy_conversation_model.rb | 54 - .../clear_suggestion_feature_config.rb | 54 - .../create_conversation_profile.rb | 47 - .../delete_conversation_profile.rb | 47 - .../get_conversation_profile.rb | 47 - .../list_conversation_profiles.rb | 51 - .../set_suggestion_feature_config.rb | 54 - .../update_conversation_profile.rb | 47 - .../conversations/complete_conversation.rb | 47 - .../conversations/create_conversation.rb | 47 - .../generate_stateless_suggestion.rb | 47 - .../generate_stateless_summary.rb | 47 - .../conversations/generate_suggestions.rb | 47 - .../conversations/get_conversation.rb | 47 - .../ingest_context_references.rb | 47 - .../conversations/list_conversations.rb | 51 - .../snippets/conversations/list_messages.rb | 51 - .../conversations/search_knowledge.rb | 47 - .../suggest_conversation_summary.rb | 47 - .../snippets/documents/create_document.rb | 54 - .../snippets/documents/delete_document.rb | 54 - .../snippets/documents/export_document.rb | 54 - .../snippets/documents/get_document.rb | 47 - .../snippets/documents/import_documents.rb | 54 - .../snippets/documents/list_documents.rb | 51 - .../snippets/documents/reload_document.rb | 54 - .../snippets/documents/update_document.rb | 54 - .../get_encryption_spec.rb | 47 - .../initialize_encryption_spec.rb | 54 - .../entity_types/batch_create_entities.rb | 54 - .../entity_types/batch_delete_entities.rb | 54 - .../entity_types/batch_delete_entity_types.rb | 54 - .../entity_types/batch_update_entities.rb | 54 - .../entity_types/batch_update_entity_types.rb | 54 - .../entity_types/create_entity_type.rb | 47 - .../entity_types/delete_entity_type.rb | 47 - .../snippets/entity_types/get_entity_type.rb | 47 - .../entity_types/list_entity_types.rb | 51 - .../entity_types/update_entity_type.rb | 47 - .../environments/create_environment.rb | 47 - .../environments/delete_environment.rb | 47 - .../snippets/environments/get_environment.rb | 47 - .../environments/get_environment_history.rb | 51 - .../environments/list_environments.rb | 51 - .../environments/update_environment.rb | 47 - .../snippets/fulfillments/get_fulfillment.rb | 47 - .../fulfillments/update_fulfillment.rb | 47 - .../create_generator_evaluation.rb | 54 - .../delete_generator_evaluation.rb | 47 - .../get_generator_evaluation.rb | 47 - .../list_generator_evaluations.rb | 51 - .../snippets/generators/create_generator.rb | 47 - .../snippets/generators/delete_generator.rb | 47 - .../snippets/generators/get_generator.rb | 47 - .../snippets/generators/list_generators.rb | 51 - .../snippets/generators/update_generator.rb | 47 - .../snippets/intents/batch_delete_intents.rb | 54 - .../snippets/intents/batch_update_intents.rb | 54 - .../snippets/intents/create_intent.rb | 47 - .../snippets/intents/delete_intent.rb | 47 - .../snippets/intents/get_intent.rb | 47 - .../snippets/intents/list_intents.rb | 51 - .../snippets/intents/update_intent.rb | 47 - .../knowledge_bases/create_knowledge_base.rb | 47 - .../knowledge_bases/delete_knowledge_base.rb | 47 - .../knowledge_bases/get_knowledge_base.rb | 47 - .../knowledge_bases/list_knowledge_bases.rb | 51 - .../knowledge_bases/update_knowledge_base.rb | 47 - .../snippets/participants/analyze_content.rb | 47 - .../participants/create_participant.rb | 47 - .../snippets/participants/get_participant.rb | 47 - .../participants/list_participants.rb | 51 - .../participants/streaming_analyze_content.rb | 56 - .../snippets/participants/suggest_articles.rb | 47 - .../participants/suggest_faq_answers.rb | 47 - .../participants/suggest_knowledge_assist.rb | 47 - .../participants/suggest_smart_replies.rb | 47 - .../participants/update_participant.rb | 47 - .../create_session_entity_type.rb | 47 - .../delete_session_entity_type.rb | 47 - .../get_session_entity_type.rb | 47 - .../list_session_entity_types.rb | 51 - .../update_session_entity_type.rb | 47 - .../snippets/sessions/detect_intent.rb | 47 - .../sessions/streaming_detect_intent.rb | 56 - .../snippets/sip_trunks/create_sip_trunk.rb | 47 - .../snippets/sip_trunks/delete_sip_trunk.rb | 47 - .../snippets/sip_trunks/get_sip_trunk.rb | 47 - .../snippets/sip_trunks/list_sip_trunks.rb | 51 - .../snippets/sip_trunks/update_sip_trunk.rb | 47 - ...t_metadata_google.cloud.dialogflow.v2.json | 5215 ----------------- .../snippets/tools/create_tool.rb | 47 - .../snippets/tools/delete_tool.rb | 47 - .../snippets/tools/get_tool.rb | 47 - .../snippets/tools/list_tools.rb | 51 - .../snippets/tools/update_tool.rb | 47 - .../snippets/versions/create_version.rb | 47 - .../snippets/versions/delete_version.rb | 47 - .../snippets/versions/get_version.rb | 47 - .../snippets/versions/list_versions.rb | 51 - .../snippets/versions/update_version.rb | 47 - .../dialogflow/v2/agents_operations_test.rb | 400 -- .../cloud/dialogflow/v2/agents_paths_test.rb | 82 - .../cloud/dialogflow/v2/agents_rest_test.rb | 592 -- .../google/cloud/dialogflow/v2/agents_test.rb | 681 --- .../v2/answer_records_paths_test.rb | 157 - .../dialogflow/v2/answer_records_rest_test.rb | 211 - .../dialogflow/v2/answer_records_test.rb | 233 - .../dialogflow/v2/contexts_paths_test.rb | 85 - .../cloud/dialogflow/v2/contexts_rest_test.rb | 427 -- .../cloud/dialogflow/v2/contexts_test.rb | 465 -- .../conversation_datasets_operations_test.rb | 400 -- .../v2/conversation_datasets_paths_test.rb | 67 - .../v2/conversation_datasets_rest_test.rb | 373 -- .../v2/conversation_datasets_test.rb | 436 -- .../v2/conversation_models_operations_test.rb | 400 -- .../v2/conversation_models_paths_test.rb | 100 - .../v2/conversation_models_rest_test.rb | 591 -- .../dialogflow/v2/conversation_models_test.rb | 687 --- .../conversation_profiles_operations_test.rb | 400 -- .../v2/conversation_profiles_paths_test.rb | 178 - .../v2/conversation_profiles_rest_test.rb | 485 -- .../v2/conversation_profiles_test.rb | 555 -- .../dialogflow/v2/conversations_paths_test.rb | 262 - .../dialogflow/v2/conversations_rest_test.rb | 724 --- .../cloud/dialogflow/v2/conversations_test.rb | 815 --- .../v2/documents_operations_test.rb | 400 -- .../dialogflow/v2/documents_paths_test.rb | 73 - .../dialogflow/v2/documents_rest_test.rb | 545 -- .../cloud/dialogflow/v2/documents_test.rb | 648 -- ...encryption_spec_service_operations_test.rb | 400 -- .../v2/encryption_spec_service_paths_test.rb | 55 - .../v2/encryption_spec_service_rest_test.rb | 207 - .../v2/encryption_spec_service_test.rb | 239 - .../v2/entity_types_operations_test.rb | 400 -- .../dialogflow/v2/entity_types_paths_test.rb | 73 - .../dialogflow/v2/entity_types_rest_test.rb | 658 --- .../cloud/dialogflow/v2/entity_types_test.rb | 767 --- .../dialogflow/v2/environments_paths_test.rb | 103 - .../dialogflow/v2/environments_rest_test.rb | 431 -- .../cloud/dialogflow/v2/environments_test.rb | 478 -- .../dialogflow/v2/fulfillments_paths_test.rb | 58 - .../dialogflow/v2/fulfillments_rest_test.rb | 208 - .../cloud/dialogflow/v2/fulfillments_test.rb | 222 - .../generator_evaluations_operations_test.rb | 400 -- .../v2/generator_evaluations_paths_test.rb | 106 - .../v2/generator_evaluations_rest_test.rb | 318 - .../v2/generator_evaluations_test.rb | 366 -- .../dialogflow/v2/generators_paths_test.rb | 106 - .../dialogflow/v2/generators_rest_test.rb | 374 -- .../cloud/dialogflow/v2/generators_test.rb | 409 -- .../dialogflow/v2/intents_operations_test.rb | 400 -- .../cloud/dialogflow/v2/intents_paths_test.rb | 94 - .../cloud/dialogflow/v2/intents_rest_test.rb | 494 -- .../cloud/dialogflow/v2/intents_test.rb | 574 -- .../v2/knowledge_bases_paths_test.rb | 82 - .../v2/knowledge_bases_rest_test.rb | 375 -- .../dialogflow/v2/knowledge_bases_test.rb | 411 -- .../dialogflow/v2/participants_paths_test.rb | 142 - .../dialogflow/v2/participants_rest_test.rb | 607 -- .../cloud/dialogflow/v2/participants_test.rb | 786 --- .../v2/session_entity_types_paths_test.rb | 85 - .../v2/session_entity_types_rest_test.rb | 373 -- .../v2/session_entity_types_test.rb | 407 -- .../dialogflow/v2/sessions_paths_test.rb | 118 - .../cloud/dialogflow/v2/sessions_rest_test.rb | 158 - .../cloud/dialogflow/v2/sessions_test.rb | 274 - .../dialogflow/v2/sip_trunks_paths_test.rb | 67 - .../dialogflow/v2/sip_trunks_rest_test.rb | 373 -- .../cloud/dialogflow/v2/sip_trunks_test.rb | 407 -- .../cloud/dialogflow/v2/tools_paths_test.rb | 91 - .../cloud/dialogflow/v2/tools_rest_test.rb | 374 -- .../google/cloud/dialogflow/v2/tools_test.rb | 409 -- .../dialogflow/v2/versions_paths_test.rb | 73 - .../cloud/dialogflow/v2/versions_rest_test.rb | 373 -- .../cloud/dialogflow/v2/versions_test.rb | 407 -- .../google-cloud-dialogflow-v2/test/helper.rb | 26 - 513 files changed, 191 insertions(+), 135660 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google-cloud-dialogflow-v2.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_coaching_instruction_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_tool_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/gcs_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/operations_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_call_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/toolset_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/validation_result_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/paths.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/webhook_pb.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent_coaching_instruction.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/answer_record.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_tool.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/context.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_model.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/document.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/encryption_spec.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/gcs.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator_evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/sip_trunk.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool_call.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/toolset.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/validation_result.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/webhook.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/type/latlng.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/delete_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_suggestion.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_summary.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_suggestions.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/ingest_context_references.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/search_knowledge.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/suggest_conversation_summary.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/create_document.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/export_document.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/get_document.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/update_document.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/get_encryption_spec.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/initialize_encryption_spec.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/create_generator_evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/delete_generator_evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/get_generator_evaluation.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/list_generator_evaluations.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/create_generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/delete_generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/get_generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/list_generators.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/update_generator.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_knowledge_assist.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/create_sip_trunk.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/delete_sip_trunk.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/get_sip_trunk.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/list_sip_trunks.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/update_sip_trunk.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/create_tool.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/delete_tool.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/get_tool.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/list_tools.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/update_tool.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/create_version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/get_version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/update_version.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb delete mode 100644 owl-bot-staging/google-cloud-dialogflow-v2/test/helper.rb diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb index c9b624197b08..dfbd9ef236e2 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb @@ -9,7 +9,7 @@ require 'google/protobuf/duration_pb' -descriptor_data = "\n-google/cloud/dialogflow/v2/audio_config.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\"9\n\rSpeechContext\x12\x14\n\x07phrases\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x62oost\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\"\x92\x01\n\x0eSpeechWordInfo\x12\x0c\n\x04word\x18\x03 \x01(\t\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xb6\x04\n\x10InputAudioConfig\x12\x46\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32).google.cloud.dialogflow.v2.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x10\x65nable_word_info\x18\r \x01(\x08\x12\x18\n\x0cphrase_hints\x18\x04 \x03(\tB\x02\x18\x01\x12\x42\n\x0fspeech_contexts\x18\x0b \x03(\x0b\x32).google.cloud.dialogflow.v2.SpeechContext\x12\r\n\x05model\x18\x07 \x01(\t\x12\x45\n\rmodel_variant\x18\n \x01(\x0e\x32..google.cloud.dialogflow.v2.SpeechModelVariant\x12\x18\n\x10single_utterance\x18\x08 \x01(\x08\x12*\n\"disable_no_speech_recognized_event\x18\x0e \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x11 \x01(\x08\x12\x39\n\x0bphrase_sets\x18\x14 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12)\n!opt_out_conformer_model_migration\x18\x1a \x01(\x08\"p\n\x14VoiceSelectionParams\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x0bssml_gender\x18\x02 \x01(\x0e\x32+.google.cloud.dialogflow.v2.SsmlVoiceGenderB\x03\xe0\x41\x01\"\xa0\x02\n\x16SynthesizeSpeechConfig\x12\x1a\n\rspeaking_rate\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01\x12\x12\n\x05pitch\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1b\n\x0evolume_gain_db\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x44\n\x05voice\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.VoiceSelectionParamsB\x03\xe0\x41\x01\x12R\n\x0epronunciations\x18\x06 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.CustomPronunciationParamsB\x03\xe0\x41\x01\"\x96\x02\n\x19\x43ustomPronunciationParams\x12\x0e\n\x06phrase\x18\x01 \x01(\t\x12\x61\n\x11phonetic_encoding\x18\x02 \x01(\x0e\x32\x46.google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding\x12\x15\n\rpronunciation\x18\x03 \x01(\t\"o\n\x10PhoneticEncoding\x12!\n\x1dPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\n\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1d\n\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\"\xd2\x01\n\x11OutputAudioConfig\x12L\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32/.google.cloud.dialogflow.v2.OutputAudioEncodingB\x03\xe0\x41\x02\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12T\n\x18synthesize_speech_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig\"U\n\x13TelephonyDtmfEvents\x12>\n\x0b\x64tmf_events\x18\x01 \x03(\x0e\x32).google.cloud.dialogflow.v2.TelephonyDtmf\"\xe2\x02\n\x12SpeechToTextConfig\x12L\n\x14speech_model_variant\x18\x01 \x01(\x0e\x32..google.cloud.dialogflow.v2.SpeechModelVariant\x12\r\n\x05model\x18\x02 \x01(\t\x12\x39\n\x0bphrase_sets\x18\x04 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x41\n\x0e\x61udio_encoding\x18\x06 \x01(\x0e\x32).google.cloud.dialogflow.v2.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x07 \x01(\x05\x12\x15\n\rlanguage_code\x18\x08 \x01(\t\x12\x18\n\x10\x65nable_word_info\x18\t \x01(\x08\x12%\n\x1duse_timeout_based_endpointing\x18\x0b \x01(\x08*\x94\x02\n\rTelephonyDtmf\x12\x1e\n\x1aTELEPHONY_DTMF_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44TMF_ONE\x10\x01\x12\x0c\n\x08\x44TMF_TWO\x10\x02\x12\x0e\n\nDTMF_THREE\x10\x03\x12\r\n\tDTMF_FOUR\x10\x04\x12\r\n\tDTMF_FIVE\x10\x05\x12\x0c\n\x08\x44TMF_SIX\x10\x06\x12\x0e\n\nDTMF_SEVEN\x10\x07\x12\x0e\n\nDTMF_EIGHT\x10\x08\x12\r\n\tDTMF_NINE\x10\t\x12\r\n\tDTMF_ZERO\x10\n\x12\n\n\x06\x44TMF_A\x10\x0b\x12\n\n\x06\x44TMF_B\x10\x0c\x12\n\n\x06\x44TMF_C\x10\r\x12\n\n\x06\x44TMF_D\x10\x0e\x12\r\n\tDTMF_STAR\x10\x0f\x12\x0e\n\nDTMF_POUND\x10\x10*\x94\x02\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41UDIO_ENCODING_LINEAR_16\x10\x01\x12\x17\n\x13\x41UDIO_ENCODING_FLAC\x10\x02\x12\x18\n\x14\x41UDIO_ENCODING_MULAW\x10\x03\x12\x16\n\x12\x41UDIO_ENCODING_AMR\x10\x04\x12\x19\n\x15\x41UDIO_ENCODING_AMR_WB\x10\x05\x12\x1b\n\x17\x41UDIO_ENCODING_OGG_OPUS\x10\x06\x12)\n%AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x17\n\x13\x41UDIO_ENCODING_ALAW\x10\x08*v\n\x12SpeechModelVariant\x12$\n SPEECH_MODEL_VARIANT_UNSPECIFIED\x10\x00\x12\x16\n\x12USE_BEST_AVAILABLE\x10\x01\x12\x10\n\x0cUSE_STANDARD\x10\x02\x12\x10\n\x0cUSE_ENHANCED\x10\x03*\x8d\x01\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x1a\n\x16SSML_VOICE_GENDER_MALE\x10\x01\x12\x1c\n\x18SSML_VOICE_GENDER_FEMALE\x10\x02\x12\x1d\n\x19SSML_VOICE_GENDER_NEUTRAL\x10\x03*\x8c\x02\n\x13OutputAudioEncoding\x12%\n!OUTPUT_AUDIO_ENCODING_UNSPECIFIED\x10\x00\x12#\n\x1fOUTPUT_AUDIO_ENCODING_LINEAR_16\x10\x01\x12\x1d\n\x19OUTPUT_AUDIO_ENCODING_MP3\x10\x02\x12%\n!OUTPUT_AUDIO_ENCODING_MP3_64_KBPS\x10\x04\x12\"\n\x1eOUTPUT_AUDIO_ENCODING_OGG_OPUS\x10\x03\x12\x1f\n\x1bOUTPUT_AUDIO_ENCODING_MULAW\x10\x05\x12\x1e\n\x1aOUTPUT_AUDIO_ENCODING_ALAW\x10\x06\x42\xd3\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x10\x41udioConfigProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}\xea\x41\x62\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}b\x06proto3" +descriptor_data = "\n-google/cloud/dialogflow/v2/audio_config.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\"9\n\rSpeechContext\x12\x14\n\x07phrases\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x62oost\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\"\x92\x01\n\x0eSpeechWordInfo\x12\x0c\n\x04word\x18\x03 \x01(\t\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xb6\x04\n\x10InputAudioConfig\x12\x46\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32).google.cloud.dialogflow.v2.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x10\x65nable_word_info\x18\r \x01(\x08\x12\x18\n\x0cphrase_hints\x18\x04 \x03(\tB\x02\x18\x01\x12\x42\n\x0fspeech_contexts\x18\x0b \x03(\x0b\x32).google.cloud.dialogflow.v2.SpeechContext\x12\r\n\x05model\x18\x07 \x01(\t\x12\x45\n\rmodel_variant\x18\n \x01(\x0e\x32..google.cloud.dialogflow.v2.SpeechModelVariant\x12\x18\n\x10single_utterance\x18\x08 \x01(\x08\x12*\n\"disable_no_speech_recognized_event\x18\x0e \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x11 \x01(\x08\x12\x39\n\x0bphrase_sets\x18\x14 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12)\n!opt_out_conformer_model_migration\x18\x1a \x01(\x08\"p\n\x14VoiceSelectionParams\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x0bssml_gender\x18\x02 \x01(\x0e\x32+.google.cloud.dialogflow.v2.SsmlVoiceGenderB\x03\xe0\x41\x01\"\xa0\x02\n\x16SynthesizeSpeechConfig\x12\x1a\n\rspeaking_rate\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01\x12\x12\n\x05pitch\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1b\n\x0evolume_gain_db\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x44\n\x05voice\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.VoiceSelectionParamsB\x03\xe0\x41\x01\x12R\n\x0epronunciations\x18\x06 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.CustomPronunciationParamsB\x03\xe0\x41\x01\"\x96\x02\n\x19\x43ustomPronunciationParams\x12\x0e\n\x06phrase\x18\x01 \x01(\t\x12\x61\n\x11phonetic_encoding\x18\x02 \x01(\x0e\x32\x46.google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding\x12\x15\n\rpronunciation\x18\x03 \x01(\t\"o\n\x10PhoneticEncoding\x12!\n\x1dPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\n\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1d\n\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\"\xd2\x01\n\x11OutputAudioConfig\x12L\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32/.google.cloud.dialogflow.v2.OutputAudioEncodingB\x03\xe0\x41\x02\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12T\n\x18synthesize_speech_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig\"U\n\x13TelephonyDtmfEvents\x12>\n\x0b\x64tmf_events\x18\x01 \x03(\x0e\x32).google.cloud.dialogflow.v2.TelephonyDtmf\"\xe2\x02\n\x12SpeechToTextConfig\x12L\n\x14speech_model_variant\x18\x01 \x01(\x0e\x32..google.cloud.dialogflow.v2.SpeechModelVariant\x12\r\n\x05model\x18\x02 \x01(\t\x12\x39\n\x0bphrase_sets\x18\x04 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x41\n\x0e\x61udio_encoding\x18\x06 \x01(\x0e\x32).google.cloud.dialogflow.v2.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x07 \x01(\x05\x12\x15\n\rlanguage_code\x18\x08 \x01(\t\x12\x18\n\x10\x65nable_word_info\x18\t \x01(\x08\x12%\n\x1duse_timeout_based_endpointing\x18\x0b \x01(\x08*\x94\x02\n\rTelephonyDtmf\x12\x1e\n\x1aTELEPHONY_DTMF_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44TMF_ONE\x10\x01\x12\x0c\n\x08\x44TMF_TWO\x10\x02\x12\x0e\n\nDTMF_THREE\x10\x03\x12\r\n\tDTMF_FOUR\x10\x04\x12\r\n\tDTMF_FIVE\x10\x05\x12\x0c\n\x08\x44TMF_SIX\x10\x06\x12\x0e\n\nDTMF_SEVEN\x10\x07\x12\x0e\n\nDTMF_EIGHT\x10\x08\x12\r\n\tDTMF_NINE\x10\t\x12\r\n\tDTMF_ZERO\x10\n\x12\n\n\x06\x44TMF_A\x10\x0b\x12\n\n\x06\x44TMF_B\x10\x0c\x12\n\n\x06\x44TMF_C\x10\r\x12\n\n\x06\x44TMF_D\x10\x0e\x12\r\n\tDTMF_STAR\x10\x0f\x12\x0e\n\nDTMF_POUND\x10\x10*\x94\x02\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41UDIO_ENCODING_LINEAR_16\x10\x01\x12\x17\n\x13\x41UDIO_ENCODING_FLAC\x10\x02\x12\x18\n\x14\x41UDIO_ENCODING_MULAW\x10\x03\x12\x16\n\x12\x41UDIO_ENCODING_AMR\x10\x04\x12\x19\n\x15\x41UDIO_ENCODING_AMR_WB\x10\x05\x12\x1b\n\x17\x41UDIO_ENCODING_OGG_OPUS\x10\x06\x12)\n%AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x17\n\x13\x41UDIO_ENCODING_ALAW\x10\x08*v\n\x12SpeechModelVariant\x12$\n SPEECH_MODEL_VARIANT_UNSPECIFIED\x10\x00\x12\x16\n\x12USE_BEST_AVAILABLE\x10\x01\x12\x10\n\x0cUSE_STANDARD\x10\x02\x12\x10\n\x0cUSE_ENHANCED\x10\x03*\x8d\x01\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x1a\n\x16SSML_VOICE_GENDER_MALE\x10\x01\x12\x1c\n\x18SSML_VOICE_GENDER_FEMALE\x10\x02\x12\x1d\n\x19SSML_VOICE_GENDER_NEUTRAL\x10\x03*\x90\x02\n\x13OutputAudioEncoding\x12%\n!OUTPUT_AUDIO_ENCODING_UNSPECIFIED\x10\x00\x12#\n\x1fOUTPUT_AUDIO_ENCODING_LINEAR_16\x10\x01\x12!\n\x19OUTPUT_AUDIO_ENCODING_MP3\x10\x02\x1a\x02\x08\x01\x12%\n!OUTPUT_AUDIO_ENCODING_MP3_64_KBPS\x10\x04\x12\"\n\x1eOUTPUT_AUDIO_ENCODING_OGG_OPUS\x10\x03\x12\x1f\n\x1bOUTPUT_AUDIO_ENCODING_MULAW\x10\x05\x12\x1e\n\x1aOUTPUT_AUDIO_ENCODING_ALAW\x10\x06\x42\xd3\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x10\x41udioConfigProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}\xea\x41\x62\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb index 5761fa15919a..263ce7a87969 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb @@ -9,7 +9,7 @@ require 'google/cloud/dialogflow/v2/tool_pb' -descriptor_data = "\n(google/cloud/dialogflow/v2/ces_app.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dialogflow/v2/tool.proto\"\x9e\x01\n\nCesAppSpec\x12/\n\x07\x63\x65s_app\x18\x01 \x01(\tB\x1e\xe0\x41\x01\xfa\x41\x18\n\x16\x63\x65s.googleapis.com/App\x12_\n\x18\x63onfirmation_requirement\x18\x02 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xe0\x41\x01\x42\xe0\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0b\x43\x65sAppProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41L\n\x16\x63\x65s.googleapis.com/App\x12\x32projects/{project}/locations/{location}/apps/{app}b\x06proto3" +descriptor_data = "\n(google/cloud/dialogflow/v2/ces_app.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dialogflow/v2/tool.proto\"\x92\x02\n\nCesAppSpec\x12/\n\x07\x63\x65s_app\x18\x01 \x01(\tB\x1e\xe0\x41\x01\xfa\x41\x18\n\x16\x63\x65s.googleapis.com/App\x12_\n\x18\x63onfirmation_requirement\x18\x02 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xe0\x41\x01\x12#\n\x11proactive_enabled\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\"\n\x10reactive_enabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x14\n\x12_proactive_enabledB\x13\n\x11_reactive_enabledB\xe0\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0b\x43\x65sAppProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41L\n\x16\x63\x65s.googleapis.com/App\x12\x32projects/{project}/locations/{location}/apps/{app}b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb index 068954e03b31..83f9f95b1577 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb @@ -16,7 +16,7 @@ require 'google/protobuf/timestamp_pb' -descriptor_data = "\n-google/cloud/dialogflow/v2/conversation.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/dialogflow/v2/conversation_profile.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf4\x16\n\x0c\x43onversation\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12U\n\x0flifecycle_state\x18\x02 \x01(\x0e\x32\x37.google.cloud.dialogflow.v2.Conversation.LifecycleStateB\x03\xe0\x41\x03\x12S\n\x14\x63onversation_profile\x18\x03 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\x12N\n\x0cphone_number\x18\x04 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.ConversationPhoneNumberB\x03\xe0\x41\x03\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\x12[\n\x12\x63onversation_stage\x18\x07 \x01(\x0e\x32:.google.cloud.dialogflow.v2.Conversation.ConversationStageB\x03\xe0\x41\x01\x12h\n\x19telephony_connection_info\x18\n \x01(\x0b\x32@.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfoB\x03\xe0\x41\x03\x12]\n\x1cinitial_conversation_profile\x18\x0f \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x06\xe0\x41\x01\xe0\x41\x03\x12q\n\x1bingested_context_references\x18\x11 \x03(\x0b\x32G.google.cloud.dialogflow.v2.Conversation.IngestedContextReferencesEntryB\x03\xe0\x41\x03\x12o\n\x1ainitial_generator_contexts\x18\x12 \x03(\x0b\x32\x46.google.cloud.dialogflow.v2.Conversation.InitialGeneratorContextsEntryB\x03\xe0\x41\x03\x1a\x8e\x03\n\x17TelephonyConnectionInfo\x12\x1a\n\rdialed_number\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03sdp\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x64\n\x0bsip_headers\x18\x0c \x03(\x0b\x32J.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeaderB\x03\xe0\x41\x03\x12n\n\x13\x65xtra_mime_contents\x18\r \x03(\x0b\x32L.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContentB\x03\xe0\x41\x03\x1a\x32\n\tSipHeader\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a;\n\x0bMimeContent\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ontent\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01\x1a\xac\x05\n\x10\x43ontextReference\x12g\n\x10\x63ontext_contents\x18\x01 \x03(\x0b\x32H.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContentB\x03\xe0\x41\x02\x12^\n\x0bupdate_mode\x18\x02 \x01(\x0e\x32\x44.google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateModeB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\xb6\x02\n\x0e\x43ontextContent\x12\x14\n\x07\x63ontent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12s\n\x0e\x63ontent_format\x18\x02 \x01(\x0e\x32V.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormatB\x03\xe0\x41\x02\x12\x37\n\x0eingestion_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\ranswer_record\x18\x04 \x01(\t\"I\n\rContentFormat\x12\x1e\n\x1a\x43ONTENT_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04JSON\x10\x01\x12\x0e\n\nPLAIN_TEXT\x10\x02\"D\n\nUpdateMode\x12\x1b\n\x17UPDATE_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41PPEND\x10\x01\x12\r\n\tOVERWRITE\x10\x02\x1a\xa6\x02\n\x10GeneratorContext\x12\x64\n\x0egenerator_type\x18\x01 \x01(\x0e\x32G.google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorTypeB\x03\xe0\x41\x03\"\xab\x01\n\rGeneratorType\x12\x1e\n\x1aGENERATOR_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFREE_FORM\x10\x01\x12\x12\n\x0e\x41GENT_COACHING\x10\x02\x12\x11\n\rSUMMARIZATION\x10\x03\x12\x0f\n\x0bTRANSLATION\x10\x04\x12\x12\n\x0e\x41GENT_FEEDBACK\x10\x05\x12\x1f\n\x1b\x43USTOMER_MESSAGE_GENERATION\x10\x06\x1a{\n\x1eIngestedContextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\x1az\n\x1dInitialGeneratorContextsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.GeneratorContext:\x02\x38\x01\"Q\n\x0eLifecycleState\x12\x1f\n\x1bLIFECYCLE_STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tCOMPLETED\x10\x02\"h\n\x11\x43onversationStage\x12\"\n\x1e\x43ONVERSATION_STAGE_UNSPECIFIED\x10\x00\x12\x17\n\x13VIRTUAL_AGENT_STAGE\x10\x01\x12\x16\n\x12HUMAN_ASSIST_STAGE\x10\x02:\xc0\x01\xea\x41\xbc\x01\n&dialogflow.googleapis.com/Conversation\x12/projects/{project}/conversations/{conversation}\x12\x44projects/{project}/locations/{location}/conversations/{conversation}*\rconversations2\x0c\x63onversation\"\xbe\x01\n\x19\x43reateConversationRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/Conversation\x12\x43\n\x0c\x63onversation\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.v2.ConversationB\x03\xe0\x41\x02\x12\x1c\n\x0f\x63onversation_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x18ListConversationsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/Conversation\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\"u\n\x19ListConversationsResponse\x12?\n\rconversations\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.Conversation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x16GetConversationRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\"[\n\x1b\x43ompleteConversationRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\"\x96\x01\n\x13ListMessagesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Message\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\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\"f\n\x14ListMessagesResponse\x12\x35\n\x08messages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x17\x43onversationPhoneNumber\x12\x19\n\x0c\x63ountry_code\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x0cphone_number\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xcf\x02\n\x1eIngestContextReferencesRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12r\n\x12\x63ontext_references\x18\x02 \x03(\x0b\x32Q.google.cloud.dialogflow.v2.IngestContextReferencesRequest.ContextReferencesEntryB\x03\xe0\x41\x02\x1as\n\x16\x43ontextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\"\x9f\x02\n\x1fIngestContextReferencesResponse\x12\x7f\n\x1bingested_context_references\x18\x01 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.IngestContextReferencesResponse.IngestedContextReferencesEntry\x1a{\n\x1eIngestedContextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\"\x9c\x02\n!SuggestConversationSummaryRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12S\n\x13\x61ssist_query_params\x18\x05 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParametersB\x03\xe0\x41\x01\"\xaa\x05\n\"SuggestConversationSummaryResponse\x12W\n\x07summary\x18\x01 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x1a\xd4\x03\n\x07Summary\x12\x0c\n\x04text\x18\x01 \x01(\t\x12o\n\rtext_sections\x18\x04 \x03(\x0b\x32X.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.TextSectionsEntry\x12s\n\x14sorted_text_sections\x18\x06 \x03(\x0b\x32U.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x12\x1e\n\x16\x62\x61seline_model_version\x18\x05 \x01(\t\x1a<\n\x0eSummarySection\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07summary\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xdc\x03\n\x1fGenerateStatelessSummaryRequest\x12t\n\x16stateless_conversation\x18\x01 \x01(\x0b\x32O.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversationB\x03\xe0\x41\x02\x12R\n\x14\x63onversation_profile\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\x12\x41\n\x0elatest_message\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x1d\n\x10max_context_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x1a\x8c\x01\n\x13MinimalConversation\x12:\n\x08messages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.MessageB\x03\xe0\x41\x02\x12\x39\n\x06parent\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\"\xad\x03\n GenerateStatelessSummaryResponse\x12U\n\x07summary\x18\x01 \x01(\x0b\x32\x44.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x1a\xdb\x01\n\x07Summary\x12\x0c\n\x04text\x18\x01 \x01(\t\x12m\n\rtext_sections\x18\x02 \x03(\x0b\x32V.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary.TextSectionsEntry\x12\x1e\n\x16\x62\x61seline_model_version\x18\x04 \x01(\t\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf3\x04\n\"GenerateStatelessSuggestionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12:\n\tgenerator\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorH\x00\x12\x18\n\x0egenerator_name\x18\x03 \x01(\tH\x00\x12v\n\x12\x63ontext_references\x18\x04 \x03(\x0b\x32U.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.ContextReferencesEntryB\x03\xe0\x41\x01\x12R\n\x14\x63onversation_context\x18\x05 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationContextB\x03\xe0\x41\x01\x12\x45\n\x0etrigger_events\x18\x06 \x03(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x12\x1e\n\x11security_settings\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1as\n\x16\x43ontextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\x42\x14\n\x12generator_resource\"y\n#GenerateStatelessSuggestionResponse\x12R\n\x14generator_suggestion\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xe0\x41\x02\"\x9c\x12\n\x16SearchKnowledgeRequest\x12\x13\n\x06parent\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x05query\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputB\x03\xe0\x41\x02\x12S\n\x14\x63onversation_profile\x18\x02 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\x12\x17\n\nsession_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x0c\x63onversation\x18\x04 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x05 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12Y\n\x0cquery_source\x18\x07 \x01(\x0e\x32>.google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySourceB\x03\xe0\x41\x01\x12\x37\n\x11\x65nd_user_metadata\x18\t \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12[\n\rsearch_config\x18\x0b \x01(\x0b\x32?.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfigB\x03\xe0\x41\x01\x12\x19\n\x0c\x65xact_search\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x1a\xdb\x0c\n\x0cSearchConfig\x12\x64\n\x0b\x62oost_specs\x18\x01 \x03(\x0b\x32J.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecsB\x03\xe0\x41\x01\x12\x66\n\x0c\x66ilter_specs\x18\x02 \x03(\x0b\x32K.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecsB\x03\xe0\x41\x01\x1a\xbe\n\n\nBoostSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12g\n\x04spec\x18\x02 \x03(\x0b\x32T.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpecB\x03\xe0\x41\x01\x1a\xff\x08\n\tBoostSpec\x12\x8b\x01\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32g.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpecB\x03\xe0\x41\x01\x1a\xe3\x07\n\x12\x43onditionBoostSpec\x12\x16\n\tcondition\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x62oost\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x12\x99\x01\n\x12\x62oost_control_spec\x18\x04 \x01(\x0b\x32x.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpecB\x03\xe0\x41\x01\x1a\x84\x06\n\x10\x42oostControlSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\xa4\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32\x86\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeTypeB\x03\xe0\x41\x01\x12\xac\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32\x8a\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationTypeB\x03\xe0\x41\x01\x12\xa3\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32\x85\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.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\x1a<\n\x0b\x46ilterSpecs\x12\x18\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\"Q\n\x0bQuerySource\x12\x1c\n\x18QUERY_SOURCE_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x41GENT_QUERY\x10\x01\x12\x13\n\x0fSUGGESTED_QUERY\x10\x02\"\xa4\x04\n\x18SearchKnowledgeDebugInfo\x12V\n\x19\x64\x61tastore_response_reason\x18\x01 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\n\x19search_knowledge_behavior\x18\x02 \x01(\x0b\x32L.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior\x12l\n%ingested_context_reference_debug_info\x18\x03 \x01(\x0b\x32=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12\x43\n\x0fservice_latency\x18\x04 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ServiceLatency\x1a\x8b\x01\n\x17SearchKnowledgeBehavior\x12%\n\x1d\x61nswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\n\x1a\x65nd_user_metadata_included\x18\x02 \x01(\x08\x12%\n\x1dthird_party_connector_allowed\x18\x04 \x01(\x08\"\xd1\x01\n\x17SearchKnowledgeResponse\x12\x42\n\x07\x61nswers\x18\x02 \x03(\x0b\x32\x31.google.cloud.dialogflow.v2.SearchKnowledgeAnswer\x12\x17\n\x0frewritten_query\x18\x03 \x01(\t\x12Y\n\x1bsearch_knowledge_debug_info\x18\x04 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo\"\xce\x03\n\x15SearchKnowledgeAnswer\x12\x0e\n\x06\x61nswer\x18\x01 \x01(\t\x12Q\n\x0b\x61nswer_type\x18\x02 \x01(\x0e\x32<.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType\x12V\n\x0e\x61nswer_sources\x18\x03 \x03(\x0b\x32>.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource\x12\x42\n\ranswer_record\x18\x05 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x1a\x66\n\x0c\x41nswerSource\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x0f\n\x07snippet\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\"N\n\nAnswerType\x12\x1b\n\x17\x41NSWER_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x46\x41Q\x10\x01\x12\x0e\n\nGENERATIVE\x10\x02\x12\n\n\x06INTENT\x10\x03\"\xec\x01\n\x1aGenerateSuggestionsRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x45\n\x0etrigger_events\x18\x03 \x03(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x32\xa6\x1a\n\rConversations\x12\x8c\x02\n\x12\x43reateConversation\x12\x35.google.cloud.dialogflow.v2.CreateConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"\x94\x01\xda\x41\x13parent,conversation\x82\xd3\xe4\x93\x02x\"%/v2/{parent=projects/*}/conversations:\x0c\x63onversationZA\"1/v2/{parent=projects/*/locations/*}/conversations:\x0c\x63onversation\x12\xed\x01\n\x11ListConversations\x12\x34.google.cloud.dialogflow.v2.ListConversationsRequest\x1a\x35.google.cloud.dialogflow.v2.ListConversationsResponse\"k\xda\x41\x06parent\x82\xd3\xe4\x93\x02\\\x12%/v2/{parent=projects/*}/conversationsZ3\x12\x31/v2/{parent=projects/*/locations/*}/conversations\x12\xda\x01\n\x0fGetConversation\x12\x32.google.cloud.dialogflow.v2.GetConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\\x12%/v2/{name=projects/*/conversations/*}Z3\x12\x31/v2/{name=projects/*/locations/*/conversations/*}\x12\xfd\x01\n\x14\x43ompleteConversation\x12\x37.google.cloud.dialogflow.v2.CompleteConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\"./v2/{name=projects/*/conversations/*}:complete:\x01*Z?\":/v2/{name=projects/*/locations/*/conversations/*}:complete:\x01*\x12\x92\x02\n\x17IngestContextReferences\x12:.google.cloud.dialogflow.v2.IngestContextReferencesRequest\x1a;.google.cloud.dialogflow.v2.IngestContextReferencesResponse\"~\xda\x41\x1f\x63onversation,context_references\x82\xd3\xe4\x93\x02V\"Q/v2/{conversation=projects/*/locations/*/conversations/*}:ingestContextReferences:\x01*\x12\xf5\x01\n\x0cListMessages\x12/.google.cloud.dialogflow.v2.ListMessagesRequest\x1a\x30.google.cloud.dialogflow.v2.ListMessagesResponse\"\x81\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02r\x12\x30/v2/{parent=projects/*/conversations/*}/messagesZ>\x12.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse\"\xd6\x01\xda\x41\x0c\x63onversation\x82\xd3\xe4\x93\x02\xc0\x01\"T/v2/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary:\x01*Ze\"`/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary:\x01*\x12\xdd\x02\n\x18GenerateStatelessSummary\x12;.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest\x1a<.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse\"\xc5\x01\x82\xd3\xe4\x93\x02\xbe\x01\"S/v2/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary:\x01*Zd\"_/v2/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary:\x01*\x12\xeb\x01\n\x1bGenerateStatelessSuggestion\x12>.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest\x1a?.google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse\"K\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate:\x01*\x12\xae\x03\n\x0fSearchKnowledge\x12\x32.google.cloud.dialogflow.v2.SearchKnowledgeRequest\x1a\x33.google.cloud.dialogflow.v2.SearchKnowledgeResponse\"\xb1\x02\x82\xd3\xe4\x93\x02\xaa\x02\"3/v2/{parent=projects/*}/suggestions:searchKnowledge:\x01*ZD\"?/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge:\x01*ZN\"I/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge:\x01*ZZ\"U/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge:\x01*\x12\xbb\x02\n\x13GenerateSuggestions\x12\x36.google.cloud.dialogflow.v2.GenerateSuggestionsRequest\x1a\x37.google.cloud.dialogflow.v2.GenerateSuggestionsResponse\"\xb2\x01\xda\x41\x0c\x63onversation\x82\xd3\xe4\x93\x02\x9c\x01\"B/v2/{conversation=projects/*/conversations/*}/suggestions:generate:\x01*ZS\"N/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:generate:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xbd\x03\n\x1e\x63om.google.cloud.dialogflow.v2B\x11\x43onversationProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\x12?projects/{project}/locations/{location}/dataStores/{data_store}\xea\x41Z\n\x17\x63\x65s.googleapis.com/Tool\x12?projects/{project}/locations/{location}/apps/{app}/tools/{tool}b\x06proto3" +descriptor_data = "\n-google/cloud/dialogflow/v2/conversation.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/dialogflow/v2/conversation_profile.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf4\x16\n\x0c\x43onversation\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12U\n\x0flifecycle_state\x18\x02 \x01(\x0e\x32\x37.google.cloud.dialogflow.v2.Conversation.LifecycleStateB\x03\xe0\x41\x03\x12S\n\x14\x63onversation_profile\x18\x03 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\x12N\n\x0cphone_number\x18\x04 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.ConversationPhoneNumberB\x03\xe0\x41\x03\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\x12[\n\x12\x63onversation_stage\x18\x07 \x01(\x0e\x32:.google.cloud.dialogflow.v2.Conversation.ConversationStageB\x03\xe0\x41\x01\x12h\n\x19telephony_connection_info\x18\n \x01(\x0b\x32@.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfoB\x03\xe0\x41\x03\x12]\n\x1cinitial_conversation_profile\x18\x0f \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x06\xe0\x41\x01\xe0\x41\x03\x12q\n\x1bingested_context_references\x18\x11 \x03(\x0b\x32G.google.cloud.dialogflow.v2.Conversation.IngestedContextReferencesEntryB\x03\xe0\x41\x03\x12o\n\x1ainitial_generator_contexts\x18\x12 \x03(\x0b\x32\x46.google.cloud.dialogflow.v2.Conversation.InitialGeneratorContextsEntryB\x03\xe0\x41\x03\x1a\x8e\x03\n\x17TelephonyConnectionInfo\x12\x1a\n\rdialed_number\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03sdp\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x64\n\x0bsip_headers\x18\x0c \x03(\x0b\x32J.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeaderB\x03\xe0\x41\x03\x12n\n\x13\x65xtra_mime_contents\x18\r \x03(\x0b\x32L.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContentB\x03\xe0\x41\x03\x1a\x32\n\tSipHeader\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a;\n\x0bMimeContent\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ontent\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01\x1a\xac\x05\n\x10\x43ontextReference\x12g\n\x10\x63ontext_contents\x18\x01 \x03(\x0b\x32H.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContentB\x03\xe0\x41\x02\x12^\n\x0bupdate_mode\x18\x02 \x01(\x0e\x32\x44.google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateModeB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\xb6\x02\n\x0e\x43ontextContent\x12\x14\n\x07\x63ontent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12s\n\x0e\x63ontent_format\x18\x02 \x01(\x0e\x32V.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormatB\x03\xe0\x41\x02\x12\x37\n\x0eingestion_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\ranswer_record\x18\x04 \x01(\t\"I\n\rContentFormat\x12\x1e\n\x1a\x43ONTENT_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04JSON\x10\x01\x12\x0e\n\nPLAIN_TEXT\x10\x02\"D\n\nUpdateMode\x12\x1b\n\x17UPDATE_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41PPEND\x10\x01\x12\r\n\tOVERWRITE\x10\x02\x1a\xa6\x02\n\x10GeneratorContext\x12\x64\n\x0egenerator_type\x18\x01 \x01(\x0e\x32G.google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorTypeB\x03\xe0\x41\x03\"\xab\x01\n\rGeneratorType\x12\x1e\n\x1aGENERATOR_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFREE_FORM\x10\x01\x12\x12\n\x0e\x41GENT_COACHING\x10\x02\x12\x11\n\rSUMMARIZATION\x10\x03\x12\x0f\n\x0bTRANSLATION\x10\x04\x12\x12\n\x0e\x41GENT_FEEDBACK\x10\x05\x12\x1f\n\x1b\x43USTOMER_MESSAGE_GENERATION\x10\x06\x1a{\n\x1eIngestedContextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\x1az\n\x1dInitialGeneratorContextsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.GeneratorContext:\x02\x38\x01\"Q\n\x0eLifecycleState\x12\x1f\n\x1bLIFECYCLE_STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tCOMPLETED\x10\x02\"h\n\x11\x43onversationStage\x12\"\n\x1e\x43ONVERSATION_STAGE_UNSPECIFIED\x10\x00\x12\x17\n\x13VIRTUAL_AGENT_STAGE\x10\x01\x12\x16\n\x12HUMAN_ASSIST_STAGE\x10\x02:\xc0\x01\xea\x41\xbc\x01\n&dialogflow.googleapis.com/Conversation\x12/projects/{project}/conversations/{conversation}\x12\x44projects/{project}/locations/{location}/conversations/{conversation}*\rconversations2\x0c\x63onversation\"\xbe\x01\n\x19\x43reateConversationRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/Conversation\x12\x43\n\x0c\x63onversation\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.v2.ConversationB\x03\xe0\x41\x02\x12\x1c\n\x0f\x63onversation_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x18ListConversationsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/Conversation\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\"u\n\x19ListConversationsResponse\x12?\n\rconversations\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.Conversation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x16GetConversationRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\"[\n\x1b\x43ompleteConversationRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\"\x96\x01\n\x13ListMessagesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Message\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\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\"f\n\x14ListMessagesResponse\x12\x35\n\x08messages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x17\x43onversationPhoneNumber\x12\x19\n\x0c\x63ountry_code\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x0cphone_number\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xcf\x02\n\x1eIngestContextReferencesRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12r\n\x12\x63ontext_references\x18\x02 \x03(\x0b\x32Q.google.cloud.dialogflow.v2.IngestContextReferencesRequest.ContextReferencesEntryB\x03\xe0\x41\x02\x1as\n\x16\x43ontextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\"\x9f\x02\n\x1fIngestContextReferencesResponse\x12\x7f\n\x1bingested_context_references\x18\x01 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.IngestContextReferencesResponse.IngestedContextReferencesEntry\x1a{\n\x1eIngestedContextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\"\x9c\x02\n!SuggestConversationSummaryRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12S\n\x13\x61ssist_query_params\x18\x05 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParametersB\x03\xe0\x41\x01\"\xaa\x05\n\"SuggestConversationSummaryResponse\x12W\n\x07summary\x18\x01 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x1a\xd4\x03\n\x07Summary\x12\x0c\n\x04text\x18\x01 \x01(\t\x12o\n\rtext_sections\x18\x04 \x03(\x0b\x32X.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.TextSectionsEntry\x12s\n\x14sorted_text_sections\x18\x06 \x03(\x0b\x32U.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x12\x1e\n\x16\x62\x61seline_model_version\x18\x05 \x01(\t\x1a<\n\x0eSummarySection\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07summary\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xdc\x03\n\x1fGenerateStatelessSummaryRequest\x12t\n\x16stateless_conversation\x18\x01 \x01(\x0b\x32O.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversationB\x03\xe0\x41\x02\x12R\n\x14\x63onversation_profile\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\x12\x41\n\x0elatest_message\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x1d\n\x10max_context_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x1a\x8c\x01\n\x13MinimalConversation\x12:\n\x08messages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.MessageB\x03\xe0\x41\x02\x12\x39\n\x06parent\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\"\xad\x03\n GenerateStatelessSummaryResponse\x12U\n\x07summary\x18\x01 \x01(\x0b\x32\x44.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x1a\xdb\x01\n\x07Summary\x12\x0c\n\x04text\x18\x01 \x01(\t\x12m\n\rtext_sections\x18\x02 \x03(\x0b\x32V.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary.TextSectionsEntry\x12\x1e\n\x16\x62\x61seline_model_version\x18\x04 \x01(\t\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf3\x04\n\"GenerateStatelessSuggestionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12:\n\tgenerator\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorH\x00\x12\x18\n\x0egenerator_name\x18\x03 \x01(\tH\x00\x12v\n\x12\x63ontext_references\x18\x04 \x03(\x0b\x32U.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.ContextReferencesEntryB\x03\xe0\x41\x01\x12R\n\x14\x63onversation_context\x18\x05 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationContextB\x03\xe0\x41\x01\x12\x45\n\x0etrigger_events\x18\x06 \x03(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x12\x1e\n\x11security_settings\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1as\n\x16\x43ontextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\x42\x14\n\x12generator_resource\"y\n#GenerateStatelessSuggestionResponse\x12R\n\x14generator_suggestion\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xe0\x41\x02\"\x9c\x12\n\x16SearchKnowledgeRequest\x12\x13\n\x06parent\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x05query\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputB\x03\xe0\x41\x02\x12S\n\x14\x63onversation_profile\x18\x02 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\x12\x17\n\nsession_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x0c\x63onversation\x18\x04 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x05 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12Y\n\x0cquery_source\x18\x07 \x01(\x0e\x32>.google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySourceB\x03\xe0\x41\x01\x12\x37\n\x11\x65nd_user_metadata\x18\t \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12[\n\rsearch_config\x18\x0b \x01(\x0b\x32?.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfigB\x03\xe0\x41\x01\x12\x19\n\x0c\x65xact_search\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x1a\xdb\x0c\n\x0cSearchConfig\x12\x64\n\x0b\x62oost_specs\x18\x01 \x03(\x0b\x32J.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecsB\x03\xe0\x41\x01\x12\x66\n\x0c\x66ilter_specs\x18\x02 \x03(\x0b\x32K.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecsB\x03\xe0\x41\x01\x1a\xbe\n\n\nBoostSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12g\n\x04spec\x18\x02 \x03(\x0b\x32T.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpecB\x03\xe0\x41\x01\x1a\xff\x08\n\tBoostSpec\x12\x8b\x01\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32g.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpecB\x03\xe0\x41\x01\x1a\xe3\x07\n\x12\x43onditionBoostSpec\x12\x16\n\tcondition\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x62oost\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x12\x99\x01\n\x12\x62oost_control_spec\x18\x04 \x01(\x0b\x32x.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpecB\x03\xe0\x41\x01\x1a\x84\x06\n\x10\x42oostControlSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\xa4\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32\x86\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeTypeB\x03\xe0\x41\x01\x12\xac\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32\x8a\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationTypeB\x03\xe0\x41\x01\x12\xa3\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32\x85\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.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\x1a<\n\x0b\x46ilterSpecs\x12\x18\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\"Q\n\x0bQuerySource\x12\x1c\n\x18QUERY_SOURCE_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x41GENT_QUERY\x10\x01\x12\x13\n\x0fSUGGESTED_QUERY\x10\x02\"\xa4\x04\n\x18SearchKnowledgeDebugInfo\x12V\n\x19\x64\x61tastore_response_reason\x18\x01 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\n\x19search_knowledge_behavior\x18\x02 \x01(\x0b\x32L.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior\x12l\n%ingested_context_reference_debug_info\x18\x03 \x01(\x0b\x32=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12\x43\n\x0fservice_latency\x18\x04 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ServiceLatency\x1a\x8b\x01\n\x17SearchKnowledgeBehavior\x12%\n\x1d\x61nswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\n\x1a\x65nd_user_metadata_included\x18\x02 \x01(\x08\x12%\n\x1dthird_party_connector_allowed\x18\x04 \x01(\x08\"\xd1\x01\n\x17SearchKnowledgeResponse\x12\x42\n\x07\x61nswers\x18\x02 \x03(\x0b\x32\x31.google.cloud.dialogflow.v2.SearchKnowledgeAnswer\x12\x17\n\x0frewritten_query\x18\x03 \x01(\t\x12Y\n\x1bsearch_knowledge_debug_info\x18\x04 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo\"\xe7\x03\n\x15SearchKnowledgeAnswer\x12\x0e\n\x06\x61nswer\x18\x01 \x01(\t\x12Q\n\x0b\x61nswer_type\x18\x02 \x01(\x0e\x32<.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType\x12V\n\x0e\x61nswer_sources\x18\x03 \x03(\x0b\x32>.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource\x12\x42\n\ranswer_record\x18\x05 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x1a\x66\n\x0c\x41nswerSource\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x0f\n\x07snippet\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\"g\n\nAnswerType\x12\x1b\n\x17\x41NSWER_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x46\x41Q\x10\x01\x12\x0e\n\nGENERATIVE\x10\x02\x12\n\n\x06INTENT\x10\x03\x12\x0c\n\x08PLAYBOOK\x10\x04\x12\t\n\x05\x45VENT\x10\x05\"\xec\x01\n\x1aGenerateSuggestionsRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x45\n\x0etrigger_events\x18\x03 \x03(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x32\xa6\x1a\n\rConversations\x12\x8c\x02\n\x12\x43reateConversation\x12\x35.google.cloud.dialogflow.v2.CreateConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"\x94\x01\xda\x41\x13parent,conversation\x82\xd3\xe4\x93\x02x\"%/v2/{parent=projects/*}/conversations:\x0c\x63onversationZA\"1/v2/{parent=projects/*/locations/*}/conversations:\x0c\x63onversation\x12\xed\x01\n\x11ListConversations\x12\x34.google.cloud.dialogflow.v2.ListConversationsRequest\x1a\x35.google.cloud.dialogflow.v2.ListConversationsResponse\"k\xda\x41\x06parent\x82\xd3\xe4\x93\x02\\\x12%/v2/{parent=projects/*}/conversationsZ3\x12\x31/v2/{parent=projects/*/locations/*}/conversations\x12\xda\x01\n\x0fGetConversation\x12\x32.google.cloud.dialogflow.v2.GetConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\\x12%/v2/{name=projects/*/conversations/*}Z3\x12\x31/v2/{name=projects/*/locations/*/conversations/*}\x12\xfd\x01\n\x14\x43ompleteConversation\x12\x37.google.cloud.dialogflow.v2.CompleteConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\"./v2/{name=projects/*/conversations/*}:complete:\x01*Z?\":/v2/{name=projects/*/locations/*/conversations/*}:complete:\x01*\x12\x92\x02\n\x17IngestContextReferences\x12:.google.cloud.dialogflow.v2.IngestContextReferencesRequest\x1a;.google.cloud.dialogflow.v2.IngestContextReferencesResponse\"~\xda\x41\x1f\x63onversation,context_references\x82\xd3\xe4\x93\x02V\"Q/v2/{conversation=projects/*/locations/*/conversations/*}:ingestContextReferences:\x01*\x12\xf5\x01\n\x0cListMessages\x12/.google.cloud.dialogflow.v2.ListMessagesRequest\x1a\x30.google.cloud.dialogflow.v2.ListMessagesResponse\"\x81\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02r\x12\x30/v2/{parent=projects/*/conversations/*}/messagesZ>\x12.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse\"\xd6\x01\xda\x41\x0c\x63onversation\x82\xd3\xe4\x93\x02\xc0\x01\"T/v2/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary:\x01*Ze\"`/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary:\x01*\x12\xdd\x02\n\x18GenerateStatelessSummary\x12;.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest\x1a<.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse\"\xc5\x01\x82\xd3\xe4\x93\x02\xbe\x01\"S/v2/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary:\x01*Zd\"_/v2/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary:\x01*\x12\xeb\x01\n\x1bGenerateStatelessSuggestion\x12>.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest\x1a?.google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse\"K\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate:\x01*\x12\xae\x03\n\x0fSearchKnowledge\x12\x32.google.cloud.dialogflow.v2.SearchKnowledgeRequest\x1a\x33.google.cloud.dialogflow.v2.SearchKnowledgeResponse\"\xb1\x02\x82\xd3\xe4\x93\x02\xaa\x02\"3/v2/{parent=projects/*}/suggestions:searchKnowledge:\x01*ZD\"?/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge:\x01*ZN\"I/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge:\x01*ZZ\"U/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge:\x01*\x12\xbb\x02\n\x13GenerateSuggestions\x12\x36.google.cloud.dialogflow.v2.GenerateSuggestionsRequest\x1a\x37.google.cloud.dialogflow.v2.GenerateSuggestionsResponse\"\xb2\x01\xda\x41\x0c\x63onversation\x82\xd3\xe4\x93\x02\x9c\x01\"B/v2/{conversation=projects/*/conversations/*}/suggestions:generate:\x01*ZS\"N/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:generate:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xbd\x03\n\x1e\x63om.google.cloud.dialogflow.v2B\x11\x43onversationProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\x12?projects/{project}/locations/{location}/dataStores/{data_store}\xea\x41Z\n\x17\x63\x65s.googleapis.com/Tool\x12?projects/{project}/locations/{location}/apps/{app}/tools/{tool}b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb index 4cf32203020d..b77e7d6ecac1 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb @@ -18,7 +18,7 @@ require 'google/protobuf/timestamp_pb' -descriptor_data = "\n5google/cloud/dialogflow/v2/conversation_profile.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd9\t\n\x13\x43onversationProfile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x16\x61utomated_agent_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.AutomatedAgentConfig\x12[\n\x1chuman_agent_assistant_config\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.HumanAgentAssistantConfig\x12W\n\x1ahuman_agent_handoff_config\x18\x05 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.HumanAgentHandoffConfig\x12K\n\x13notification_config\x18\x06 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12\x41\n\x0elogging_config\x18\x07 \x01(\x0b\x32).google.cloud.dialogflow.v2.LoggingConfig\x12]\n%new_message_event_notification_config\x18\x08 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12g\n*new_recognition_result_notification_config\x18\x15 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfigB\x03\xe0\x41\x01\x12\x42\n\nstt_config\x18\t \x01(\x0b\x32..google.cloud.dialogflow.v2.SpeechToTextConfig\x12\x15\n\rlanguage_code\x18\n \x01(\t\x12\x11\n\ttime_zone\x18\x0e \x01(\t\x12L\n\x11security_settings\x18\r \x01(\tB1\xfa\x41.\n,dialogflow.googleapis.com/CXSecuritySettings\x12\x46\n\ntts_config\x18\x12 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig:\xc8\x01\xea\x41\xc4\x01\n-dialogflow.googleapis.com/ConversationProfile\x12>projects/{project}/conversationProfiles/{conversation_profile}\x12Sprojects/{project}/locations/{location}/conversationProfiles/{conversation_profile}\"\x8f\x01\n\x1fListConversationProfilesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationProfile\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8b\x01\n ListConversationProfilesResponse\x12N\n\x15\x63onversation_profiles\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfile\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"d\n\x1dGetConversationProfileRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\"\xbd\x01\n CreateConversationProfileRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationProfile\x12R\n\x14\x63onversation_profile\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\"\xac\x01\n UpdateConversationProfileRequest\x12R\n\x14\x63onversation_profile\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"g\n DeleteConversationProfileRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\"\x83\x01\n\x14\x41utomatedAgentConfig\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x33\n\x0bsession_ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xf2\x1d\n\x19HumanAgentAssistantConfig\x12K\n\x13notification_config\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12m\n\x1dhuman_agent_suggestion_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12j\n\x1a\x65nd_user_suggestion_config\x18\x04 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12l\n\x17message_analysis_config\x18\x05 \x01(\x0b\x32K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig\x1aH\n\x19SuggestionTriggerSettings\x12\x14\n\x0cno_smalltalk\x18\x01 \x01(\x08\x12\x15\n\ronly_end_user\x18\x02 \x01(\x08\x1a\xf5\x06\n\x17SuggestionFeatureConfig\x12I\n\x12suggestion_feature\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SuggestionFeature\x12%\n\x1d\x65nable_event_based_suggestion\x18\x03 \x01(\x08\x12(\n\x1b\x64isable_agent_query_logging\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x12\x33\n&enable_query_suggestion_when_no_answer\x18\x0f \x01(\x08\x42\x03\xe0\x41\x01\x12\x30\n#enable_conversation_augmented_query\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_query_suggestion_only\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_response_debug_info\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x0crai_settings\x18\x13 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.RaiSettingsB\x03\xe0\x41\x01\x12t\n\x1bsuggestion_trigger_settings\x18\n \x01(\x0b\x32O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings\x12\x61\n\x0cquery_config\x18\x06 \x01(\x0b\x32K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig\x12p\n\x19\x63onversation_model_config\x18\x07 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig\x12t\n\x1b\x63onversation_process_config\x18\x08 \x01(\x0b\x32O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig\x1a\x9d\x03\n\x10SuggestionConfig\x12\x66\n\x0f\x66\x65\x61ture_configs\x18\x02 \x03(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig\x12\"\n\x1agroup_suggestion_responses\x18\x03 \x01(\x08\x12?\n\ngenerators\x18\x04 \x03(\tB+\xe0\x41\x01\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\x38\n+disable_high_latency_features_sync_delivery\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12.\n!skip_empty_event_based_suggestion\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12-\n use_unredacted_conversation_data\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12#\n\x16\x65nable_async_tool_call\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x1a\x99\r\n\x15SuggestionQueryConfig\x12\x8b\x01\n\x1bknowledge_base_query_source\x18\x01 \x01(\x0b\x32\x64.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySourceH\x00\x12\x80\x01\n\x15\x64ocument_query_source\x18\x02 \x01(\x0b\x32_.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySourceH\x00\x12\x84\x01\n\x17\x64ialogflow_query_source\x18\x03 \x01(\x0b\x32\x61.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySourceH\x00\x12\x13\n\x0bmax_results\x18\x04 \x01(\x05\x12\x1c\n\x14\x63onfidence_threshold\x18\x05 \x01(\x02\x12\x82\x01\n\x17\x63ontext_filter_settings\x18\x07 \x01(\x0b\x32\x61.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings\x12k\n\x08sections\x18\x08 \x01(\x0b\x32T.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.SectionsB\x03\xe0\x41\x01\x12\x19\n\x0c\x63ontext_size\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x1a\x64\n\x18KnowledgeBaseQuerySource\x12H\n\x0fknowledge_bases\x18\x01 \x03(\tB/\xe0\x41\x02\xfa\x41)\n\'dialogflow.googleapis.com/KnowledgeBase\x1aT\n\x13\x44ocumentQuerySource\x12=\n\tdocuments\x18\x01 \x03(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\x1a\xbe\x02\n\x15\x44ialogflowQuerySource\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x9c\x01\n\x17human_agent_side_config\x18\x03 \x01(\x0b\x32v.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfigB\x03\xe0\x41\x01\x1aN\n\x14HumanAgentSideConfig\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x01\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x1av\n\x15\x43ontextFilterSettings\x12\x1d\n\x15\x64rop_handoff_messages\x18\x01 \x01(\x08\x12#\n\x1b\x64rop_virtual_agent_messages\x18\x02 \x01(\x08\x12\x19\n\x11\x64rop_ivr_messages\x18\x03 \x01(\x08\x1a\xa2\x02\n\x08Sections\x12w\n\rsection_types\x18\x01 \x03(\x0e\x32`.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType\"\x9c\x01\n\x0bSectionType\x12\x1c\n\x18SECTION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSITUATION\x10\x01\x12\n\n\x06\x41\x43TION\x10\x02\x12\x0e\n\nRESOLUTION\x10\x03\x12\x1b\n\x17REASON_FOR_CANCELLATION\x10\x04\x12\x19\n\x15\x43USTOMER_SATISFACTION\x10\x05\x12\x0c\n\x08\x45NTITIES\x10\x06\x42\x0e\n\x0cquery_source\x1az\n\x17\x43onversationModelConfig\x12?\n\x05model\x18\x01 \x01(\tB0\xfa\x41-\n+dialogflow.googleapis.com/ConversationModel\x12\x1e\n\x16\x62\x61seline_model_version\x18\x08 \x01(\t\x1a;\n\x19\x43onversationProcessConfig\x12\x1e\n\x16recent_sentences_count\x18\x02 \x01(\x05\x1a\x87\x01\n\x15MessageAnalysisConfig\x12 \n\x18\x65nable_entity_extraction\x18\x02 \x01(\x08\x12!\n\x19\x65nable_sentiment_analysis\x18\x03 \x01(\x08\x12)\n\x1c\x65nable_sentiment_analysis_v3\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xc4\x03\n\x17HumanAgentHandoffConfig\x12\x62\n\x12live_person_config\x18\x01 \x01(\x0b\x32\x44.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfigH\x00\x12u\n\x1csalesforce_live_agent_config\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfigH\x00\x1a/\n\x10LivePersonConfig\x12\x1b\n\x0e\x61\x63\x63ount_number\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\x8b\x01\n\x19SalesforceLiveAgentConfig\x12\x1c\n\x0forganization_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rdeployment_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tbutton_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x65ndpoint_domain\x18\x04 \x01(\tB\x03\xe0\x41\x02\x42\x0f\n\ragent_service\"\xbf\x01\n\x12NotificationConfig\x12\r\n\x05topic\x18\x01 \x01(\t\x12T\n\x0emessage_format\x18\x02 \x01(\x0e\x32<.google.cloud.dialogflow.v2.NotificationConfig.MessageFormat\"D\n\rMessageFormat\x12\x1e\n\x1aMESSAGE_FORMAT_UNSPECIFIED\x10\x00\x12\t\n\x05PROTO\x10\x01\x12\x08\n\x04JSON\x10\x02\"3\n\rLoggingConfig\x12\"\n\x1a\x65nable_stackdriver_logging\x18\x03 \x01(\x08\"\xf2\x01\n\x11SuggestionFeature\x12@\n\x04type\x18\x01 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.Type\"\x9a\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41RTICLE_SUGGESTION\x10\x01\x12\x07\n\x03\x46\x41Q\x10\x02\x12\x0f\n\x0bSMART_REPLY\x10\x03\x12\x1e\n\x1a\x43ONVERSATION_SUMMARIZATION\x10\x08\x12\x14\n\x10KNOWLEDGE_SEARCH\x10\x0e\x12\x14\n\x10KNOWLEDGE_ASSIST\x10\x0f\"\x8a\x02\n!SetSuggestionFeatureConfigRequest\x12!\n\x14\x63onversation_profile\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12u\n\x19suggestion_feature_config\x18\x03 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfigB\x03\xe0\x41\x02\"\xef\x01\n#ClearSuggestionFeatureConfigRequest\x12!\n\x14\x63onversation_profile\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\"\xa3\x02\n+SetSuggestionFeatureConfigOperationMetadata\x12\x1c\n\x14\x63onversation_profile\x18\x01 \x01(\t\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa5\x02\n-ClearSuggestionFeatureConfigOperationMetadata\x12\x1c\n\x14\x63onversation_profile\x18\x01 \x01(\t\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xb3\x14\n\x14\x43onversationProfiles\x12\x90\x02\n\x18ListConversationProfiles\x12;.google.cloud.dialogflow.v2.ListConversationProfilesRequest\x1a<.google.cloud.dialogflow.v2.ListConversationProfilesResponse\"y\xda\x41\x06parent\x82\xd3\xe4\x93\x02j\x12,/v2/{parent=projects/*}/conversationProfilesZ:\x12\x38/v2/{parent=projects/*/locations/*}/conversationProfiles\x12\xfd\x01\n\x16GetConversationProfile\x12\x39.google.cloud.dialogflow.v2.GetConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j\x12,/v2/{name=projects/*/conversationProfiles/*}Z:\x12\x38/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xc8\x02\n\x19\x43reateConversationProfile\x12<.google.cloud.dialogflow.v2.CreateConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"\xbb\x01\xda\x41\x1bparent,conversation_profile\x82\xd3\xe4\x93\x02\x96\x01\",/v2/{parent=projects/*}/conversationProfiles:\x14\x63onversation_profileZP\"8/v2/{parent=projects/*/locations/*}/conversationProfiles:\x14\x63onversation_profile\x12\xf7\x02\n\x19UpdateConversationProfile\x12<.google.cloud.dialogflow.v2.UpdateConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"\xea\x01\xda\x41 conversation_profile,update_mask\x82\xd3\xe4\x93\x02\xc0\x01\x32\x41/v2/{conversation_profile.name=projects/*/conversationProfiles/*}:\x14\x63onversation_profileZe2M/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}:\x14\x63onversation_profile\x12\xea\x01\n\x19\x44\x65leteConversationProfile\x12<.google.cloud.dialogflow.v2.DeleteConversationProfileRequest\x1a\x16.google.protobuf.Empty\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j*,/v2/{name=projects/*/conversationProfiles/*}Z:*8/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xe8\x03\n\x1aSetSuggestionFeatureConfig\x12=.google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x02\xca\x41\x42\n\x13\x43onversationProfile\x12+SetSuggestionFeatureConfigOperationMetadata\xda\x41\x14\x63onversation_profile\xda\x41?conversation_profile,participant_role,suggestion_feature_config\x82\xd3\xe4\x93\x02\xc6\x01\"W/v2/{conversation_profile=projects/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*Zh\"c/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*\x12\xf0\x03\n\x1c\x43learSuggestionFeatureConfig\x12?.google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest\x1a\x1d.google.longrunning.Operation\"\xef\x02\xca\x41\x44\n\x13\x43onversationProfile\x12-ClearSuggestionFeatureConfigOperationMetadata\xda\x41\x14\x63onversation_profile\xda\x41=conversation_profile,participant_role,suggestion_feature_type\x82\xd3\xe4\x93\x02\xca\x01\"Y/v2/{conversation_profile=projects/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*Zj\"e/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9d\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x18\x43onversationProfileProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41|\n,dialogflow.googleapis.com/CXSecuritySettings\x12Lprojects/{project}/locations/{location}/securitySettings/{security_settings}b\x06proto3" +descriptor_data = "\n5google/cloud/dialogflow/v2/conversation_profile.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\n\n\x13\x43onversationProfile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x16\x61utomated_agent_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.AutomatedAgentConfig\x12[\n\x1chuman_agent_assistant_config\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.HumanAgentAssistantConfig\x12W\n\x1ahuman_agent_handoff_config\x18\x05 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.HumanAgentHandoffConfig\x12K\n\x13notification_config\x18\x06 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12\x41\n\x0elogging_config\x18\x07 \x01(\x0b\x32).google.cloud.dialogflow.v2.LoggingConfig\x12]\n%new_message_event_notification_config\x18\x08 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12g\n*new_recognition_result_notification_config\x18\x15 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfigB\x03\xe0\x41\x01\x12\x42\n\nstt_config\x18\t \x01(\x0b\x32..google.cloud.dialogflow.v2.SpeechToTextConfig\x12\x15\n\rlanguage_code\x18\n \x01(\t\x12>\n\nsip_config\x18\x10 \x01(\x0b\x32%.google.cloud.dialogflow.v2.SipConfigB\x03\xe0\x41\x01\x12\x11\n\ttime_zone\x18\x0e \x01(\t\x12L\n\x11security_settings\x18\r \x01(\tB1\xfa\x41.\n,dialogflow.googleapis.com/CXSecuritySettings\x12\x46\n\ntts_config\x18\x12 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig:\xc8\x01\xea\x41\xc4\x01\n-dialogflow.googleapis.com/ConversationProfile\x12>projects/{project}/conversationProfiles/{conversation_profile}\x12Sprojects/{project}/locations/{location}/conversationProfiles/{conversation_profile}\"\x8f\x01\n\x1fListConversationProfilesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationProfile\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8b\x01\n ListConversationProfilesResponse\x12N\n\x15\x63onversation_profiles\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfile\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"d\n\x1dGetConversationProfileRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\"\xbd\x01\n CreateConversationProfileRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationProfile\x12R\n\x14\x63onversation_profile\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\"\xac\x01\n UpdateConversationProfileRequest\x12R\n\x14\x63onversation_profile\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"g\n DeleteConversationProfileRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\"\x83\x01\n\x14\x41utomatedAgentConfig\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x33\n\x0bsession_ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xee\x1e\n\x19HumanAgentAssistantConfig\x12K\n\x13notification_config\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12m\n\x1dhuman_agent_suggestion_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12j\n\x1a\x65nd_user_suggestion_config\x18\x04 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12l\n\x17message_analysis_config\x18\x05 \x01(\x0b\x32K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig\x1aH\n\x19SuggestionTriggerSettings\x12\x14\n\x0cno_smalltalk\x18\x01 \x01(\x08\x12\x15\n\ronly_end_user\x18\x02 \x01(\x08\x1a\xf1\x07\n\x17SuggestionFeatureConfig\x12I\n\x12suggestion_feature\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SuggestionFeature\x12%\n\x1d\x65nable_event_based_suggestion\x18\x03 \x01(\x08\x12(\n\x1b\x64isable_agent_query_logging\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x12\x33\n&enable_query_suggestion_when_no_answer\x18\x0f \x01(\x08\x42\x03\xe0\x41\x01\x12\x30\n#enable_conversation_augmented_query\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_query_suggestion_only\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_response_debug_info\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x0crai_settings\x18\x13 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.RaiSettingsB\x03\xe0\x41\x01\x12O\n\x18suggestion_trigger_event\x18\x14 \x01(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x12)\n\x1c\x64isable_query_search_context\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12t\n\x1bsuggestion_trigger_settings\x18\n \x01(\x0b\x32O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings\x12\x61\n\x0cquery_config\x18\x06 \x01(\x0b\x32K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig\x12p\n\x19\x63onversation_model_config\x18\x07 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig\x12t\n\x1b\x63onversation_process_config\x18\x08 \x01(\x0b\x32O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig\x1a\x9d\x03\n\x10SuggestionConfig\x12\x66\n\x0f\x66\x65\x61ture_configs\x18\x02 \x03(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig\x12\"\n\x1agroup_suggestion_responses\x18\x03 \x01(\x08\x12?\n\ngenerators\x18\x04 \x03(\tB+\xe0\x41\x01\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\x38\n+disable_high_latency_features_sync_delivery\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12.\n!skip_empty_event_based_suggestion\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12-\n use_unredacted_conversation_data\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12#\n\x16\x65nable_async_tool_call\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x1a\x99\r\n\x15SuggestionQueryConfig\x12\x8b\x01\n\x1bknowledge_base_query_source\x18\x01 \x01(\x0b\x32\x64.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySourceH\x00\x12\x80\x01\n\x15\x64ocument_query_source\x18\x02 \x01(\x0b\x32_.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySourceH\x00\x12\x84\x01\n\x17\x64ialogflow_query_source\x18\x03 \x01(\x0b\x32\x61.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySourceH\x00\x12\x13\n\x0bmax_results\x18\x04 \x01(\x05\x12\x1c\n\x14\x63onfidence_threshold\x18\x05 \x01(\x02\x12\x82\x01\n\x17\x63ontext_filter_settings\x18\x07 \x01(\x0b\x32\x61.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings\x12k\n\x08sections\x18\x08 \x01(\x0b\x32T.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.SectionsB\x03\xe0\x41\x01\x12\x19\n\x0c\x63ontext_size\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x1a\x64\n\x18KnowledgeBaseQuerySource\x12H\n\x0fknowledge_bases\x18\x01 \x03(\tB/\xe0\x41\x02\xfa\x41)\n\'dialogflow.googleapis.com/KnowledgeBase\x1aT\n\x13\x44ocumentQuerySource\x12=\n\tdocuments\x18\x01 \x03(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\x1a\xbe\x02\n\x15\x44ialogflowQuerySource\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x9c\x01\n\x17human_agent_side_config\x18\x03 \x01(\x0b\x32v.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfigB\x03\xe0\x41\x01\x1aN\n\x14HumanAgentSideConfig\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x01\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x1av\n\x15\x43ontextFilterSettings\x12\x1d\n\x15\x64rop_handoff_messages\x18\x01 \x01(\x08\x12#\n\x1b\x64rop_virtual_agent_messages\x18\x02 \x01(\x08\x12\x19\n\x11\x64rop_ivr_messages\x18\x03 \x01(\x08\x1a\xa2\x02\n\x08Sections\x12w\n\rsection_types\x18\x01 \x03(\x0e\x32`.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType\"\x9c\x01\n\x0bSectionType\x12\x1c\n\x18SECTION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSITUATION\x10\x01\x12\n\n\x06\x41\x43TION\x10\x02\x12\x0e\n\nRESOLUTION\x10\x03\x12\x1b\n\x17REASON_FOR_CANCELLATION\x10\x04\x12\x19\n\x15\x43USTOMER_SATISFACTION\x10\x05\x12\x0c\n\x08\x45NTITIES\x10\x06\x42\x0e\n\x0cquery_source\x1az\n\x17\x43onversationModelConfig\x12?\n\x05model\x18\x01 \x01(\tB0\xfa\x41-\n+dialogflow.googleapis.com/ConversationModel\x12\x1e\n\x16\x62\x61seline_model_version\x18\x08 \x01(\t\x1a;\n\x19\x43onversationProcessConfig\x12\x1e\n\x16recent_sentences_count\x18\x02 \x01(\x05\x1a\x87\x01\n\x15MessageAnalysisConfig\x12 \n\x18\x65nable_entity_extraction\x18\x02 \x01(\x08\x12!\n\x19\x65nable_sentiment_analysis\x18\x03 \x01(\x08\x12)\n\x1c\x65nable_sentiment_analysis_v3\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xc4\x03\n\x17HumanAgentHandoffConfig\x12\x62\n\x12live_person_config\x18\x01 \x01(\x0b\x32\x44.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfigH\x00\x12u\n\x1csalesforce_live_agent_config\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfigH\x00\x1a/\n\x10LivePersonConfig\x12\x1b\n\x0e\x61\x63\x63ount_number\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\x8b\x01\n\x19SalesforceLiveAgentConfig\x12\x1c\n\x0forganization_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rdeployment_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tbutton_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x65ndpoint_domain\x18\x04 \x01(\tB\x03\xe0\x41\x02\x42\x0f\n\ragent_service\"\xbf\x01\n\x12NotificationConfig\x12\r\n\x05topic\x18\x01 \x01(\t\x12T\n\x0emessage_format\x18\x02 \x01(\x0e\x32<.google.cloud.dialogflow.v2.NotificationConfig.MessageFormat\"D\n\rMessageFormat\x12\x1e\n\x1aMESSAGE_FORMAT_UNSPECIFIED\x10\x00\x12\t\n\x05PROTO\x10\x01\x12\x08\n\x04JSON\x10\x02\"3\n\rLoggingConfig\x12\"\n\x1a\x65nable_stackdriver_logging\x18\x03 \x01(\x08\"\xa8\x02\n\tSipConfig\x12&\n\x1e\x63reate_conversation_on_the_fly\x18\x01 \x01(\x08\x12\x16\n\x0einactive_start\x18\x03 \x01(\x08\x12?\n\x1cmax_audio_recording_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\'\n\x1f\x61llow_virtual_agent_interaction\x18\x05 \x01(\x08\x12!\n\x19keep_conversation_running\x18\x06 \x01(\x08\x12%\n\x1d\x63opy_inbound_call_leg_headers\x18\x08 \x03(\t\x12\'\n\x1fignore_reinvite_media_direction\x18\t \x01(\x08\"\xf2\x01\n\x11SuggestionFeature\x12@\n\x04type\x18\x01 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.Type\"\x9a\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41RTICLE_SUGGESTION\x10\x01\x12\x07\n\x03\x46\x41Q\x10\x02\x12\x0f\n\x0bSMART_REPLY\x10\x03\x12\x1e\n\x1a\x43ONVERSATION_SUMMARIZATION\x10\x08\x12\x14\n\x10KNOWLEDGE_SEARCH\x10\x0e\x12\x14\n\x10KNOWLEDGE_ASSIST\x10\x0f\"\x8a\x02\n!SetSuggestionFeatureConfigRequest\x12!\n\x14\x63onversation_profile\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12u\n\x19suggestion_feature_config\x18\x03 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfigB\x03\xe0\x41\x02\"\xef\x01\n#ClearSuggestionFeatureConfigRequest\x12!\n\x14\x63onversation_profile\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\"\xa3\x02\n+SetSuggestionFeatureConfigOperationMetadata\x12\x1c\n\x14\x63onversation_profile\x18\x01 \x01(\t\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa5\x02\n-ClearSuggestionFeatureConfigOperationMetadata\x12\x1c\n\x14\x63onversation_profile\x18\x01 \x01(\t\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xb3\x14\n\x14\x43onversationProfiles\x12\x90\x02\n\x18ListConversationProfiles\x12;.google.cloud.dialogflow.v2.ListConversationProfilesRequest\x1a<.google.cloud.dialogflow.v2.ListConversationProfilesResponse\"y\xda\x41\x06parent\x82\xd3\xe4\x93\x02j\x12,/v2/{parent=projects/*}/conversationProfilesZ:\x12\x38/v2/{parent=projects/*/locations/*}/conversationProfiles\x12\xfd\x01\n\x16GetConversationProfile\x12\x39.google.cloud.dialogflow.v2.GetConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j\x12,/v2/{name=projects/*/conversationProfiles/*}Z:\x12\x38/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xc8\x02\n\x19\x43reateConversationProfile\x12<.google.cloud.dialogflow.v2.CreateConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"\xbb\x01\xda\x41\x1bparent,conversation_profile\x82\xd3\xe4\x93\x02\x96\x01\",/v2/{parent=projects/*}/conversationProfiles:\x14\x63onversation_profileZP\"8/v2/{parent=projects/*/locations/*}/conversationProfiles:\x14\x63onversation_profile\x12\xf7\x02\n\x19UpdateConversationProfile\x12<.google.cloud.dialogflow.v2.UpdateConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"\xea\x01\xda\x41 conversation_profile,update_mask\x82\xd3\xe4\x93\x02\xc0\x01\x32\x41/v2/{conversation_profile.name=projects/*/conversationProfiles/*}:\x14\x63onversation_profileZe2M/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}:\x14\x63onversation_profile\x12\xea\x01\n\x19\x44\x65leteConversationProfile\x12<.google.cloud.dialogflow.v2.DeleteConversationProfileRequest\x1a\x16.google.protobuf.Empty\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j*,/v2/{name=projects/*/conversationProfiles/*}Z:*8/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xe8\x03\n\x1aSetSuggestionFeatureConfig\x12=.google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x02\xca\x41\x42\n\x13\x43onversationProfile\x12+SetSuggestionFeatureConfigOperationMetadata\xda\x41\x14\x63onversation_profile\xda\x41?conversation_profile,participant_role,suggestion_feature_config\x82\xd3\xe4\x93\x02\xc6\x01\"W/v2/{conversation_profile=projects/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*Zh\"c/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*\x12\xf0\x03\n\x1c\x43learSuggestionFeatureConfig\x12?.google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest\x1a\x1d.google.longrunning.Operation\"\xef\x02\xca\x41\x44\n\x13\x43onversationProfile\x12-ClearSuggestionFeatureConfigOperationMetadata\xda\x41\x14\x63onversation_profile\xda\x41=conversation_profile,participant_role,suggestion_feature_type\x82\xd3\xe4\x93\x02\xca\x01\"Y/v2/{conversation_profile=projects/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*Zj\"e/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9d\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x18\x43onversationProfileProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41|\n,dialogflow.googleapis.com/CXSecuritySettings\x12Lprojects/{project}/locations/{location}/securitySettings/{security_settings}b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) @@ -56,6 +56,7 @@ module V2 NotificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.NotificationConfig").msgclass NotificationConfig::MessageFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.NotificationConfig.MessageFormat").enummodule LoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.LoggingConfig").msgclass + SipConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SipConfig").msgclass SuggestionFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionFeature").msgclass SuggestionFeature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionFeature.Type").enummodule SetSuggestionFeatureConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest").msgclass diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb index 8394743ebd2b..87b3df01c38b 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb @@ -17,7 +17,7 @@ require 'google/rpc/status_pb' -descriptor_data = "\n,google/cloud/dialogflow/v2/participant.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf8\x06\n\x0bParticipant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12?\n\x04role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x05\x12&\n\x19sip_recording_media_label\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12(\n\x1bobfuscated_external_user_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12n\n\x1a\x64ocuments_metadata_filters\x18\x08 \x03(\x0b\x32\x45.google.cloud.dialogflow.v2.Participant.DocumentsMetadataFiltersEntryB\x03\xe0\x41\x01\x12]\n\x14\x61gent_desktop_source\x18\n \x01(\x0e\x32:.google.cloud.dialogflow.v2.Participant.AgentDesktopSourceB\x03\xe0\x41\x01\x1a?\n\x1d\x44ocumentsMetadataFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"P\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHUMAN_AGENT\x10\x01\x12\x13\n\x0f\x41UTOMATED_AGENT\x10\x02\x12\x0c\n\x08\x45ND_USER\x10\x03\"\x85\x01\n\x12\x41gentDesktopSource\x12$\n AGENT_DESKTOP_SOURCE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bLIVE_PERSON\x10\x01\x12\x11\n\rGENESYS_CLOUD\x10\x02\x12\n\n\x06TWILIO\x10\x03\x12\x0e\n\nSALESFORCE\x10\x04\x12\t\n\x05OTHER\x10\x08:\xd8\x01\xea\x41\xd4\x01\n%dialogflow.googleapis.com/Participant\x12Jprojects/{project}/conversations/{conversation}/participants/{participant}\x12_projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}\"\x8c\x05\n\x07Message\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bparticipant\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12K\n\x10participant_role\x18\x05 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x32\n\tsend_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12N\n\x12message_annotation\x18\x07 \x01(\x0b\x32-.google.cloud.dialogflow.v2.MessageAnnotationB\x03\xe0\x41\x03\x12T\n\x12sentiment_analysis\x18\x08 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SentimentAnalysisResultB\x03\xe0\x41\x03:\xc4\x01\xea\x41\xc0\x01\n!dialogflow.googleapis.com/Message\x12\x42projects/{project}/conversations/{conversation}/messages/{message}\x12Wprojects/{project}/locations/{location}/conversations/{conversation}/messages/{message}\"\x9c\x01\n\x18\x43reateParticipantRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Participant\x12\x41\n\x0bparticipant\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.ParticipantB\x03\xe0\x41\x02\"T\n\x15GetParticipantRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\"\x89\x01\n\x17ListParticipantsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Participant\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\"r\n\x18ListParticipantsResponse\x12=\n\x0cparticipants\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.v2.Participant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x93\x01\n\x18UpdateParticipantRequest\x12\x41\n\x0bparticipant\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.ParticipantB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x8a\x05\n\x15\x41nalyzeContentRequest\x12\x42\n\x0bparticipant\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12;\n\ntext_input\x18\x06 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputH\x00\x12=\n\x0b\x61udio_input\x18\x07 \x01(\x0b\x32&.google.cloud.dialogflow.v2.AudioInputH\x00\x12=\n\x0b\x65vent_input\x18\x08 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInputH\x00\x12G\n\x10suggestion_input\x18\x0c \x01(\x0b\x32+.google.cloud.dialogflow.v2.SuggestionInputH\x00\x12I\n\x12reply_audio_config\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x41\n\x0cquery_params\x18\t \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12N\n\x13\x61ssist_query_params\x18\x0e \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\n\rcx_parameters\x18\x12 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\nrequest_id\x18\x0b \x01(\tB\x07\n\x05input\",\n\x0e\x44tmfParameters\x12\x1a\n\x12\x61\x63\x63\x65pts_dtmf_input\x18\x01 \x01(\x08\"\xde\x03\n\x16\x41nalyzeContentResponse\x12\x12\n\nreply_text\x18\x01 \x01(\t\x12<\n\x0breply_audio\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.OutputAudio\x12N\n\x15\x61utomated_agent_reply\x18\x03 \x01(\x0b\x32/.google.cloud.dialogflow.v2.AutomatedAgentReply\x12\x34\n\x07message\x18\x05 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12T\n\x1ehuman_agent_suggestion_results\x18\x06 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\n\x1b\x65nd_user_suggestion_results\x18\x07 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12\x43\n\x0f\x64tmf_parameters\x18\t \x01(\x0b\x32*.google.cloud.dialogflow.v2.DtmfParameters\"\xa6\x06\n\x1eStreamingAnalyzeContentRequest\x12\x42\n\x0bparticipant\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x44\n\x0c\x61udio_config\x18\x02 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigH\x00\x12\x42\n\x0btext_config\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.v2.InputTextConfigH\x00\x12I\n\x12reply_audio_config\x18\x04 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x15\n\x0binput_audio\x18\x05 \x01(\x0cH\x01\x12\x14\n\ninput_text\x18\x06 \x01(\tH\x01\x12\x45\n\ninput_dtmf\x18\t \x01(\x0b\x32/.google.cloud.dialogflow.v2.TelephonyDtmfEventsH\x01\x12\x41\n\x0cquery_params\x18\x07 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12N\n\x13\x61ssist_query_params\x18\x08 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\n\rcx_parameters\x18\r \x01(\x0b\x32\x17.google.protobuf.Struct\x12&\n\x19\x65nable_extended_streaming\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12\x31\n$enable_partial_automated_agent_reply\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1aoutput_multiple_utterances\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x15\x65nable_debugging_info\x18\x13 \x01(\x08\x42\x08\n\x06\x63onfigB\x07\n\x05input\"\xa5\x05\n\x1fStreamingAnalyzeContentResponse\x12R\n\x12recognition_result\x18\x01 \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.StreamingRecognitionResult\x12\x12\n\nreply_text\x18\x02 \x01(\t\x12<\n\x0breply_audio\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.OutputAudio\x12N\n\x15\x61utomated_agent_reply\x18\x04 \x01(\x0b\x32/.google.cloud.dialogflow.v2.AutomatedAgentReply\x12\x34\n\x07message\x18\x06 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12T\n\x1ehuman_agent_suggestion_results\x18\x07 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\n\x1b\x65nd_user_suggestion_results\x18\x08 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12\x43\n\x0f\x64tmf_parameters\x18\n \x01(\x0b\x32*.google.cloud.dialogflow.v2.DtmfParameters\x12R\n\x0e\x64\x65\x62ugging_info\x18\x0b \x01(\x0b\x32:.google.cloud.dialogflow.v2.CloudConversationDebuggingInfo\x12\x14\n\x0cspeech_model\x18\r \x01(\t\"\x85\x02\n\x16SuggestArticlesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12N\n\x13\x61ssist_query_params\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\"\x8b\x01\n\x17SuggestArticlesResponse\x12\x42\n\x0f\x61rticle_answers\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.v2.ArticleAnswer\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\x87\x02\n\x18SuggestFaqAnswersRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12N\n\x13\x61ssist_query_params\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\"\x85\x01\n\x19SuggestFaqAnswersResponse\x12:\n\x0b\x66\x61q_answers\x18\x01 \x03(\x0b\x32%.google.cloud.dialogflow.v2.FaqAnswer\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\xa1\x03\n\x1bGenerateSuggestionsResponse\x12w\n\x1cgenerator_suggestion_answers\x18\x01 \x03(\x0b\x32Q.google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x1a\xc8\x01\n\x19GeneratorSuggestionAnswer\x12M\n\x14generator_suggestion\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestion\x12\x18\n\x10source_generator\x18\x02 \x01(\t\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\"\xf4\x01\n\x1aSuggestSmartRepliesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x12\x63urrent_text_input\x18\x04 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInput\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\xc3\x01\n\x1bSuggestSmartRepliesResponse\x12N\n\x13smart_reply_answers\x18\x01 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SmartReplyAnswerB\x03\xe0\x41\x03\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"c\n\nAudioInput\x12\x41\n\x06\x63onfig\x18\x01 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigB\x03\xe0\x41\x02\x12\x12\n\x05\x61udio\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"[\n\x0bOutputAudio\x12=\n\x06\x63onfig\x18\x01 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\r\n\x05\x61udio\x18\x02 \x01(\x0c\"\xe8\x02\n\x13\x41utomatedAgentReply\x12P\n\x16\x64\x65tect_intent_response\x18\x01 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.DetectIntentResponse\x12k\n\x1a\x61utomated_agent_reply_type\x18\x07 \x01(\x0e\x32G.google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType\x12\x1a\n\x12\x61llow_cancellation\x18\x08 \x01(\x08\x12\x17\n\x0f\x63x_current_page\x18\x0b \x01(\t\"]\n\x17\x41utomatedAgentReplyType\x12*\n&AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PARTIAL\x10\x01\x12\t\n\x05\x46INAL\x10\x02\"\xe4\x01\n\rArticleAnswer\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08snippets\x18\x03 \x03(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12I\n\x08metadata\x18\x05 \x03(\x0b\x32\x37.google.cloud.dialogflow.v2.ArticleAnswer.MetadataEntry\x12\x15\n\ranswer_record\x18\x06 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe0\x01\n\tFaqAnswer\x12\x0e\n\x06\x61nswer\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x10\n\x08question\x18\x03 \x01(\t\x12\x0e\n\x06source\x18\x04 \x01(\t\x12\x45\n\x08metadata\x18\x05 \x03(\x0b\x32\x33.google.cloud.dialogflow.v2.FaqAnswer.MetadataEntry\x12\x15\n\ranswer_record\x18\x06 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x10SmartReplyAnswer\x12\r\n\x05reply\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\"\\\n\x10IntentSuggestion\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\tintent_v2\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x08\n\x06intent\"\xc5\x01\n\x16\x44ialogflowAssistAnswer\x12?\n\x0cquery_result\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResultH\x00\x12I\n\x11intent_suggestion\x18\x05 \x01(\x0b\x32,.google.cloud.dialogflow.v2.IntentSuggestionH\x00\x12\x15\n\ranswer_record\x18\x02 \x01(\tB\x08\n\x06result\"\xb5\x04\n\x10SuggestionResult\x12#\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x12X\n\x19suggest_articles_response\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SuggestArticlesResponseH\x00\x12g\n!suggest_knowledge_assist_response\x18\x08 \x01(\x0b\x32:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponseH\x00\x12]\n\x1csuggest_faq_answers_response\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.SuggestFaqAnswersResponseH\x00\x12\x61\n\x1esuggest_smart_replies_response\x18\x04 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.SuggestSmartRepliesResponseH\x00\x12`\n\x1dgenerate_suggestions_response\x18\t \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.GenerateSuggestionsResponseH\x00\x42\x15\n\x13suggestion_response\"-\n\x0fInputTextConfig\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\"j\n\x14\x41nnotatedMessagePart\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x13\n\x0b\x65ntity_type\x18\x02 \x01(\t\x12/\n\x0f\x66ormatted_value\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\"n\n\x11MessageAnnotation\x12?\n\x05parts\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.v2.AnnotatedMessagePart\x12\x18\n\x10\x63ontain_entities\x18\x02 \x01(\x08\"\xa3\x02\n\x0fSuggestionInput\x12\x1a\n\ranswer_record\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x30\n\nparameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12G\n\x06\x61\x63tion\x18\x05 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionInput.ActionB\x03\xe0\x41\x01\x12\x32\n\tsend_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"E\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\n\n\x06\x43\x41NCEL\x10\x01\x12\n\n\x06REVISE\x10\x02\x12\x0b\n\x07\x43ONFIRM\x10\x03\"\xcd\x01\n\x15\x41ssistQueryParameters\x12s\n\x1a\x64ocuments_metadata_filters\x18\x01 \x03(\x0b\x32O.google.cloud.dialogflow.v2.AssistQueryParameters.DocumentsMetadataFiltersEntry\x1a?\n\x1d\x44ocumentsMetadataFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe3\x01\n\x1dSuggestKnowledgeAssistRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12%\n\x18previous_suggested_query\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xa7\x01\n\x1eSuggestKnowledgeAssistResponse\x12W\n\x17knowledge_assist_answer\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.KnowledgeAssistAnswerB\x03\xe0\x41\x03\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\xb9\x05\n!IngestedContextReferenceDebugInfo\x12\x1f\n\x17project_not_allowlisted\x18\x01 \x01(\x08\x12#\n\x1b\x63ontext_reference_retrieved\x18\x02 \x01(\x08\x12\x80\x01\n\x1eingested_parameters_debug_info\x18\x03 \x03(\x0b\x32X.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo\x1a\xca\x03\n\x1aIngestedParameterDebugInfo\x12\x11\n\tparameter\x18\x01 \x01(\t\x12\x82\x01\n\x10ingestion_status\x18\x02 \x01(\x0e\x32h.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus\"\x93\x02\n\x0fIngestionStatus\x12 \n\x1cINGESTION_STATUS_UNSPECIFIED\x10\x00\x12\x1e\n\x1aINGESTION_STATUS_SUCCEEDED\x10\x01\x12*\n&INGESTION_STATUS_CONTEXT_NOT_AVAILABLE\x10\x02\x12!\n\x1dINGESTION_STATUS_PARSE_FAILED\x10\x03\x12\"\n\x1eINGESTION_STATUS_INVALID_ENTRY\x10\x04\x12#\n\x1fINGESTION_STATUS_INVALID_FORMAT\x10\x05\x12&\n\"INGESTION_STATUS_LANGUAGE_MISMATCH\x10\x06\"\x97\x02\n\x0eServiceLatency\x12\x65\n\x1ainternal_service_latencies\x18\x01 \x03(\x0b\x32\x41.google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency\x1a\x9d\x01\n\x16InternalServiceLatency\x12\x0c\n\x04step\x18\x01 \x01(\t\x12\x12\n\nlatency_ms\x18\x02 \x01(\x02\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rcomplete_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xf4\x0f\n\x18KnowledgeAssistDebugInfo\x12z\n\x1fquery_generation_failure_reason\x18\x01 \x01(\x0e\x32Q.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason\x12\x82\x01\n#query_categorization_failure_reason\x18\x02 \x01(\x0e\x32U.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason\x12V\n\x19\x64\x61tastore_response_reason\x18\x03 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\n\x19knowledge_assist_behavior\x18\x04 \x01(\x0b\x32L.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior\x12l\n%ingested_context_reference_debug_info\x18\x05 \x01(\x0b\x32=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12\x43\n\x0fservice_latency\x18\x06 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ServiceLatency\x1a\xb9\x05\n\x17KnowledgeAssistBehavior\x12%\n\x1d\x61nswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\n\x1a\x65nd_user_metadata_included\x18\x02 \x01(\x08\x12\x19\n\x11return_query_only\x18\x04 \x01(\x08\x12\x1b\n\x13use_pubsub_delivery\x18\x05 \x01(\x08\x12\x1d\n\x15\x64isable_sync_delivery\x18\x06 \x01(\x08\x12!\n\x19previous_queries_included\x18\x07 \x01(\x08\x12\x1e\n\x16use_translated_message\x18\x08 \x01(\x08\x12&\n\x1euse_custom_safety_filter_level\x18\t \x01(\x08\x12\x33\n+conversation_transcript_has_mixed_languages\x18\n \x01(\x08\x12\x30\n(query_generation_agent_language_mismatch\x18\x0b \x01(\x08\x12\x33\n+query_generation_end_user_language_mismatch\x18\x0c \x01(\x08\x12%\n\x1dthird_party_connector_allowed\x18\r \x01(\x08\x12\"\n\x1amultiple_queries_generated\x18\x0e \x01(\x08\x12&\n\x1equery_contained_search_context\x18\x0f \x01(\x08\x12.\n&invalid_items_query_suggestion_skipped\x18\x10 \x01(\x08\x12+\n#primary_query_redacted_and_replaced\x18\x11 \x01(\x08\x12%\n\x1d\x61ppended_search_context_count\x18\x12 \x01(\x05\"\xcf\x03\n\x1cQueryGenerationFailureReason\x12/\n+QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12!\n\x1dQUERY_GENERATION_OUT_OF_QUOTA\x10\x01\x12\x1b\n\x17QUERY_GENERATION_FAILED\x10\x02\x12\'\n#QUERY_GENERATION_NO_QUERY_GENERATED\x10\x03\x12\x1f\n\x1bQUERY_GENERATION_RAI_FAILED\x10\x04\x12\x14\n\x10NOT_IN_ALLOWLIST\x10\x05\x12#\n\x1fQUERY_GENERATION_QUERY_REDACTED\x10\x06\x12.\n*QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED\x10\n\x12\'\n#QUERY_GENERATION_EMPTY_CONVERSATION\x10\x0b\x12\'\n#QUERY_GENERATION_EMPTY_LAST_MESSAGE\x10\x0c\x12\x37\n3QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET\x10\r\"\xcc\x01\n QueryCategorizationFailureReason\x12\x33\n/QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12\'\n#QUERY_CATEGORIZATION_INVALID_CONFIG\x10\x01\x12)\n%QUERY_CATEGORIZATION_RESULT_NOT_FOUND\x10\x02\x12\x1f\n\x1bQUERY_CATEGORIZATION_FAILED\x10\x03\"\xf6\x06\n\x15KnowledgeAssistAnswer\x12Y\n\x0fsuggested_query\x18\x01 \x01(\x0b\x32@.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery\x12\x61\n\x16suggested_query_answer\x18\x02 \x01(\x0b\x32\x41.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer\x12\x15\n\ranswer_record\x18\x03 \x01(\t\x12Y\n\x1bknowledge_assist_debug_info\x18\x07 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo\x1a$\n\x0eSuggestedQuery\x12\x12\n\nquery_text\x18\x01 \x01(\t\x1a\x86\x04\n\x0fKnowledgeAnswer\x12\x13\n\x0b\x61nswer_text\x18\x01 \x01(\t\x12\x61\n\nfaq_source\x18\x03 \x01(\x0b\x32K.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceH\x00\x12o\n\x11generative_source\x18\x04 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\x00\x1a\x1d\n\tFaqSource\x12\x10\n\x08question\x18\x02 \x01(\t\x1a\xe0\x01\n\x10GenerativeSource\x12l\n\x08snippets\x18\x01 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet\x1a^\n\x07Snippet\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\r\n\x05title\x18\x04 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructB\x08\n\x06source*\xd6\x02\n\x17\x44\x61tastoreResponseReason\x12)\n%DATASTORE_RESPONSE_REASON_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x17\n\x13SEARCH_OUT_OF_QUOTA\x10\x02\x12\x18\n\x14SEARCH_EMPTY_RESULTS\x10\x03\x12%\n!ANSWER_GENERATION_GEN_AI_DISABLED\x10\x04\x12\"\n\x1e\x41NSWER_GENERATION_OUT_OF_QUOTA\x10\x05\x12\x1b\n\x17\x41NSWER_GENERATION_ERROR\x10\x06\x12%\n!ANSWER_GENERATION_NOT_ENOUGH_INFO\x10\x07\x12 \n\x1c\x41NSWER_GENERATION_RAI_FAILED\x10\x08\x12\"\n\x1e\x41NSWER_GENERATION_NOT_GROUNDED\x10\t2\xfa\x18\n\x0cParticipants\x12\xa5\x02\n\x11\x43reateParticipant\x12\x34.google.cloud.dialogflow.v2.CreateParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\xb0\x01\xda\x41\x12parent,participant\x82\xd3\xe4\x93\x02\x94\x01\"4/v2/{parent=projects/*/conversations/*}/participants:\x0bparticipantZO\"@/v2/{parent=projects/*/locations/*/conversations/*}/participants:\x0bparticipant\x12\xf6\x01\n\x0eGetParticipant\x12\x31.google.cloud.dialogflow.v2.GetParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\x12\x34/v2/{name=projects/*/conversations/*/participants/*}ZB\x12@/v2/{name=projects/*/locations/*/conversations/*/participants/*}\x12\x89\x02\n\x10ListParticipants\x12\x33.google.cloud.dialogflow.v2.ListParticipantsRequest\x1a\x34.google.cloud.dialogflow.v2.ListParticipantsResponse\"\x89\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02z\x12\x34/v2/{parent=projects/*/conversations/*}/participantsZB\x12@/v2/{parent=projects/*/locations/*/conversations/*}/participants\x12\xc2\x02\n\x11UpdateParticipant\x12\x34.google.cloud.dialogflow.v2.UpdateParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\xcd\x01\xda\x41\x17participant,update_mask\x82\xd3\xe4\x93\x02\xac\x01\x32@/v2/{participant.name=projects/*/conversations/*/participants/*}:\x0bparticipantZ[2L/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}:\x0bparticipant\x12\xfa\x02\n\x0e\x41nalyzeContent\x12\x31.google.cloud.dialogflow.v2.AnalyzeContentRequest\x1a\x32.google.cloud.dialogflow.v2.AnalyzeContentResponse\"\x80\x02\xda\x41\x16participant,text_input\xda\x41\x17participant,event_input\xda\x41\x17participant,audio_input\x82\xd3\xe4\x93\x02\xac\x01\"J/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent:\x01*Z[\"V/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent:\x01*\x12\x98\x01\n\x17StreamingAnalyzeContent\x12:.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest\x1a;.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse\"\x00(\x01\x30\x01\x12\xc9\x02\n\x0fSuggestArticles\x12\x32.google.cloud.dialogflow.v2.SuggestArticlesRequest\x1a\x33.google.cloud.dialogflow.v2.SuggestArticlesResponse\"\xcc\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xbc\x01\"R/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*Zc\"^/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*\x12\xd3\x02\n\x11SuggestFaqAnswers\x12\x34.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest\x1a\x35.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse\"\xd0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xc0\x01\"T/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*Ze\"`/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*\x12\xdd\x02\n\x13SuggestSmartReplies\x12\x36.google.cloud.dialogflow.v2.SuggestSmartRepliesRequest\x1a\x37.google.cloud.dialogflow.v2.SuggestSmartRepliesResponse\"\xd4\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xc4\x01\"V/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*Zg\"b/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*\x12\xe3\x02\n\x16SuggestKnowledgeAssist\x12\x39.google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest\x1a:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse\"\xd1\x01\x82\xd3\xe4\x93\x02\xca\x01\"Y/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*Zj\"e/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x10ParticipantProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" +descriptor_data = "\n,google/cloud/dialogflow/v2/participant.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf8\x06\n\x0bParticipant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12?\n\x04role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x05\x12&\n\x19sip_recording_media_label\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12(\n\x1bobfuscated_external_user_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12n\n\x1a\x64ocuments_metadata_filters\x18\x08 \x03(\x0b\x32\x45.google.cloud.dialogflow.v2.Participant.DocumentsMetadataFiltersEntryB\x03\xe0\x41\x01\x12]\n\x14\x61gent_desktop_source\x18\n \x01(\x0e\x32:.google.cloud.dialogflow.v2.Participant.AgentDesktopSourceB\x03\xe0\x41\x01\x1a?\n\x1d\x44ocumentsMetadataFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"P\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHUMAN_AGENT\x10\x01\x12\x13\n\x0f\x41UTOMATED_AGENT\x10\x02\x12\x0c\n\x08\x45ND_USER\x10\x03\"\x85\x01\n\x12\x41gentDesktopSource\x12$\n AGENT_DESKTOP_SOURCE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bLIVE_PERSON\x10\x01\x12\x11\n\rGENESYS_CLOUD\x10\x02\x12\n\n\x06TWILIO\x10\x03\x12\x0e\n\nSALESFORCE\x10\x04\x12\t\n\x05OTHER\x10\x08:\xd8\x01\xea\x41\xd4\x01\n%dialogflow.googleapis.com/Participant\x12Jprojects/{project}/conversations/{conversation}/participants/{participant}\x12_projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}\"\x8c\x05\n\x07Message\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bparticipant\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12K\n\x10participant_role\x18\x05 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x32\n\tsend_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12N\n\x12message_annotation\x18\x07 \x01(\x0b\x32-.google.cloud.dialogflow.v2.MessageAnnotationB\x03\xe0\x41\x03\x12T\n\x12sentiment_analysis\x18\x08 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SentimentAnalysisResultB\x03\xe0\x41\x03:\xc4\x01\xea\x41\xc0\x01\n!dialogflow.googleapis.com/Message\x12\x42projects/{project}/conversations/{conversation}/messages/{message}\x12Wprojects/{project}/locations/{location}/conversations/{conversation}/messages/{message}\"\x9c\x01\n\x18\x43reateParticipantRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Participant\x12\x41\n\x0bparticipant\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.ParticipantB\x03\xe0\x41\x02\"T\n\x15GetParticipantRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\"\x89\x01\n\x17ListParticipantsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Participant\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\"r\n\x18ListParticipantsResponse\x12=\n\x0cparticipants\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.v2.Participant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x93\x01\n\x18UpdateParticipantRequest\x12\x41\n\x0bparticipant\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.ParticipantB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x8a\x05\n\x15\x41nalyzeContentRequest\x12\x42\n\x0bparticipant\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12;\n\ntext_input\x18\x06 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputH\x00\x12=\n\x0b\x61udio_input\x18\x07 \x01(\x0b\x32&.google.cloud.dialogflow.v2.AudioInputH\x00\x12=\n\x0b\x65vent_input\x18\x08 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInputH\x00\x12G\n\x10suggestion_input\x18\x0c \x01(\x0b\x32+.google.cloud.dialogflow.v2.SuggestionInputH\x00\x12I\n\x12reply_audio_config\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x41\n\x0cquery_params\x18\t \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12N\n\x13\x61ssist_query_params\x18\x0e \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\n\rcx_parameters\x18\x12 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\nrequest_id\x18\x0b \x01(\tB\x07\n\x05input\",\n\x0e\x44tmfParameters\x12\x1a\n\x12\x61\x63\x63\x65pts_dtmf_input\x18\x01 \x01(\x08\"\xde\x03\n\x16\x41nalyzeContentResponse\x12\x12\n\nreply_text\x18\x01 \x01(\t\x12<\n\x0breply_audio\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.OutputAudio\x12N\n\x15\x61utomated_agent_reply\x18\x03 \x01(\x0b\x32/.google.cloud.dialogflow.v2.AutomatedAgentReply\x12\x34\n\x07message\x18\x05 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12T\n\x1ehuman_agent_suggestion_results\x18\x06 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\n\x1b\x65nd_user_suggestion_results\x18\x07 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12\x43\n\x0f\x64tmf_parameters\x18\t \x01(\x0b\x32*.google.cloud.dialogflow.v2.DtmfParameters\"\xa6\x06\n\x1eStreamingAnalyzeContentRequest\x12\x42\n\x0bparticipant\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x44\n\x0c\x61udio_config\x18\x02 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigH\x00\x12\x42\n\x0btext_config\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.v2.InputTextConfigH\x00\x12I\n\x12reply_audio_config\x18\x04 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x15\n\x0binput_audio\x18\x05 \x01(\x0cH\x01\x12\x14\n\ninput_text\x18\x06 \x01(\tH\x01\x12\x45\n\ninput_dtmf\x18\t \x01(\x0b\x32/.google.cloud.dialogflow.v2.TelephonyDtmfEventsH\x01\x12\x41\n\x0cquery_params\x18\x07 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12N\n\x13\x61ssist_query_params\x18\x08 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\n\rcx_parameters\x18\r \x01(\x0b\x32\x17.google.protobuf.Struct\x12&\n\x19\x65nable_extended_streaming\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12\x31\n$enable_partial_automated_agent_reply\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1aoutput_multiple_utterances\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x15\x65nable_debugging_info\x18\x13 \x01(\x08\x42\x08\n\x06\x63onfigB\x07\n\x05input\"\xa5\x05\n\x1fStreamingAnalyzeContentResponse\x12R\n\x12recognition_result\x18\x01 \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.StreamingRecognitionResult\x12\x12\n\nreply_text\x18\x02 \x01(\t\x12<\n\x0breply_audio\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.OutputAudio\x12N\n\x15\x61utomated_agent_reply\x18\x04 \x01(\x0b\x32/.google.cloud.dialogflow.v2.AutomatedAgentReply\x12\x34\n\x07message\x18\x06 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12T\n\x1ehuman_agent_suggestion_results\x18\x07 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\n\x1b\x65nd_user_suggestion_results\x18\x08 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12\x43\n\x0f\x64tmf_parameters\x18\n \x01(\x0b\x32*.google.cloud.dialogflow.v2.DtmfParameters\x12R\n\x0e\x64\x65\x62ugging_info\x18\x0b \x01(\x0b\x32:.google.cloud.dialogflow.v2.CloudConversationDebuggingInfo\x12\x14\n\x0cspeech_model\x18\r \x01(\t\"\x85\x02\n\x16SuggestArticlesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12N\n\x13\x61ssist_query_params\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\"\x8b\x01\n\x17SuggestArticlesResponse\x12\x42\n\x0f\x61rticle_answers\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.v2.ArticleAnswer\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\x87\x02\n\x18SuggestFaqAnswersRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12N\n\x13\x61ssist_query_params\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\"\x85\x01\n\x19SuggestFaqAnswersResponse\x12:\n\x0b\x66\x61q_answers\x18\x01 \x03(\x0b\x32%.google.cloud.dialogflow.v2.FaqAnswer\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\xa1\x03\n\x1bGenerateSuggestionsResponse\x12w\n\x1cgenerator_suggestion_answers\x18\x01 \x03(\x0b\x32Q.google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x1a\xc8\x01\n\x19GeneratorSuggestionAnswer\x12M\n\x14generator_suggestion\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestion\x12\x18\n\x10source_generator\x18\x02 \x01(\t\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\"\xf4\x01\n\x1aSuggestSmartRepliesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x12\x63urrent_text_input\x18\x04 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInput\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\xc3\x01\n\x1bSuggestSmartRepliesResponse\x12N\n\x13smart_reply_answers\x18\x01 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SmartReplyAnswerB\x03\xe0\x41\x03\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"c\n\nAudioInput\x12\x41\n\x06\x63onfig\x18\x01 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigB\x03\xe0\x41\x02\x12\x12\n\x05\x61udio\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"[\n\x0bOutputAudio\x12=\n\x06\x63onfig\x18\x01 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\r\n\x05\x61udio\x18\x02 \x01(\x0c\"\xe8\x02\n\x13\x41utomatedAgentReply\x12P\n\x16\x64\x65tect_intent_response\x18\x01 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.DetectIntentResponse\x12k\n\x1a\x61utomated_agent_reply_type\x18\x07 \x01(\x0e\x32G.google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType\x12\x1a\n\x12\x61llow_cancellation\x18\x08 \x01(\x08\x12\x17\n\x0f\x63x_current_page\x18\x0b \x01(\t\"]\n\x17\x41utomatedAgentReplyType\x12*\n&AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PARTIAL\x10\x01\x12\t\n\x05\x46INAL\x10\x02\"\xe4\x01\n\rArticleAnswer\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08snippets\x18\x03 \x03(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12I\n\x08metadata\x18\x05 \x03(\x0b\x32\x37.google.cloud.dialogflow.v2.ArticleAnswer.MetadataEntry\x12\x15\n\ranswer_record\x18\x06 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe0\x01\n\tFaqAnswer\x12\x0e\n\x06\x61nswer\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x10\n\x08question\x18\x03 \x01(\t\x12\x0e\n\x06source\x18\x04 \x01(\t\x12\x45\n\x08metadata\x18\x05 \x03(\x0b\x32\x33.google.cloud.dialogflow.v2.FaqAnswer.MetadataEntry\x12\x15\n\ranswer_record\x18\x06 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x10SmartReplyAnswer\x12\r\n\x05reply\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\"\\\n\x10IntentSuggestion\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\tintent_v2\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x08\n\x06intent\"\xc5\x01\n\x16\x44ialogflowAssistAnswer\x12?\n\x0cquery_result\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResultH\x00\x12I\n\x11intent_suggestion\x18\x05 \x01(\x0b\x32,.google.cloud.dialogflow.v2.IntentSuggestionH\x00\x12\x15\n\ranswer_record\x18\x02 \x01(\tB\x08\n\x06result\"\xb5\x04\n\x10SuggestionResult\x12#\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x12X\n\x19suggest_articles_response\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SuggestArticlesResponseH\x00\x12g\n!suggest_knowledge_assist_response\x18\x08 \x01(\x0b\x32:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponseH\x00\x12]\n\x1csuggest_faq_answers_response\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.SuggestFaqAnswersResponseH\x00\x12\x61\n\x1esuggest_smart_replies_response\x18\x04 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.SuggestSmartRepliesResponseH\x00\x12`\n\x1dgenerate_suggestions_response\x18\t \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.GenerateSuggestionsResponseH\x00\x42\x15\n\x13suggestion_response\"-\n\x0fInputTextConfig\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\"j\n\x14\x41nnotatedMessagePart\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x13\n\x0b\x65ntity_type\x18\x02 \x01(\t\x12/\n\x0f\x66ormatted_value\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\"n\n\x11MessageAnnotation\x12?\n\x05parts\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.v2.AnnotatedMessagePart\x12\x18\n\x10\x63ontain_entities\x18\x02 \x01(\x08\"\xa3\x02\n\x0fSuggestionInput\x12\x1a\n\ranswer_record\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x30\n\nparameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12G\n\x06\x61\x63tion\x18\x05 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionInput.ActionB\x03\xe0\x41\x01\x12\x32\n\tsend_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"E\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\n\n\x06\x43\x41NCEL\x10\x01\x12\n\n\x06REVISE\x10\x02\x12\x0b\n\x07\x43ONFIRM\x10\x03\"\xcd\x01\n\x15\x41ssistQueryParameters\x12s\n\x1a\x64ocuments_metadata_filters\x18\x01 \x03(\x0b\x32O.google.cloud.dialogflow.v2.AssistQueryParameters.DocumentsMetadataFiltersEntry\x1a?\n\x1d\x44ocumentsMetadataFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe3\x01\n\x1dSuggestKnowledgeAssistRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12%\n\x18previous_suggested_query\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xab\x02\n\x1eSuggestKnowledgeAssistResponse\x12W\n\x17knowledge_assist_answer\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.KnowledgeAssistAnswerB\x03\xe0\x41\x03\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x12\x81\x01\n\"additional_suggested_query_results\x18\x04 \x03(\x0b\x32P.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResultB\x03\xe0\x41\x01\"\xb9\x05\n!IngestedContextReferenceDebugInfo\x12\x1f\n\x17project_not_allowlisted\x18\x01 \x01(\x08\x12#\n\x1b\x63ontext_reference_retrieved\x18\x02 \x01(\x08\x12\x80\x01\n\x1eingested_parameters_debug_info\x18\x03 \x03(\x0b\x32X.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo\x1a\xca\x03\n\x1aIngestedParameterDebugInfo\x12\x11\n\tparameter\x18\x01 \x01(\t\x12\x82\x01\n\x10ingestion_status\x18\x02 \x01(\x0e\x32h.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus\"\x93\x02\n\x0fIngestionStatus\x12 \n\x1cINGESTION_STATUS_UNSPECIFIED\x10\x00\x12\x1e\n\x1aINGESTION_STATUS_SUCCEEDED\x10\x01\x12*\n&INGESTION_STATUS_CONTEXT_NOT_AVAILABLE\x10\x02\x12!\n\x1dINGESTION_STATUS_PARSE_FAILED\x10\x03\x12\"\n\x1eINGESTION_STATUS_INVALID_ENTRY\x10\x04\x12#\n\x1fINGESTION_STATUS_INVALID_FORMAT\x10\x05\x12&\n\"INGESTION_STATUS_LANGUAGE_MISMATCH\x10\x06\"\x97\x02\n\x0eServiceLatency\x12\x65\n\x1ainternal_service_latencies\x18\x01 \x03(\x0b\x32\x41.google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency\x1a\x9d\x01\n\x16InternalServiceLatency\x12\x0c\n\x04step\x18\x01 \x01(\t\x12\x12\n\nlatency_ms\x18\x02 \x01(\x02\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rcomplete_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8c\x12\n\x18KnowledgeAssistDebugInfo\x12z\n\x1fquery_generation_failure_reason\x18\x01 \x01(\x0e\x32Q.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason\x12\x82\x01\n#query_categorization_failure_reason\x18\x02 \x01(\x0e\x32U.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason\x12V\n\x19\x64\x61tastore_response_reason\x18\x03 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\n\x19knowledge_assist_behavior\x18\x04 \x01(\x0b\x32L.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior\x12l\n%ingested_context_reference_debug_info\x18\x05 \x01(\x0b\x32=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12\x43\n\x0fservice_latency\x18\x06 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ServiceLatency\x12r\n\x1bquery_generation_debug_info\x18\x07 \x01(\x0b\x32M.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo\x12/\n\x0e\x63\x65s_debug_info\x18\x08 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\xb9\x05\n\x17KnowledgeAssistBehavior\x12%\n\x1d\x61nswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\n\x1a\x65nd_user_metadata_included\x18\x02 \x01(\x08\x12\x19\n\x11return_query_only\x18\x04 \x01(\x08\x12\x1b\n\x13use_pubsub_delivery\x18\x05 \x01(\x08\x12\x1d\n\x15\x64isable_sync_delivery\x18\x06 \x01(\x08\x12!\n\x19previous_queries_included\x18\x07 \x01(\x08\x12\x1e\n\x16use_translated_message\x18\x08 \x01(\x08\x12&\n\x1euse_custom_safety_filter_level\x18\t \x01(\x08\x12\x33\n+conversation_transcript_has_mixed_languages\x18\n \x01(\x08\x12\x30\n(query_generation_agent_language_mismatch\x18\x0b \x01(\x08\x12\x33\n+query_generation_end_user_language_mismatch\x18\x0c \x01(\x08\x12%\n\x1dthird_party_connector_allowed\x18\r \x01(\x08\x12\"\n\x1amultiple_queries_generated\x18\x0e \x01(\x08\x12&\n\x1equery_contained_search_context\x18\x0f \x01(\x08\x12.\n&invalid_items_query_suggestion_skipped\x18\x10 \x01(\x08\x12+\n#primary_query_redacted_and_replaced\x18\x11 \x01(\x08\x12%\n\x1d\x61ppended_search_context_count\x18\x12 \x01(\x05\x1aq\n\x18QueryGenerationDebugInfo\x12\x1a\n\x12prompt_token_count\x18\x01 \x01(\x05\x12\x1e\n\x16\x63\x61ndidates_token_count\x18\x02 \x01(\x05\x12\x19\n\x11total_token_count\x18\x03 \x01(\x05\"\xcf\x03\n\x1cQueryGenerationFailureReason\x12/\n+QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12!\n\x1dQUERY_GENERATION_OUT_OF_QUOTA\x10\x01\x12\x1b\n\x17QUERY_GENERATION_FAILED\x10\x02\x12\'\n#QUERY_GENERATION_NO_QUERY_GENERATED\x10\x03\x12\x1f\n\x1bQUERY_GENERATION_RAI_FAILED\x10\x04\x12\x14\n\x10NOT_IN_ALLOWLIST\x10\x05\x12#\n\x1fQUERY_GENERATION_QUERY_REDACTED\x10\x06\x12.\n*QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED\x10\n\x12\'\n#QUERY_GENERATION_EMPTY_CONVERSATION\x10\x0b\x12\'\n#QUERY_GENERATION_EMPTY_LAST_MESSAGE\x10\x0c\x12\x37\n3QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET\x10\r\"\xcc\x01\n QueryCategorizationFailureReason\x12\x33\n/QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12\'\n#QUERY_CATEGORIZATION_INVALID_CONFIG\x10\x01\x12)\n%QUERY_CATEGORIZATION_RESULT_NOT_FOUND\x10\x02\x12\x1f\n\x1bQUERY_CATEGORIZATION_FAILED\x10\x03\"\xc1\x0c\n\x15KnowledgeAssistAnswer\x12Y\n\x0fsuggested_query\x18\x01 \x01(\x0b\x32@.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery\x12\x61\n\x16suggested_query_answer\x18\x02 \x01(\x0b\x32\x41.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer\x12\x15\n\ranswer_record\x18\x03 \x01(\t\x12Y\n\x1bknowledge_assist_debug_info\x18\x07 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo\x1a\xc9\x01\n\x0eSuggestedQuery\x12\x12\n\nquery_text\x18\x01 \x01(\t\x12l\n\x0fsearch_contexts\x18\x04 \x03(\x0b\x32N.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContextB\x03\xe0\x41\x01\x1a\x35\n\rSearchContext\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\xc7\x01\n\x1e\x41\x64\x64itionalSuggestedQueryResult\x12^\n\x0fsuggested_query\x18\x01 \x01(\x0b\x32@.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryB\x03\xe0\x41\x03\x12\x45\n\ranswer_record\x18\x05 \x01(\tB.\xe0\x41\x03\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x1a\xe1\x06\n\x0fKnowledgeAnswer\x12\x13\n\x0b\x61nswer_text\x18\x01 \x01(\t\x12\x61\n\nfaq_source\x18\x03 \x01(\x0b\x32K.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceH\x00\x12o\n\x11generative_source\x18\x04 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\x00\x12m\n\x0fplaybook_source\x18\x07 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\x00\x12\x65\n\x0c\x65vent_source\x18\x08 \x01(\x0b\x32M.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSourceH\x00\x1a\x1d\n\tFaqSource\x12\x10\n\x08question\x18\x02 \x01(\t\x1a\xe0\x01\n\x10GenerativeSource\x12l\n\x08snippets\x18\x01 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet\x1a^\n\x07Snippet\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\r\n\x05title\x18\x04 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x82\x01\n\x0b\x45ventSource\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x64\n\x08snippets\x18\x02 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceB\x08\n\x06source*\xd6\x02\n\x17\x44\x61tastoreResponseReason\x12)\n%DATASTORE_RESPONSE_REASON_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x17\n\x13SEARCH_OUT_OF_QUOTA\x10\x02\x12\x18\n\x14SEARCH_EMPTY_RESULTS\x10\x03\x12%\n!ANSWER_GENERATION_GEN_AI_DISABLED\x10\x04\x12\"\n\x1e\x41NSWER_GENERATION_OUT_OF_QUOTA\x10\x05\x12\x1b\n\x17\x41NSWER_GENERATION_ERROR\x10\x06\x12%\n!ANSWER_GENERATION_NOT_ENOUGH_INFO\x10\x07\x12 \n\x1c\x41NSWER_GENERATION_RAI_FAILED\x10\x08\x12\"\n\x1e\x41NSWER_GENERATION_NOT_GROUNDED\x10\t2\xfa\x18\n\x0cParticipants\x12\xa5\x02\n\x11\x43reateParticipant\x12\x34.google.cloud.dialogflow.v2.CreateParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\xb0\x01\xda\x41\x12parent,participant\x82\xd3\xe4\x93\x02\x94\x01\"4/v2/{parent=projects/*/conversations/*}/participants:\x0bparticipantZO\"@/v2/{parent=projects/*/locations/*/conversations/*}/participants:\x0bparticipant\x12\xf6\x01\n\x0eGetParticipant\x12\x31.google.cloud.dialogflow.v2.GetParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\x12\x34/v2/{name=projects/*/conversations/*/participants/*}ZB\x12@/v2/{name=projects/*/locations/*/conversations/*/participants/*}\x12\x89\x02\n\x10ListParticipants\x12\x33.google.cloud.dialogflow.v2.ListParticipantsRequest\x1a\x34.google.cloud.dialogflow.v2.ListParticipantsResponse\"\x89\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02z\x12\x34/v2/{parent=projects/*/conversations/*}/participantsZB\x12@/v2/{parent=projects/*/locations/*/conversations/*}/participants\x12\xc2\x02\n\x11UpdateParticipant\x12\x34.google.cloud.dialogflow.v2.UpdateParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\xcd\x01\xda\x41\x17participant,update_mask\x82\xd3\xe4\x93\x02\xac\x01\x32@/v2/{participant.name=projects/*/conversations/*/participants/*}:\x0bparticipantZ[2L/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}:\x0bparticipant\x12\xfa\x02\n\x0e\x41nalyzeContent\x12\x31.google.cloud.dialogflow.v2.AnalyzeContentRequest\x1a\x32.google.cloud.dialogflow.v2.AnalyzeContentResponse\"\x80\x02\xda\x41\x16participant,text_input\xda\x41\x17participant,event_input\xda\x41\x17participant,audio_input\x82\xd3\xe4\x93\x02\xac\x01\"J/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent:\x01*Z[\"V/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent:\x01*\x12\x98\x01\n\x17StreamingAnalyzeContent\x12:.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest\x1a;.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse\"\x00(\x01\x30\x01\x12\xc9\x02\n\x0fSuggestArticles\x12\x32.google.cloud.dialogflow.v2.SuggestArticlesRequest\x1a\x33.google.cloud.dialogflow.v2.SuggestArticlesResponse\"\xcc\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xbc\x01\"R/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*Zc\"^/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*\x12\xd3\x02\n\x11SuggestFaqAnswers\x12\x34.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest\x1a\x35.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse\"\xd0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xc0\x01\"T/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*Ze\"`/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*\x12\xdd\x02\n\x13SuggestSmartReplies\x12\x36.google.cloud.dialogflow.v2.SuggestSmartRepliesRequest\x1a\x37.google.cloud.dialogflow.v2.SuggestSmartRepliesResponse\"\xd4\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xc4\x01\"V/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*Zg\"b/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*\x12\xe3\x02\n\x16SuggestKnowledgeAssist\x12\x39.google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest\x1a:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse\"\xd1\x01\x82\xd3\xe4\x93\x02\xca\x01\"Y/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*Zj\"e/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x10ParticipantProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) @@ -73,14 +73,18 @@ module V2 ServiceLatency::InternalServiceLatency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency").msgclass KnowledgeAssistDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo").msgclass KnowledgeAssistDebugInfo::KnowledgeAssistBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior").msgclass + KnowledgeAssistDebugInfo::QueryGenerationDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo").msgclass KnowledgeAssistDebugInfo::QueryGenerationFailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason").enummodule KnowledgeAssistDebugInfo::QueryCategorizationFailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason").enummodule KnowledgeAssistAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer").msgclass KnowledgeAssistAnswer::SuggestedQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery").msgclass + KnowledgeAssistAnswer::SuggestedQuery::SearchContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContext").msgclass + KnowledgeAssistAnswer::AdditionalSuggestedQueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResult").msgclass KnowledgeAssistAnswer::KnowledgeAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer").msgclass KnowledgeAssistAnswer::KnowledgeAnswer::FaqSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource").msgclass KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource").msgclass KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource::Snippet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet").msgclass + KnowledgeAssistAnswer::KnowledgeAnswer::EventSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSource").msgclass DatastoreResponseReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DatastoreResponseReason").enummodule end end diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb index c62348d6ffb9..fa869aec1675 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb @@ -549,7 +549,7 @@ module OutputAudioEncoding # Audio content returned as LINEAR16 also contains a WAV header. OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1 - # MP3 audio at 32kbps. + # MP3 audio at 64kbps. OUTPUT_AUDIO_ENCODING_MP3 = 2 # MP3 audio at 64kbps. diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb index 02a74f6b1df3..4ca1b2a80b54 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb @@ -29,6 +29,18 @@ module V2 # @!attribute [rw] confirmation_requirement # @return [::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement] # Optional. Indicates whether the app requires human confirmation. + # @!attribute [rw] proactive_enabled + # @return [::Boolean] + # Optional. Only applicable for CompanionAgent. + # Indicates whether the ces app is enabled in proactive mode. + # At least one of `proactive_enabled` or `reactive_enabled` should be + # true; otherwise, the ces app will be ignored. + # @!attribute [rw] reactive_enabled + # @return [::Boolean] + # Optional. Only applicable for CompanionAgent. + # Indicates whether the ces app is enabled in reactive mode. + # At least one of `proactive_enabled` or `reactive_enabled` should be + # true; otherwise, the ces app will be ignored. class CesAppSpec include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb index f47077514e07..5fb18e4cc811 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb @@ -1112,6 +1112,12 @@ module AnswerType # The answer is from intent matching. INTENT = 3 + + # The answer is from Playbook. + PLAYBOOK = 4 + + # The answer is from event. + EVENT = 5 end end diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb index 752de759016f..21a2465bae8f 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb @@ -79,6 +79,9 @@ module V2 # languages. # This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) # language tag. Example: "en-US". + # @!attribute [rw] sip_config + # @return [::Google::Cloud::Dialogflow::V2::SipConfig] + # Optional. Configuration for SIP connections. # @!attribute [rw] time_zone # @return [::String] # The time zone of this conversational profile from the @@ -295,6 +298,20 @@ class SuggestionTriggerSettings # @return [::Google::Cloud::Dialogflow::V2::RaiSettings] # Optional. Settings for Responsible AI checks. # Supported features: KNOWLEDGE_ASSIST + # @!attribute [rw] suggestion_trigger_event + # @return [::Google::Cloud::Dialogflow::V2::TriggerEvent] + # Optional. The trigger event for suggestion. + # If unspecified, it will be `CUSTOMER_MESSAGE`. + # Supported features: KNOWLEDGE_ASSIST + # For KNOWLEDGE_ASSIST, these four trigger events are supported: + # 1. TRIGGER_EVENT_UNSPECIFIED + # 2. END_OF_UTTERANCE + # 3. CUSTOMER_MESSAGE + # 4. AGENT_MESSAGE + # @!attribute [rw] disable_query_search_context + # @return [::Boolean] + # Optional. If true, disable appending available search context to the + # search query. Supported features: KNOWLEDGE_ASSIST # @!attribute [rw] suggestion_trigger_settings # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionTriggerSettings] # Settings of suggestion trigger. @@ -749,6 +766,39 @@ class LoggingConfig extend ::Google::Protobuf::MessageExts::ClassMethods end + # Defines the SIP configuration. + # @!attribute [rw] create_conversation_on_the_fly + # @return [::Boolean] + # Asks Dialogflow Telephony to create the conversation provided in the SIP + # header on the fly when the call comes in. + # @!attribute [rw] inactive_start + # @return [::Boolean] + # Starts the conversation with inactive SDP directives + # @!attribute [rw] max_audio_recording_duration + # @return [::Google::Protobuf::Duration] + # Max duration for audio recording. + # Overrides the default value of 15 min. + # Max value is 8 hours. + # @!attribute [rw] allow_virtual_agent_interaction + # @return [::Boolean] + # Allows interactions with a Dialogflow virtual agent even if the call is + # connected for SIPREC purposes. + # @!attribute [rw] keep_conversation_running + # @return [::Boolean] + # Keeps the conversation running even if the call is disconnected. + # @!attribute [rw] copy_inbound_call_leg_headers + # @return [::Array<::String>] + # List of inbound call leg headers to be copied to outbound call legs created + # later. + # @!attribute [rw] ignore_reinvite_media_direction + # @return [::Boolean] + # Ignores any media direction in the reINVITE SDP offer. Reuse the previous + # media direction. + class SipConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The type of Human Agent Assistant API suggestion to perform, and the maximum # number of results to return for that type. Multiple `Feature` objects can # be specified in the `features` list. diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb index 766f7128e5b3..4f66a05f778a 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb @@ -50,9 +50,9 @@ module V2 # Dialogflow adds the obfuscated user id with the participant. # # 2. If you set this field in - # {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest#participant AnalyzeContent} - # or - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#participant StreamingAnalyzeContent}, + # [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] + # or [StreamingAnalyzeContent] + # [google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id], # Dialogflow will update # {::Google::Cloud::Dialogflow::V2::Participant#obfuscated_external_user_id Participant.obfuscated_external_user_id}. # @@ -64,6 +64,11 @@ module V2 # example, Dialogflow determines whether a user in one conversation returned # in a later conversation. # + # Additionally, to link an escalated Virtual Agent conversation + # with its corresponding Agent Assist conversation for analytics, this field + # in Agent Assist conversations should be populated to indicate the user id + # of the `END_USER` participant in the escalated conversation. + # # Note: # # * Please never pass raw user ids to Dialogflow. Always obfuscate your user @@ -542,8 +547,11 @@ class StreamingAnalyzeContentRequest # # 1. If the input was set to streaming audio, the first one or more messages # contain `recognition_result`. Each `recognition_result` represents a more - # complete transcript of what the user said. The last `recognition_result` - # has `is_final` set to `true`. + # complete transcript of what the user said. When a user speaks multiple + # sentences, the API will emit multiple messages where `is_final = true`. + # Each time the system detects a distinct pause or completed thought, it + # locks in that segment, marks it `is_final = true`, and then immediately + # starts a new recognition cycle for the next sentence on the same stream. # # 2. In virtual agent stage: if `enable_partial_automated_agent_reply` is # true, the following N (currently 1 <= N <= 4) messages @@ -1237,6 +1245,11 @@ class SuggestKnowledgeAssistRequest # to compile the suggestion. It may be smaller than the # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest#context_size SuggestKnowledgeAssistRequest.context_size} # field in the request if there are fewer messages in the conversation. + # @!attribute [rw] additional_suggested_query_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::AdditionalSuggestedQueryResult>] + # Optional. The list of additional suggested queries based on the context. + # This is used for the cases when we want to generate multiple queries + # for a single request. class SuggestKnowledgeAssistResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -1344,6 +1357,12 @@ class InternalServiceLatency # @!attribute [rw] service_latency # @return [::Google::Cloud::Dialogflow::V2::ServiceLatency] # The latency of the service. + # @!attribute [rw] query_generation_debug_info + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo::QueryGenerationDebugInfo] + # Token usage metadata for query generation. + # @!attribute [rw] ces_debug_info + # @return [::Google::Protobuf::Struct] + # Debug information from CES runtime API. class KnowledgeAssistDebugInfo include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -1412,6 +1431,21 @@ class KnowledgeAssistBehavior extend ::Google::Protobuf::MessageExts::ClassMethods end + # Token usage metadata for query generation. + # @!attribute [rw] prompt_token_count + # @return [::Integer] + # The total number of tokens in the prompt. + # @!attribute [rw] candidates_token_count + # @return [::Integer] + # The total number of tokens in the generated candidates. + # @!attribute [rw] total_token_count + # @return [::Integer] + # The total number of tokens for the entire request. + class QueryGenerationDebugInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Reason for query generation failure. module QueryGenerationFailureReason # Default value. @@ -1496,9 +1530,44 @@ class KnowledgeAssistAnswer # @!attribute [rw] query_text # @return [::String] # Suggested query text. + # @!attribute [rw] search_contexts + # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::SuggestedQuery::SearchContext>] + # Optional. The search contexts for the query. class SuggestedQuery include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods + + # Search context is information useful for knowledge search that helps + # enrich the query. + # Example: + # search_context { + # key: "application name" + # value: "DesignApp" + # } + # @!attribute [rw] key + # @return [::String] + # Optional. The key of the search context, e.g. "application name". + # @!attribute [rw] value + # @return [::String] + # Optional. The value of the search context, e.g. "DesignApp". + class SearchContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represents a single suggested query result. + # @!attribute [r] suggested_query + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::SuggestedQuery] + # Output only. The suggested query based on the context. + # @!attribute [r] answer_record + # @return [::String] + # Output only. The name of the answer record. + # Format: `projects//locations//answerRecords/` + class AdditionalSuggestedQueryResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods end # Represents an answer from Knowledge. Currently supports FAQ and Generative @@ -1510,12 +1579,22 @@ class SuggestedQuery # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::FaqSource] # Populated if the prediction came from FAQ. # - # Note: The following fields are mutually exclusive: `faq_source`, `generative_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `faq_source`, `generative_source`, `playbook_source`, `event_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. # @!attribute [rw] generative_source # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource] # Populated if the prediction was Generative. # - # Note: The following fields are mutually exclusive: `generative_source`, `faq_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # Note: The following fields are mutually exclusive: `generative_source`, `faq_source`, `playbook_source`, `event_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] playbook_source + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource] + # Populated if the prediction was from Playbook. + # + # Note: The following fields are mutually exclusive: `playbook_source`, `faq_source`, `generative_source`, `event_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] event_source + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::EventSource] + # Populated if the prediction was from an event. + # + # Note: The following fields are mutually exclusive: `event_source`, `faq_source`, `generative_source`, `playbook_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. class KnowledgeAnswer include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -1556,6 +1635,18 @@ class Snippet extend ::Google::Protobuf::MessageExts::ClassMethods end end + + # Details about source of Event answer. + # @!attribute [rw] event + # @return [::String] + # Name of the triggered event. + # @!attribute [rw] snippets + # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource] + # Sources used in event fulfillment. + class EventSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end end diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb index 4b9a120b7f98..db8a715413e8 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb @@ -571,19 +571,22 @@ class StreamingDetectIntentResponse # finalized transcript values received for the series of results. # # In the following example, single utterance is enabled. In the case where - # single utterance is not enabled, result 7 would not occur. + # single utterance is not enabled, result 8 would not occur. # # ``` - # Num | transcript | message_type | is_final - # --- | ----------------------- | ----------------------- | -------- - # 1 | "tube" | TRANSCRIPT | false - # 2 | "to be a" | TRANSCRIPT | false - # 3 | "to be" | TRANSCRIPT | false - # 4 | "to be or not to be" | TRANSCRIPT | true - # 5 | "that's" | TRANSCRIPT | false - # 6 | "that is | TRANSCRIPT | false - # 7 | unset | END_OF_SINGLE_UTTERANCE | unset - # 8 | " that is the question" | TRANSCRIPT | true + # Num | transcript | message_type | is_final + # --- | ------------------------ | ----------------------- | -------- + # 1 | "tube" | TRANSCRIPT | false + # 2 | "to be a" | TRANSCRIPT | false + # 3 | "to be" | TRANSCRIPT | false + # 4 | "to be or not to be" | TRANSCRIPT | true + # 5 | "that's" | TRANSCRIPT | false + # 6 | "that is | TRANSCRIPT | false + # 7 | " that is the question" | TRANSCRIPT | true + # 8 | unset | END_OF_SINGLE_UTTERANCE | unset + # 9 | ". Whether 'tis nobler" | TRANSCRIPT | true + # 10 | " in the mind" | TRANSCRIPT | false + # 11 | " in the mind to suffer" | TRANSCRIPT | true # ``` # # Concatenating the finalized transcripts with `is_final` set to true, diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/.gitignore b/owl-bot-staging/google-cloud-dialogflow-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/.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-dialogflow-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-dialogflow-v2/.repo-metadata.json deleted file mode 100644 index c28a1df1d12f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "dialogflow.googleapis.com", - "api_shortname": "dialogflow", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest", - "distribution_name": "google-cloud-dialogflow-v2", - "is_cloud": true, - "language": "ruby", - "name": "dialogflow", - "name_pretty": "Dialogflow V2 API", - "product_documentation": "https://cloud.google.com/dialogflow", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Dialogflow is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business. This client is for Dialogflow ES, providing the standard agent type suitable for small and simple agents. Note that google-cloud-dialogflow-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dialogflow instead. See the readme for more details.", - "ruby-cloud-env-prefix": "DIALOGFLOW", - "ruby-cloud-product-url": "https://cloud.google.com/dialogflow", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/.rubocop.yml b/owl-bot-staging/google-cloud-dialogflow-v2/.rubocop.yml deleted file mode 100644 index 8743a6db18c7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-dialogflow-v2.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-dialogflow-v2.rb" diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/.toys.rb b/owl-bot-staging/google-cloud-dialogflow-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/.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-dialogflow-v2/.yardopts b/owl-bot-staging/google-cloud-dialogflow-v2/.yardopts deleted file mode 100644 index f6fe8ca2a537..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Dialogflow V2 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-dialogflow-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-dialogflow-v2/AUTHENTICATION.md deleted file mode 100644 index abc2d69faa26..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-dialogflow-v2 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-dialogflow-v2 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/dialogflow/v2" - -client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/dialogflow/v2" - -::Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Dialogflow::V2::Agents::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-dialogflow-v2 -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/dialogflow/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Dialogflow::V2::Agents::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-dialogflow-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-dialogflow-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/Gemfile b/owl-bot-staging/google-cloud-dialogflow-v2/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/LICENSE.md b/owl-bot-staging/google-cloud-dialogflow-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/README.md b/owl-bot-staging/google-cloud-dialogflow-v2/README.md deleted file mode 100644 index cd1b6d1222bd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Dialogflow V2 API - -Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices). - -Dialogflow is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business. This client is for Dialogflow ES, providing the standard agent type suitable for small and simple agents. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Dialogflow V2 API. Most users should consider using -the main client gem, -[google-cloud-dialogflow](https://rubygems.org/gems/google-cloud-dialogflow). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-dialogflow-v2 -``` - -## 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/dialogflow.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/dialogflow/v2" - -client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new -request = ::Google::Cloud::Dialogflow::V2::GetAgentRequest.new # (request fields as keyword arguments...) -response = client.get_agent request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/dialogflow) -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/dialogflow/v2" -require "logger" - -client = ::Google::Cloud::Dialogflow::V2::Agents::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.2+. - -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-dialogflow`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-dialogflow-v2`. -_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-dialogflow`. -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-dialogflow-v2`. - -### 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-dialogflow-v2/Rakefile b/owl-bot-staging/google-cloud-dialogflow-v2/Rakefile deleted file mode 100644 index 262246472d59..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["DIALOGFLOW_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["DIALOGFLOW_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["DIALOGFLOW_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 DIALOGFLOW_TEST_PROJECT=test123 DIALOGFLOW_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/dialogflow/v2/agents/credentials" - ::Google::Cloud::Dialogflow::V2::Agents::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["DIALOGFLOW_PROJECT"] = project - ENV["DIALOGFLOW_TEST_PROJECT"] = project - ENV["DIALOGFLOW_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-dialogflow-v2 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-dialogflow-v2 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-dialogflow-v2 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-dialogflow-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-dialogflow-v2" - header "google-cloud-dialogflow-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-dialogflow-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-dialogflow-v2 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-dialogflow-v2 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-dialogflow-v2 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-dialogflow-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-dialogflow-v2/gapic_metadata.json deleted file mode 100644 index 001c56be9499..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/gapic_metadata.json +++ /dev/null @@ -1,857 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.dialogflow.v2", - "libraryPackage": "::Google::Cloud::Dialogflow::V2", - "services": { - "Agents": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Agents::Client", - "rpcs": { - "GetAgent": { - "methods": [ - "get_agent" - ] - }, - "SetAgent": { - "methods": [ - "set_agent" - ] - }, - "DeleteAgent": { - "methods": [ - "delete_agent" - ] - }, - "SearchAgents": { - "methods": [ - "search_agents" - ] - }, - "TrainAgent": { - "methods": [ - "train_agent" - ] - }, - "ExportAgent": { - "methods": [ - "export_agent" - ] - }, - "ImportAgent": { - "methods": [ - "import_agent" - ] - }, - "RestoreAgent": { - "methods": [ - "restore_agent" - ] - }, - "GetValidationResult": { - "methods": [ - "get_validation_result" - ] - } - } - } - } - }, - "Tools": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Tools::Client", - "rpcs": { - "CreateTool": { - "methods": [ - "create_tool" - ] - }, - "GetTool": { - "methods": [ - "get_tool" - ] - }, - "ListTools": { - "methods": [ - "list_tools" - ] - }, - "DeleteTool": { - "methods": [ - "delete_tool" - ] - }, - "UpdateTool": { - "methods": [ - "update_tool" - ] - } - } - } - } - }, - "Generators": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Generators::Client", - "rpcs": { - "CreateGenerator": { - "methods": [ - "create_generator" - ] - }, - "GetGenerator": { - "methods": [ - "get_generator" - ] - }, - "ListGenerators": { - "methods": [ - "list_generators" - ] - }, - "DeleteGenerator": { - "methods": [ - "delete_generator" - ] - }, - "UpdateGenerator": { - "methods": [ - "update_generator" - ] - } - } - } - } - }, - "Contexts": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Contexts::Client", - "rpcs": { - "ListContexts": { - "methods": [ - "list_contexts" - ] - }, - "GetContext": { - "methods": [ - "get_context" - ] - }, - "CreateContext": { - "methods": [ - "create_context" - ] - }, - "UpdateContext": { - "methods": [ - "update_context" - ] - }, - "DeleteContext": { - "methods": [ - "delete_context" - ] - }, - "DeleteAllContexts": { - "methods": [ - "delete_all_contexts" - ] - } - } - } - } - }, - "Intents": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Intents::Client", - "rpcs": { - "ListIntents": { - "methods": [ - "list_intents" - ] - }, - "GetIntent": { - "methods": [ - "get_intent" - ] - }, - "CreateIntent": { - "methods": [ - "create_intent" - ] - }, - "UpdateIntent": { - "methods": [ - "update_intent" - ] - }, - "DeleteIntent": { - "methods": [ - "delete_intent" - ] - }, - "BatchUpdateIntents": { - "methods": [ - "batch_update_intents" - ] - }, - "BatchDeleteIntents": { - "methods": [ - "batch_delete_intents" - ] - } - } - } - } - }, - "EntityTypes": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client", - "rpcs": { - "ListEntityTypes": { - "methods": [ - "list_entity_types" - ] - }, - "GetEntityType": { - "methods": [ - "get_entity_type" - ] - }, - "CreateEntityType": { - "methods": [ - "create_entity_type" - ] - }, - "UpdateEntityType": { - "methods": [ - "update_entity_type" - ] - }, - "DeleteEntityType": { - "methods": [ - "delete_entity_type" - ] - }, - "BatchUpdateEntityTypes": { - "methods": [ - "batch_update_entity_types" - ] - }, - "BatchDeleteEntityTypes": { - "methods": [ - "batch_delete_entity_types" - ] - }, - "BatchCreateEntities": { - "methods": [ - "batch_create_entities" - ] - }, - "BatchUpdateEntities": { - "methods": [ - "batch_update_entities" - ] - }, - "BatchDeleteEntities": { - "methods": [ - "batch_delete_entities" - ] - } - } - } - } - }, - "SessionEntityTypes": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client", - "rpcs": { - "ListSessionEntityTypes": { - "methods": [ - "list_session_entity_types" - ] - }, - "GetSessionEntityType": { - "methods": [ - "get_session_entity_type" - ] - }, - "CreateSessionEntityType": { - "methods": [ - "create_session_entity_type" - ] - }, - "UpdateSessionEntityType": { - "methods": [ - "update_session_entity_type" - ] - }, - "DeleteSessionEntityType": { - "methods": [ - "delete_session_entity_type" - ] - } - } - } - } - }, - "Sessions": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Sessions::Client", - "rpcs": { - "DetectIntent": { - "methods": [ - "detect_intent" - ] - }, - "StreamingDetectIntent": { - "methods": [ - "streaming_detect_intent" - ] - } - } - } - } - }, - "Participants": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Participants::Client", - "rpcs": { - "CreateParticipant": { - "methods": [ - "create_participant" - ] - }, - "GetParticipant": { - "methods": [ - "get_participant" - ] - }, - "ListParticipants": { - "methods": [ - "list_participants" - ] - }, - "UpdateParticipant": { - "methods": [ - "update_participant" - ] - }, - "AnalyzeContent": { - "methods": [ - "analyze_content" - ] - }, - "StreamingAnalyzeContent": { - "methods": [ - "streaming_analyze_content" - ] - }, - "SuggestArticles": { - "methods": [ - "suggest_articles" - ] - }, - "SuggestFaqAnswers": { - "methods": [ - "suggest_faq_answers" - ] - }, - "SuggestSmartReplies": { - "methods": [ - "suggest_smart_replies" - ] - }, - "SuggestKnowledgeAssist": { - "methods": [ - "suggest_knowledge_assist" - ] - } - } - } - } - }, - "AnswerRecords": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client", - "rpcs": { - "ListAnswerRecords": { - "methods": [ - "list_answer_records" - ] - }, - "UpdateAnswerRecord": { - "methods": [ - "update_answer_record" - ] - } - } - } - } - }, - "ConversationProfiles": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client", - "rpcs": { - "ListConversationProfiles": { - "methods": [ - "list_conversation_profiles" - ] - }, - "GetConversationProfile": { - "methods": [ - "get_conversation_profile" - ] - }, - "CreateConversationProfile": { - "methods": [ - "create_conversation_profile" - ] - }, - "UpdateConversationProfile": { - "methods": [ - "update_conversation_profile" - ] - }, - "DeleteConversationProfile": { - "methods": [ - "delete_conversation_profile" - ] - }, - "SetSuggestionFeatureConfig": { - "methods": [ - "set_suggestion_feature_config" - ] - }, - "ClearSuggestionFeatureConfig": { - "methods": [ - "clear_suggestion_feature_config" - ] - } - } - } - } - }, - "Conversations": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Conversations::Client", - "rpcs": { - "CreateConversation": { - "methods": [ - "create_conversation" - ] - }, - "ListConversations": { - "methods": [ - "list_conversations" - ] - }, - "GetConversation": { - "methods": [ - "get_conversation" - ] - }, - "CompleteConversation": { - "methods": [ - "complete_conversation" - ] - }, - "IngestContextReferences": { - "methods": [ - "ingest_context_references" - ] - }, - "ListMessages": { - "methods": [ - "list_messages" - ] - }, - "SuggestConversationSummary": { - "methods": [ - "suggest_conversation_summary" - ] - }, - "GenerateStatelessSummary": { - "methods": [ - "generate_stateless_summary" - ] - }, - "GenerateStatelessSuggestion": { - "methods": [ - "generate_stateless_suggestion" - ] - }, - "SearchKnowledge": { - "methods": [ - "search_knowledge" - ] - }, - "GenerateSuggestions": { - "methods": [ - "generate_suggestions" - ] - } - } - } - } - }, - "ConversationDatasets": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client", - "rpcs": { - "CreateConversationDataset": { - "methods": [ - "create_conversation_dataset" - ] - }, - "GetConversationDataset": { - "methods": [ - "get_conversation_dataset" - ] - }, - "ListConversationDatasets": { - "methods": [ - "list_conversation_datasets" - ] - }, - "DeleteConversationDataset": { - "methods": [ - "delete_conversation_dataset" - ] - }, - "ImportConversationData": { - "methods": [ - "import_conversation_data" - ] - } - } - } - } - }, - "ConversationModels": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client", - "rpcs": { - "CreateConversationModel": { - "methods": [ - "create_conversation_model" - ] - }, - "GetConversationModel": { - "methods": [ - "get_conversation_model" - ] - }, - "ListConversationModels": { - "methods": [ - "list_conversation_models" - ] - }, - "DeleteConversationModel": { - "methods": [ - "delete_conversation_model" - ] - }, - "DeployConversationModel": { - "methods": [ - "deploy_conversation_model" - ] - }, - "UndeployConversationModel": { - "methods": [ - "undeploy_conversation_model" - ] - }, - "GetConversationModelEvaluation": { - "methods": [ - "get_conversation_model_evaluation" - ] - }, - "ListConversationModelEvaluations": { - "methods": [ - "list_conversation_model_evaluations" - ] - }, - "CreateConversationModelEvaluation": { - "methods": [ - "create_conversation_model_evaluation" - ] - } - } - } - } - }, - "Documents": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Documents::Client", - "rpcs": { - "ListDocuments": { - "methods": [ - "list_documents" - ] - }, - "GetDocument": { - "methods": [ - "get_document" - ] - }, - "CreateDocument": { - "methods": [ - "create_document" - ] - }, - "ImportDocuments": { - "methods": [ - "import_documents" - ] - }, - "DeleteDocument": { - "methods": [ - "delete_document" - ] - }, - "UpdateDocument": { - "methods": [ - "update_document" - ] - }, - "ReloadDocument": { - "methods": [ - "reload_document" - ] - }, - "ExportDocument": { - "methods": [ - "export_document" - ] - } - } - } - } - }, - "EncryptionSpecService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client", - "rpcs": { - "GetEncryptionSpec": { - "methods": [ - "get_encryption_spec" - ] - }, - "InitializeEncryptionSpec": { - "methods": [ - "initialize_encryption_spec" - ] - } - } - } - } - }, - "Fulfillments": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client", - "rpcs": { - "GetFulfillment": { - "methods": [ - "get_fulfillment" - ] - }, - "UpdateFulfillment": { - "methods": [ - "update_fulfillment" - ] - } - } - } - } - }, - "Environments": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Environments::Client", - "rpcs": { - "ListEnvironments": { - "methods": [ - "list_environments" - ] - }, - "GetEnvironment": { - "methods": [ - "get_environment" - ] - }, - "CreateEnvironment": { - "methods": [ - "create_environment" - ] - }, - "UpdateEnvironment": { - "methods": [ - "update_environment" - ] - }, - "DeleteEnvironment": { - "methods": [ - "delete_environment" - ] - }, - "GetEnvironmentHistory": { - "methods": [ - "get_environment_history" - ] - } - } - } - } - }, - "GeneratorEvaluations": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client", - "rpcs": { - "CreateGeneratorEvaluation": { - "methods": [ - "create_generator_evaluation" - ] - }, - "GetGeneratorEvaluation": { - "methods": [ - "get_generator_evaluation" - ] - }, - "ListGeneratorEvaluations": { - "methods": [ - "list_generator_evaluations" - ] - }, - "DeleteGeneratorEvaluation": { - "methods": [ - "delete_generator_evaluation" - ] - } - } - } - } - }, - "KnowledgeBases": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client", - "rpcs": { - "ListKnowledgeBases": { - "methods": [ - "list_knowledge_bases" - ] - }, - "GetKnowledgeBase": { - "methods": [ - "get_knowledge_base" - ] - }, - "CreateKnowledgeBase": { - "methods": [ - "create_knowledge_base" - ] - }, - "DeleteKnowledgeBase": { - "methods": [ - "delete_knowledge_base" - ] - }, - "UpdateKnowledgeBase": { - "methods": [ - "update_knowledge_base" - ] - } - } - } - } - }, - "SipTrunks": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client", - "rpcs": { - "CreateSipTrunk": { - "methods": [ - "create_sip_trunk" - ] - }, - "DeleteSipTrunk": { - "methods": [ - "delete_sip_trunk" - ] - }, - "ListSipTrunks": { - "methods": [ - "list_sip_trunks" - ] - }, - "GetSipTrunk": { - "methods": [ - "get_sip_trunk" - ] - }, - "UpdateSipTrunk": { - "methods": [ - "update_sip_trunk" - ] - } - } - } - } - }, - "Versions": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Dialogflow::V2::Versions::Client", - "rpcs": { - "ListVersions": { - "methods": [ - "list_versions" - ] - }, - "GetVersion": { - "methods": [ - "get_version" - ] - }, - "CreateVersion": { - "methods": [ - "create_version" - ] - }, - "UpdateVersion": { - "methods": [ - "update_version" - ] - }, - "DeleteVersion": { - "methods": [ - "delete_version" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec b/owl-bot-staging/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec deleted file mode 100644 index 3836a70f4dcf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/google-cloud-dialogflow-v2.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/dialogflow/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-dialogflow-v2" - gem.version = Google::Cloud::Dialogflow::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Dialogflow is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business. This client is for Dialogflow ES, providing the standard agent type suitable for small and simple agents. Note that google-cloud-dialogflow-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dialogflow instead. See the readme for more details." - gem.summary = "Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices)." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.3" - 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-dialogflow-v2/lib/google-cloud-dialogflow-v2.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google-cloud-dialogflow-v2.rb deleted file mode 100644 index 2c54e39fb632..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google-cloud-dialogflow-v2.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/dialogflow/v2" diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2.rb deleted file mode 100644 index 77cc5fc4053a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/agents" -require "google/cloud/dialogflow/v2/tools" -require "google/cloud/dialogflow/v2/generators" -require "google/cloud/dialogflow/v2/contexts" -require "google/cloud/dialogflow/v2/intents" -require "google/cloud/dialogflow/v2/entity_types" -require "google/cloud/dialogflow/v2/session_entity_types" -require "google/cloud/dialogflow/v2/sessions" -require "google/cloud/dialogflow/v2/participants" -require "google/cloud/dialogflow/v2/answer_records" -require "google/cloud/dialogflow/v2/conversation_profiles" -require "google/cloud/dialogflow/v2/conversations" -require "google/cloud/dialogflow/v2/conversation_datasets" -require "google/cloud/dialogflow/v2/conversation_models" -require "google/cloud/dialogflow/v2/documents" -require "google/cloud/dialogflow/v2/encryption_spec_service" -require "google/cloud/dialogflow/v2/fulfillments" -require "google/cloud/dialogflow/v2/environments" -require "google/cloud/dialogflow/v2/generator_evaluations" -require "google/cloud/dialogflow/v2/knowledge_bases" -require "google/cloud/dialogflow/v2/sip_trunks" -require "google/cloud/dialogflow/v2/versions" -require "google/cloud/dialogflow/v2/version" - -module Google - module Cloud - module Dialogflow - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2" - # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/dialogflow/v2" - # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - module V2 - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/dialogflow/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_coaching_instruction_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_coaching_instruction_pb.rb deleted file mode 100644 index 312afb8c689c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_coaching_instruction_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/agent_coaching_instruction.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n;google/cloud/dialogflow/v2/agent_coaching_instruction.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\"\x9c\x06\n\x18\x41gentCoachingInstruction\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0f\x64isplay_details\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tcondition\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x61gent_action\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rsystem_action\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12n\n\x16\x64uplicate_check_result\x18\x08 \x01(\x0b\x32I.google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResultB\x03\xe0\x41\x03\x12`\n\x10triggering_event\x18\n \x01(\x0e\x32\x41.google.cloud.dialogflow.v2.AgentCoachingInstruction.TriggerEventB\x03\xe0\x41\x01\x1a\x8b\x02\n\x14\x44uplicateCheckResult\x12\x81\x01\n\x15\x64uplicate_suggestions\x18\x01 \x03(\x0b\x32].google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult.DuplicateSuggestionB\x03\xe0\x41\x03\x1ao\n\x13\x44uplicateSuggestion\x12\x1a\n\ranswer_record\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10suggestion_index\x18\x03 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1d\n\x10similarity_score\x18\x04 \x01(\x02\x42\x03\xe0\x41\x03\"\x97\x01\n\x0cTriggerEvent\x12\x1d\n\x19TRIGGER_EVENT_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45ND_OF_UTTERANCE\x10\x01\x12\x0f\n\x0bMANUAL_CALL\x10\x02\x12\x14\n\x10\x43USTOMER_MESSAGE\x10\x03\x12\x11\n\rAGENT_MESSAGE\x10\x04\x12\x18\n\x14TOOL_CALL_COMPLETION\x10\x05\x42\xa3\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x1d\x41gentCoachingInstructionProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - AgentCoachingInstruction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingInstruction").msgclass - AgentCoachingInstruction::DuplicateCheckResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult").msgclass - AgentCoachingInstruction::DuplicateCheckResult::DuplicateSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingInstruction.DuplicateCheckResult.DuplicateSuggestion").msgclass - AgentCoachingInstruction::TriggerEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingInstruction.TriggerEvent").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_pb.rb deleted file mode 100644 index f90b66a96d9a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_pb.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/agent.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/dialogflow/v2/validation_result_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n&google/cloud/dialogflow/v2/agent.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/dialogflow/v2/validation_result.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xa5\x07\n\x05\x41gent\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\"\n\x15\x64\x65\x66\x61ult_language_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12%\n\x18supported_language_codes\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\ttime_zone\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\navatar_uri\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0e\x65nable_logging\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12\x46\n\nmatch_mode\x18\t \x01(\x0e\x32+.google.cloud.dialogflow.v2.Agent.MatchModeB\x05\x18\x01\xe0\x41\x01\x12%\n\x18\x63lassification_threshold\x18\n \x01(\x02\x42\x03\xe0\x41\x01\x12\x46\n\x0b\x61pi_version\x18\x0e \x01(\x0e\x32,.google.cloud.dialogflow.v2.Agent.ApiVersionB\x03\xe0\x41\x01\x12\x39\n\x04tier\x18\x0f \x01(\x0e\x32&.google.cloud.dialogflow.v2.Agent.TierB\x03\xe0\x41\x01\"V\n\tMatchMode\x12\x1a\n\x16MATCH_MODE_UNSPECIFIED\x10\x00\x12\x15\n\x11MATCH_MODE_HYBRID\x10\x01\x12\x16\n\x12MATCH_MODE_ML_ONLY\x10\x02\"l\n\nApiVersion\x12\x1b\n\x17\x41PI_VERSION_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x41PI_VERSION_V1\x10\x01\x12\x12\n\x0e\x41PI_VERSION_V2\x10\x02\x12\x19\n\x15\x41PI_VERSION_V2_BETA_1\x10\x03\"b\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\x11\n\rTIER_STANDARD\x10\x01\x12\x13\n\x0fTIER_ENTERPRISE\x10\x02\x12\x1c\n\x14TIER_ENTERPRISE_PLUS\x10\x03\x1a\x02\x08\x01:m\xea\x41j\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x18projects/{project}/agent\x12-projects/{project}/locations/{location}/agent\"J\n\x0fGetAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\"~\n\x0fSetAgentRequest\x12\x35\n\x05\x61gent\x18\x01 \x01(\x0b\x32!.google.cloud.dialogflow.v2.AgentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"M\n\x12\x44\x65leteAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\"z\n\x13SearchAgentsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x03 \x01(\t\"b\n\x14SearchAgentsResponse\x12\x31\n\x06\x61gents\x18\x01 \x03(\x0b\x32!.google.cloud.dialogflow.v2.Agent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11TrainAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\"e\n\x12\x45xportAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x16\n\tagent_uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\"L\n\x13\x45xportAgentResponse\x12\x13\n\tagent_uri\x18\x01 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x02 \x01(\x0cH\x00\x42\x07\n\x05\x61gent\"\x84\x01\n\x12ImportAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x13\n\tagent_uri\x18\x02 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x03 \x01(\x0cH\x00\x42\x07\n\x05\x61gent\"\x85\x01\n\x13RestoreAgentRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x13\n\tagent_uri\x18\x02 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x03 \x01(\x0cH\x00\x42\x07\n\x05\x61gent\"q\n\x1aGetValidationResultRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1f\x64ialogflow.googleapis.com/Agent\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x32\xaa\x11\n\x06\x41gents\x12\xb7\x01\n\x08GetAgent\x12+.google.cloud.dialogflow.v2.GetAgentRequest\x1a!.google.cloud.dialogflow.v2.Agent\"[\xda\x41\x06parent\x82\xd3\xe4\x93\x02L\x12\x1d/v2/{parent=projects/*}/agentZ+\x12)/v2/{parent=projects/*/locations/*}/agent\x12\xd0\x01\n\x08SetAgent\x12+.google.cloud.dialogflow.v2.SetAgentRequest\x1a!.google.cloud.dialogflow.v2.Agent\"t\xda\x41\x05\x61gent\x82\xd3\xe4\x93\x02\x66\"#/v2/{agent.parent=projects/*}/agent:\x05\x61gentZ8\"//v2/{agent.parent=projects/*/locations/*}/agent:\x05\x61gent\x12\xb2\x01\n\x0b\x44\x65leteAgent\x12..google.cloud.dialogflow.v2.DeleteAgentRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x06parent\x82\xd3\xe4\x93\x02L*\x1d/v2/{parent=projects/*}/agentZ+*)/v2/{parent=projects/*/locations/*}/agent\x12\xdc\x01\n\x0cSearchAgents\x12/.google.cloud.dialogflow.v2.SearchAgentsRequest\x1a\x30.google.cloud.dialogflow.v2.SearchAgentsResponse\"i\xda\x41\x06parent\x82\xd3\xe4\x93\x02Z\x12$/v2/{parent=projects/*}/agent:searchZ2\x12\x30/v2/{parent=projects/*/locations/*}/agent:search\x12\xfc\x01\n\nTrainAgent\x12-.google.cloud.dialogflow.v2.TrainAgentRequest\x1a\x1d.google.longrunning.Operation\"\x9f\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x06parent\x82\xd3\xe4\x93\x02^\"#/v2/{parent=projects/*}/agent:train:\x01*Z4\"//v2/{parent=projects/*/locations/*}/agent:train:\x01*\x12\x99\x02\n\x0b\x45xportAgent\x12..google.cloud.dialogflow.v2.ExportAgentRequest\x1a\x1d.google.longrunning.Operation\"\xba\x01\xca\x41H\n.google.cloud.dialogflow.v2.ExportAgentResponse\x12\x16google.protobuf.Struct\xda\x41\x06parent\x82\xd3\xe4\x93\x02`\"$/v2/{parent=projects/*}/agent:export:\x01*Z5\"0/v2/{parent=projects/*/locations/*}/agent:export:\x01*\x12\xf7\x01\n\x0bImportAgent\x12..google.cloud.dialogflow.v2.ImportAgentRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02`\"$/v2/{parent=projects/*}/agent:import:\x01*Z5\"0/v2/{parent=projects/*/locations/*}/agent:import:\x01*\x12\xfb\x01\n\x0cRestoreAgent\x12/.google.cloud.dialogflow.v2.RestoreAgentRequest\x1a\x1d.google.longrunning.Operation\"\x9a\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x62\"%/v2/{parent=projects/*}/agent:restore:\x01*Z6\"1/v2/{parent=projects/*/locations/*}/agent:restore:\x01*\x12\xf1\x01\n\x13GetValidationResult\x12\x36.google.cloud.dialogflow.v2.GetValidationResultRequest\x1a,.google.cloud.dialogflow.v2.ValidationResult\"t\x82\xd3\xe4\x93\x02n\x12./v2/{parent=projects/*}/agent/validationResultZ<\x12:/v2/{parent=projects/*/locations/*}/agent/validationResult\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x90\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\nAgentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - Agent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Agent").msgclass - Agent::MatchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Agent.MatchMode").enummodule - Agent::ApiVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Agent.ApiVersion").enummodule - Agent::Tier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Agent.Tier").enummodule - GetAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetAgentRequest").msgclass - SetAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SetAgentRequest").msgclass - DeleteAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteAgentRequest").msgclass - SearchAgentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchAgentsRequest").msgclass - SearchAgentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchAgentsResponse").msgclass - TrainAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TrainAgentRequest").msgclass - ExportAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ExportAgentRequest").msgclass - ExportAgentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ExportAgentResponse").msgclass - ImportAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportAgentRequest").msgclass - RestoreAgentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RestoreAgentRequest").msgclass - GetValidationResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetValidationResultRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_services_pb.rb deleted file mode 100644 index 8f08bfbe6597..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +++ /dev/null @@ -1,144 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/agent.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/agent_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Agents - # Service for managing [Agents][google.cloud.dialogflow.v2.Agent]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Agents' - - # Retrieves the specified agent. - rpc :GetAgent, ::Google::Cloud::Dialogflow::V2::GetAgentRequest, ::Google::Cloud::Dialogflow::V2::Agent - # Creates/updates the specified agent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :SetAgent, ::Google::Cloud::Dialogflow::V2::SetAgentRequest, ::Google::Cloud::Dialogflow::V2::Agent - # Deletes the specified agent. - rpc :DeleteAgent, ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, ::Google::Protobuf::Empty - # Returns the list of agents. - # - # Since there is at most one conversational agent per project, this method is - # useful primarily for listing all agents across projects the caller has - # access to. One can achieve that with a wildcard project collection id "-". - # Refer to [List - # Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). - rpc :SearchAgents, ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse - # Trains the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :TrainAgent, ::Google::Cloud::Dialogflow::V2::TrainAgentRequest, ::Google::Longrunning::Operation - # Exports the specified agent to a ZIP file. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse] - rpc :ExportAgent, ::Google::Cloud::Dialogflow::V2::ExportAgentRequest, ::Google::Longrunning::Operation - # Imports the specified agent from a ZIP file. - # - # Uploads new intents and entity types without deleting the existing ones. - # Intents and entity types with the same name are replaced with the new - # versions from - # [ImportAgentRequest][google.cloud.dialogflow.v2.ImportAgentRequest]. After - # the import, the imported draft agent will be trained automatically (unless - # disabled in agent settings). However, once the import is done, training may - # not be completed yet. Please call - # [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the - # operation it returns in order to train explicitly. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # The operation only tracks when importing is complete, not when it is done - # training. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :ImportAgent, ::Google::Cloud::Dialogflow::V2::ImportAgentRequest, ::Google::Longrunning::Operation - # Restores the specified agent from a ZIP file. - # - # Replaces the current agent version with a new one. All the intents and - # entity types in the older version are deleted. After the restore, the - # restored draft agent will be trained automatically (unless disabled in - # agent settings). However, once the restore is done, training may not be - # completed yet. Please call - # [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the - # operation it returns in order to train explicitly. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # The operation only tracks when restoring is complete, not when it is done - # training. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :RestoreAgent, ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, ::Google::Longrunning::Operation - # Gets agent validation result. Agent validation is performed during - # training time and is updated automatically when training is completed. - rpc :GetValidationResult, ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest, ::Google::Cloud::Dialogflow::V2::ValidationResult - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents.rb deleted file mode 100644 index cdb5cbaa5ff6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/agents/credentials" -require "google/cloud/dialogflow/v2/agents/paths" -require "google/cloud/dialogflow/v2/agents/operations" -require "google/cloud/dialogflow/v2/agents/client" -require "google/cloud/dialogflow/v2/agents/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Agent Agents}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/agents" - # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/agents/rest" - # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - module Agents - end - end - end - end -end - -helper_path = ::File.join __dir__, "agents", "helpers.rb" -require "google/cloud/dialogflow/v2/agents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb deleted file mode 100644 index 621834f6bcd8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/client.rb +++ /dev/null @@ -1,1434 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/agent_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Agents - ## - # Client for the Agents service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Agent Agents}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :agents_stub - - ## - # Configure the Agents Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Agents::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Agents clients - # ::Google::Cloud::Dialogflow::V2::Agents::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Agents 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::Dialogflow::V2::Agents::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 - @agents_stub.universe_domain - end - - ## - # Create a new Agents client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Agents 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/dialogflow/v2/agent_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 - - @agents_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Agents::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 - ) - - @agents_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 = @agents_stub.endpoint - config.universe_domain = @agents_stub.universe_domain - config.logger = @agents_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::Agents::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 - @agents_stub.logger - end - - # Service calls - - ## - # Retrieves the specified agent. - # - # @overload get_agent(request, options = nil) - # Pass arguments to `get_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil) - # Pass arguments to `get_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to fetch is associated with. - # Format: `projects/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Agent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Agent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new - # - # # Call the get_agent method. - # result = client.get_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. - # p result - # - def get_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetAgentRequest - - # Converts hash and nil to 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_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.get_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :get_agent, 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/updates the specified agent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload set_agent(request, options = nil) - # Pass arguments to `set_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SetAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SetAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_agent(agent: nil, update_mask: nil) - # Pass arguments to `set_agent` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param agent [::Google::Cloud::Dialogflow::V2::Agent, ::Hash] - # Required. The agent to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Agent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Agent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new - # - # # Call the set_agent method. - # result = client.set_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. - # p result - # - def set_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SetAgentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.agent&.parent - header_params["agent.parent"] = request.agent.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.set_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :set_agent, 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 specified agent. - # - # @overload delete_agent(request, options = nil) - # Pass arguments to `delete_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil) - # Pass arguments to `delete_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to delete is associated with. - # Format: `projects/`. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new - # - # # Call the delete_agent method. - # result = client.delete_agent request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest - - # Converts hash and nil to 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_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.delete_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :delete_agent, 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 - - ## - # Returns the list of agents. - # - # Since there is at most one conversational agent per project, this method is - # useful primarily for listing all agents across projects the caller has - # access to. One can achieve that with a wildcard project collection id "-". - # Refer to [List - # Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). - # - # @overload search_agents(request, options = nil) - # Pass arguments to `search_agents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SearchAgentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agents(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_agents` via keyword arguments. Note that at - # least one keyword argument is 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 project to list agents from. - # Format: `projects/`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new - # - # # Call the search_agents method. - # result = client.search_agents 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::Dialogflow::V2::Agent. - # p item - # end - # - def search_agents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest - - # Converts hash and nil to 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_agents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.search_agents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_agents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :search_agents, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @agents_stub, :search_agents, 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 - - ## - # Trains the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload train_agent(request, options = nil) - # Pass arguments to `train_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::TrainAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::TrainAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil) - # Pass arguments to `train_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to train is associated with. - # Format: `projects/`. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new - # - # # Call the train_agent method. - # result = client.train_agent request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::TrainAgentRequest - - # Converts hash and nil to 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_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.train_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.train_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :train_agent, 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 - - ## - # Exports the specified agent to a ZIP file. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse} - # - # @overload export_agent(request, options = nil) - # Pass arguments to `export_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ExportAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ExportAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_agent(parent: nil, agent_uri: nil) - # Pass arguments to `export_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to export is associated with. - # Format: `projects/`. - # @param agent_uri [::String] - # Required. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the agent - # to. The format of this URI must be `gs:///`. If - # left unspecified, the serialized agent is returned inline. - # - # Dialogflow performs a write operation for the Cloud Storage object - # on the caller's behalf, so your request authentication must - # have write permissions for the object. For more information, see - # [Dialogflow access - # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new - # - # # Call the export_agent method. - # result = client.export_agent request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 export_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ExportAgentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.export_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.export_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :export_agent, 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 the specified agent from a ZIP file. - # - # Uploads new intents and entity types without deleting the existing ones. - # Intents and entity types with the same name are replaced with the new - # versions from - # {::Google::Cloud::Dialogflow::V2::ImportAgentRequest ImportAgentRequest}. After - # the import, the imported draft agent will be trained automatically (unless - # disabled in agent settings). However, once the import is done, training may - # not be completed yet. Please call - # {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent TrainAgent} and wait for the - # operation it returns in order to train explicitly. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # The operation only tracks when importing is complete, not when it is done - # training. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload import_agent(request, options = nil) - # Pass arguments to `import_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ImportAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ImportAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil, agent_uri: nil, agent_content: nil) - # Pass arguments to `import_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to import is associated with. - # Format: `projects/`. - # @param agent_uri [::String] - # The URI to a Google Cloud Storage file containing the agent to import. - # Note: The URI must start with "gs://". - # - # Dialogflow performs a read operation for the Cloud Storage object - # on the caller's behalf, so your request authentication must - # have read permissions for the object. For more information, see - # [Dialogflow access - # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). - # - # Note: The following parameters are mutually exclusive: `agent_uri`, `agent_content`. 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 agent_content [::String] - # Zip compressed raw byte content for agent. - # - # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`. 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. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new - # - # # Call the import_agent method. - # result = client.import_agent request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ImportAgentRequest - - # Converts hash and nil to 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_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :import_agent, 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 - - ## - # Restores the specified agent from a ZIP file. - # - # Replaces the current agent version with a new one. All the intents and - # entity types in the older version are deleted. After the restore, the - # restored draft agent will be trained automatically (unless disabled in - # agent settings). However, once the restore is done, training may not be - # completed yet. Please call - # {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent TrainAgent} and wait for the - # operation it returns in order to train explicitly. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # The operation only tracks when restoring is complete, not when it is done - # training. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload restore_agent(request, options = nil) - # Pass arguments to `restore_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::RestoreAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload restore_agent(parent: nil, agent_uri: nil, agent_content: nil) - # Pass arguments to `restore_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to restore is associated with. - # Format: `projects/`. - # @param agent_uri [::String] - # The URI to a Google Cloud Storage file containing the agent to restore. - # Note: The URI must start with "gs://". - # - # Dialogflow performs a read operation for the Cloud Storage object - # on the caller's behalf, so your request authentication must - # have read permissions for the object. For more information, see - # [Dialogflow access - # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). - # - # Note: The following parameters are mutually exclusive: `agent_uri`, `agent_content`. 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 agent_content [::String] - # Zip compressed raw byte content for agent. - # - # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`. 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. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new - # - # # Call the restore_agent method. - # result = client.restore_agent request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 restore_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.restore_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.restore_agent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.restore_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :restore_agent, 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 agent validation result. Agent validation is performed during - # training time and is updated automatically when training is completed. - # - # @overload get_validation_result(request, options = nil) - # Pass arguments to `get_validation_result` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetValidationResultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetValidationResultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_validation_result(parent: nil, language_code: nil) - # Pass arguments to `get_validation_result` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent is associated with. - # Format: `projects/`. - # @param language_code [::String] - # Optional. The language for which you want a validation result. If not - # specified, the agent's default language is used. [Many - # languages](https://cloud.google.com/dialogflow/docs/reference/language) - # are supported. Note: languages must be enabled in the agent before they can - # be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::ValidationResult] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::ValidationResult] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new - # - # # Call the get_validation_result method. - # result = client.get_validation_result request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult. - # p result - # - def get_validation_result request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest - - # Converts hash and nil to 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_validation_result.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.get_validation_result.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_validation_result.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.call_rpc :get_validation_result, 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 Agents API. - # - # This class represents the configuration for Agents, - # 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::Dialogflow::V2::Agents::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_agent to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_agent.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_agent.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::Dialogflow::V2::Agents::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Agents 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :get_agent - ## - # RPC-specific configuration for `set_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :set_agent - ## - # RPC-specific configuration for `delete_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_agent - ## - # RPC-specific configuration for `search_agents` - # @return [::Gapic::Config::Method] - # - attr_reader :search_agents - ## - # RPC-specific configuration for `train_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :train_agent - ## - # RPC-specific configuration for `export_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :export_agent - ## - # RPC-specific configuration for `import_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :import_agent - ## - # RPC-specific configuration for `restore_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_agent - ## - # RPC-specific configuration for `get_validation_result` - # @return [::Gapic::Config::Method] - # - attr_reader :get_validation_result - - # @private - def initialize parent_rpcs = nil - get_agent_config = parent_rpcs.get_agent if parent_rpcs.respond_to? :get_agent - @get_agent = ::Gapic::Config::Method.new get_agent_config - set_agent_config = parent_rpcs.set_agent if parent_rpcs.respond_to? :set_agent - @set_agent = ::Gapic::Config::Method.new set_agent_config - delete_agent_config = parent_rpcs.delete_agent if parent_rpcs.respond_to? :delete_agent - @delete_agent = ::Gapic::Config::Method.new delete_agent_config - search_agents_config = parent_rpcs.search_agents if parent_rpcs.respond_to? :search_agents - @search_agents = ::Gapic::Config::Method.new search_agents_config - train_agent_config = parent_rpcs.train_agent if parent_rpcs.respond_to? :train_agent - @train_agent = ::Gapic::Config::Method.new train_agent_config - export_agent_config = parent_rpcs.export_agent if parent_rpcs.respond_to? :export_agent - @export_agent = ::Gapic::Config::Method.new export_agent_config - import_agent_config = parent_rpcs.import_agent if parent_rpcs.respond_to? :import_agent - @import_agent = ::Gapic::Config::Method.new import_agent_config - restore_agent_config = parent_rpcs.restore_agent if parent_rpcs.respond_to? :restore_agent - @restore_agent = ::Gapic::Config::Method.new restore_agent_config - get_validation_result_config = parent_rpcs.get_validation_result if parent_rpcs.respond_to? :get_validation_result - @get_validation_result = ::Gapic::Config::Method.new get_validation_result_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/credentials.rb deleted file mode 100644 index d21c5742ff94..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Agents - # Credentials for the Agents API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb deleted file mode 100644 index e49c4455fec2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module Agents - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Agents 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 Agents 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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/paths.rb deleted file mode 100644 index 41fa36bb8c2c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/paths.rb +++ /dev/null @@ -1,100 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module Agents - # Path helper methods for the Agents API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # @overload agent_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/agent` - # - # @param project [String] - # - # @overload agent_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def agent_path **args - resources = { - "project" => (proc do |project:| - "projects/#{project}/agent" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent" - 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 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 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest.rb deleted file mode 100644 index 480feaf5ea97..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/agents/credentials" -require "google/cloud/dialogflow/v2/agents/paths" -require "google/cloud/dialogflow/v2/agents/rest/operations" -require "google/cloud/dialogflow/v2/agents/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Agent Agents}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/agents/rest" - # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - module Agents - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/agents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb deleted file mode 100644 index 87e16aca5e23..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +++ /dev/null @@ -1,1336 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/agent_pb" -require "google/cloud/dialogflow/v2/agents/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Agents - module Rest - ## - # REST client for the Agents service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Agent Agents}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :agents_stub - - ## - # Configure the Agents Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Agents::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Agents clients - # ::Google::Cloud::Dialogflow::V2::Agents::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Agents 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::Dialogflow::V2::Agents::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 - @agents_stub.universe_domain - end - - ## - # Create a new Agents REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Agents 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::Dialogflow::V2::Agents::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 - - @agents_stub = ::Google::Cloud::Dialogflow::V2::Agents::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @agents_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 = @agents_stub.endpoint - config.universe_domain = @agents_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @agents_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::Agents::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 - @agents_stub.logger - end - - # Service calls - - ## - # Retrieves the specified agent. - # - # @overload get_agent(request, options = nil) - # Pass arguments to `get_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil) - # Pass arguments to `get_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to fetch is associated with. - # Format: `projects/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Agent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new - # - # # Call the get_agent method. - # result = client.get_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. - # p result - # - def get_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetAgentRequest - - # Converts hash and nil to an 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_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.get_agent 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/updates the specified agent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload set_agent(request, options = nil) - # Pass arguments to `set_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SetAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SetAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_agent(agent: nil, update_mask: nil) - # Pass arguments to `set_agent` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param agent [::Google::Cloud::Dialogflow::V2::Agent, ::Hash] - # Required. The agent to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Agent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new - # - # # Call the set_agent method. - # result = client.set_agent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. - # p result - # - def set_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SetAgentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.set_agent 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 specified agent. - # - # @overload delete_agent(request, options = nil) - # Pass arguments to `delete_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil) - # Pass arguments to `delete_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to delete is associated with. - # Format: `projects/`. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new - # - # # Call the delete_agent method. - # result = client.delete_agent request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest - - # Converts hash and nil to an 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_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.delete_agent 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 - - ## - # Returns the list of agents. - # - # Since there is at most one conversational agent per project, this method is - # useful primarily for listing all agents across projects the caller has - # access to. One can achieve that with a wildcard project collection id "-". - # Refer to [List - # Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). - # - # @overload search_agents(request, options = nil) - # Pass arguments to `search_agents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SearchAgentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agents(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_agents` via keyword arguments. Note that at - # least one keyword argument is 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 project to list agents from. - # Format: `projects/`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new - # - # # Call the search_agents method. - # result = client.search_agents 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::Dialogflow::V2::Agent. - # p item - # end - # - def search_agents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest - - # Converts hash and nil to an 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_agents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_agents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.search_agents request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @agents_stub, :search_agents, "agents", 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 - - ## - # Trains the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload train_agent(request, options = nil) - # Pass arguments to `train_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::TrainAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::TrainAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil) - # Pass arguments to `train_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to train is associated with. - # Format: `projects/`. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new - # - # # Call the train_agent method. - # result = client.train_agent request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::TrainAgentRequest - - # Converts hash and nil to an 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_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.train_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.train_agent 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 - - ## - # Exports the specified agent to a ZIP file. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse} - # - # @overload export_agent(request, options = nil) - # Pass arguments to `export_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ExportAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ExportAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_agent(parent: nil, agent_uri: nil) - # Pass arguments to `export_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to export is associated with. - # Format: `projects/`. - # @param agent_uri [::String] - # Required. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the agent - # to. The format of this URI must be `gs:///`. If - # left unspecified, the serialized agent is returned inline. - # - # Dialogflow performs a write operation for the Cloud Storage object - # on the caller's behalf, so your request authentication must - # have write permissions for the object. For more information, see - # [Dialogflow access - # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new - # - # # Call the export_agent method. - # result = client.export_agent request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 export_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ExportAgentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.export_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.export_agent 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 the specified agent from a ZIP file. - # - # Uploads new intents and entity types without deleting the existing ones. - # Intents and entity types with the same name are replaced with the new - # versions from - # {::Google::Cloud::Dialogflow::V2::ImportAgentRequest ImportAgentRequest}. After - # the import, the imported draft agent will be trained automatically (unless - # disabled in agent settings). However, once the import is done, training may - # not be completed yet. Please call - # {::Google::Cloud::Dialogflow::V2::Agents::Rest::Client#train_agent TrainAgent} and wait for the - # operation it returns in order to train explicitly. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # The operation only tracks when importing is complete, not when it is done - # training. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload import_agent(request, options = nil) - # Pass arguments to `import_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ImportAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ImportAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_agent(parent: nil, agent_uri: nil, agent_content: nil) - # Pass arguments to `import_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to import is associated with. - # Format: `projects/`. - # @param agent_uri [::String] - # The URI to a Google Cloud Storage file containing the agent to import. - # Note: The URI must start with "gs://". - # - # Dialogflow performs a read operation for the Cloud Storage object - # on the caller's behalf, so your request authentication must - # have read permissions for the object. For more information, see - # [Dialogflow access - # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). - # - # Note: The following parameters are mutually exclusive: `agent_uri`, `agent_content`. 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 agent_content [::String] - # Zip compressed raw byte content for agent. - # - # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`. 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. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new - # - # # Call the import_agent method. - # result = client.import_agent request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ImportAgentRequest - - # Converts hash and nil to an 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_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.import_agent 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 - - ## - # Restores the specified agent from a ZIP file. - # - # Replaces the current agent version with a new one. All the intents and - # entity types in the older version are deleted. After the restore, the - # restored draft agent will be trained automatically (unless disabled in - # agent settings). However, once the restore is done, training may not be - # completed yet. Please call - # {::Google::Cloud::Dialogflow::V2::Agents::Rest::Client#train_agent TrainAgent} and wait for the - # operation it returns in order to train explicitly. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # The operation only tracks when restoring is complete, not when it is done - # training. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload restore_agent(request, options = nil) - # Pass arguments to `restore_agent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::RestoreAgentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload restore_agent(parent: nil, agent_uri: nil, agent_content: nil) - # Pass arguments to `restore_agent` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent to restore is associated with. - # Format: `projects/`. - # @param agent_uri [::String] - # The URI to a Google Cloud Storage file containing the agent to restore. - # Note: The URI must start with "gs://". - # - # Dialogflow performs a read operation for the Cloud Storage object - # on the caller's behalf, so your request authentication must - # have read permissions for the object. For more information, see - # [Dialogflow access - # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). - # - # Note: The following parameters are mutually exclusive: `agent_uri`, `agent_content`. 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 agent_content [::String] - # Zip compressed raw byte content for agent. - # - # Note: The following parameters are mutually exclusive: `agent_content`, `agent_uri`. 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. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new - # - # # Call the restore_agent method. - # result = client.restore_agent request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 restore_agent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.restore_agent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.restore_agent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.restore_agent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.restore_agent 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 agent validation result. Agent validation is performed during - # training time and is updated automatically when training is completed. - # - # @overload get_validation_result(request, options = nil) - # Pass arguments to `get_validation_result` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetValidationResultRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetValidationResultRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_validation_result(parent: nil, language_code: nil) - # Pass arguments to `get_validation_result` via keyword arguments. Note that at - # least one keyword argument is 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 project that the agent is associated with. - # Format: `projects/`. - # @param language_code [::String] - # Optional. The language for which you want a validation result. If not - # specified, the agent's default language is used. [Many - # languages](https://cloud.google.com/dialogflow/docs/reference/language) - # are supported. Note: languages must be enabled in the agent before they can - # be used. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::ValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ValidationResult] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new - # - # # Call the get_validation_result method. - # result = client.get_validation_result request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult. - # p result - # - def get_validation_result request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest - - # Converts hash and nil to an 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_validation_result.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_validation_result.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_validation_result.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @agents_stub.get_validation_result 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 Agents REST API. - # - # This class represents the configuration for Agents 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::Dialogflow::V2::Agents::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_agent to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_agent.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_agent.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Agents 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :get_agent - ## - # RPC-specific configuration for `set_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :set_agent - ## - # RPC-specific configuration for `delete_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_agent - ## - # RPC-specific configuration for `search_agents` - # @return [::Gapic::Config::Method] - # - attr_reader :search_agents - ## - # RPC-specific configuration for `train_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :train_agent - ## - # RPC-specific configuration for `export_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :export_agent - ## - # RPC-specific configuration for `import_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :import_agent - ## - # RPC-specific configuration for `restore_agent` - # @return [::Gapic::Config::Method] - # - attr_reader :restore_agent - ## - # RPC-specific configuration for `get_validation_result` - # @return [::Gapic::Config::Method] - # - attr_reader :get_validation_result - - # @private - def initialize parent_rpcs = nil - get_agent_config = parent_rpcs.get_agent if parent_rpcs.respond_to? :get_agent - @get_agent = ::Gapic::Config::Method.new get_agent_config - set_agent_config = parent_rpcs.set_agent if parent_rpcs.respond_to? :set_agent - @set_agent = ::Gapic::Config::Method.new set_agent_config - delete_agent_config = parent_rpcs.delete_agent if parent_rpcs.respond_to? :delete_agent - @delete_agent = ::Gapic::Config::Method.new delete_agent_config - search_agents_config = parent_rpcs.search_agents if parent_rpcs.respond_to? :search_agents - @search_agents = ::Gapic::Config::Method.new search_agents_config - train_agent_config = parent_rpcs.train_agent if parent_rpcs.respond_to? :train_agent - @train_agent = ::Gapic::Config::Method.new train_agent_config - export_agent_config = parent_rpcs.export_agent if parent_rpcs.respond_to? :export_agent - @export_agent = ::Gapic::Config::Method.new export_agent_config - import_agent_config = parent_rpcs.import_agent if parent_rpcs.respond_to? :import_agent - @import_agent = ::Gapic::Config::Method.new import_agent_config - restore_agent_config = parent_rpcs.restore_agent if parent_rpcs.respond_to? :restore_agent - @restore_agent = ::Gapic::Config::Method.new restore_agent_config - get_validation_result_config = parent_rpcs.get_validation_result if parent_rpcs.respond_to? :get_validation_result - @get_validation_result = ::Gapic::Config::Method.new get_validation_result_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb deleted file mode 100644 index c6122f5ebd0b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb +++ /dev/null @@ -1,947 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module Agents - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Agents 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 Agents 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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb deleted file mode 100644 index 01cf87318d60..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb +++ /dev/null @@ -1,703 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/agent_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Agents - module Rest - ## - # REST service stub for the Agents 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_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Agent] - # A result object deserialized from the server's reply - def get_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_agent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_agent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Agent.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SetAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Agent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Agent] - # A result object deserialized from the server's reply - def set_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_agent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_agent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Agent.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_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_agent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_agent", - 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 search_agents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchAgentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SearchAgentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SearchAgentsResponse] - # A result object deserialized from the server's reply - def search_agents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_agents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_agents", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the train_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::TrainAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_train_agent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_agent", - 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 export_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ExportAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 export_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_agent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "export_agent", - 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_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ImportAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_agent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_agent", - 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 restore_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::RestoreAgentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 restore_agent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_restore_agent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "restore_agent", - 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_validation_result REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetValidationResultRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ValidationResult] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ValidationResult] - # A result object deserialized from the server's reply - def get_validation_result request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_validation_result_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_validation_result", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ValidationResult.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_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetAgentRequest] - # 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_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/agent", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/agent", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SetAgentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{agent.parent}/agent", - body: "agent", - matches: [ - ["agent.parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{agent.parent}/agent", - body: "agent", - matches: [ - ["agent.parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteAgentRequest] - # 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_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{parent}/agent", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{parent}/agent", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_agents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchAgentsRequest] - # 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_agents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/agent:search", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/agent:search", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the train_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::TrainAgentRequest] - # 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_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/agent:train", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/agent:train", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ExportAgentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/agent:export", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/agent:export", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ImportAgentRequest] - # 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_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/agent:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/agent:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the restore_agent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::RestoreAgentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_restore_agent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/agent:restore", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/agent:restore", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_validation_result REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetValidationResultRequest] - # 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_validation_result_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/agent/validationResult", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/agent/validationResult", - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_pb.rb deleted file mode 100644 index a12040efe143..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/answer_record.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/dialogflow/v2/generator_pb' -require 'google/cloud/dialogflow/v2/participant_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n.google/cloud/dialogflow/v2/answer_record.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf1\x02\n\x0c\x41nswerRecord\x12\x0c\n\x04name\x18\x01 \x01(\t\x12H\n\x0f\x61nswer_feedback\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.v2.AnswerFeedbackB\x03\xe0\x41\x02\x12W\n\x16\x61gent_assistant_record\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.AgentAssistantRecordB\x03\xe0\x41\x03H\x00:\xa5\x01\xea\x41\xa1\x01\n&dialogflow.googleapis.com/AnswerRecord\x12\x30projects/{project}/answerRecords/{answer_record}\x12\x45projects/{project}/locations/{location}/answerRecords/{answer_record}B\x08\n\x06record\"\xa0\x01\n\x18ListAnswerRecordsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/AnswerRecord\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"v\n\x19ListAnswerRecordsResponse\x12@\n\x0e\x61nswer_records\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.AnswerRecord\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x97\x01\n\x19UpdateAnswerRecordRequest\x12\x44\n\ranswer_record\x18\x01 \x01(\x0b\x32(.google.cloud.dialogflow.v2.AnswerRecordB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xd2\x03\n\x0e\x41nswerFeedback\x12V\n\x11\x63orrectness_level\x18\x01 \x01(\x0e\x32;.google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel\x12]\n\x1f\x61gent_assistant_detail_feedback\x18\x02 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.AgentAssistantFeedbackH\x00\x12\x0f\n\x07\x63licked\x18\x03 \x01(\x08\x12.\n\nclick_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x11\n\tdisplayed\x18\x04 \x01(\x08\x12\x30\n\x0c\x64isplay_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"p\n\x10\x43orrectnessLevel\x12!\n\x1d\x43ORRECTNESS_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNOT_CORRECT\x10\x01\x12\x15\n\x11PARTIALLY_CORRECT\x10\x02\x12\x11\n\rFULLY_CORRECT\x10\x03\x42\x11\n\x0f\x64\x65tail_feedback\"\xfb\n\n\x16\x41gentAssistantFeedback\x12\x61\n\x10\x61nswer_relevance\x18\x01 \x01(\x0e\x32\x42.google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevanceB\x03\xe0\x41\x01\x12i\n\x14\x64ocument_correctness\x18\x02 \x01(\x0e\x32\x46.google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectnessB\x03\xe0\x41\x01\x12g\n\x13\x64ocument_efficiency\x18\x03 \x01(\x0e\x32\x45.google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiencyB\x03\xe0\x41\x01\x12m\n\x16summarization_feedback\x18\x04 \x01(\x0b\x32H.google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedbackB\x03\xe0\x41\x01\x12r\n\x19knowledge_search_feedback\x18\x05 \x01(\x0b\x32J.google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedbackB\x03\xe0\x41\x01\x12r\n\x19knowledge_assist_feedback\x18\x06 \x01(\x0b\x32J.google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedbackB\x03\xe0\x41\x01\x1a\xbb\x02\n\x15SummarizationFeedback\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0csummary_text\x18\x03 \x01(\t\x12v\n\rtext_sections\x18\x04 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback.TextSectionsEntryB\x03\xe0\x41\x01\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x46\n\x17KnowledgeSearchFeedback\x12\x15\n\ranswer_copied\x18\x01 \x01(\x08\x12\x14\n\x0c\x63licked_uris\x18\x02 \x03(\t\x1a\x46\n\x17KnowledgeAssistFeedback\x12\x15\n\ranswer_copied\x18\x01 \x01(\x08\x12\x14\n\x0c\x63licked_uris\x18\x02 \x03(\t\"Q\n\x0f\x41nswerRelevance\x12 \n\x1c\x41NSWER_RELEVANCE_UNSPECIFIED\x10\x00\x12\x0e\n\nIRRELEVANT\x10\x01\x12\x0c\n\x08RELEVANT\x10\x02\"W\n\x13\x44ocumentCorrectness\x12$\n DOCUMENT_CORRECTNESS_UNSPECIFIED\x10\x00\x12\r\n\tINCORRECT\x10\x01\x12\x0b\n\x07\x43ORRECT\x10\x02\"Y\n\x12\x44ocumentEfficiency\x12#\n\x1f\x44OCUMENT_EFFICIENCY_UNSPECIFIED\x10\x00\x12\x0f\n\x0bINEFFICIENT\x10\x01\x12\r\n\tEFFICIENT\x10\x02\"\xea\x02\n\x14\x41gentAssistantRecord\x12S\n\x19\x61rticle_suggestion_answer\x18\x05 \x01(\x0b\x32).google.cloud.dialogflow.v2.ArticleAnswerB\x03\xe0\x41\x03H\x00\x12@\n\nfaq_answer\x18\x06 \x01(\x0b\x32%.google.cloud.dialogflow.v2.FaqAnswerB\x03\xe0\x41\x03H\x00\x12[\n\x18\x64ialogflow_assist_answer\x18\x07 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.DialogflowAssistAnswerB\x03\xe0\x41\x03H\x00\x12T\n\x14generator_suggestion\x18\x08 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xe0\x41\x03H\x00\x42\x08\n\x06\x61nswer2\xad\x05\n\rAnswerRecords\x12\xed\x01\n\x11ListAnswerRecords\x12\x34.google.cloud.dialogflow.v2.ListAnswerRecordsRequest\x1a\x35.google.cloud.dialogflow.v2.ListAnswerRecordsResponse\"k\xda\x41\x06parent\x82\xd3\xe4\x93\x02\\\x12%/v2/{parent=projects/*}/answerRecordsZ3\x12\x31/v2/{parent=projects/*/locations/*}/answerRecords\x12\xb1\x02\n\x12UpdateAnswerRecord\x12\x35.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest\x1a(.google.cloud.dialogflow.v2.AnswerRecord\"\xb9\x01\xda\x41\x19\x61nswer_record,update_mask\x82\xd3\xe4\x93\x02\x96\x01\x32\x33/v2/{answer_record.name=projects/*/answerRecords/*}:\ranswer_recordZP2?/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}:\ranswer_record\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x98\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x12\x41nswerRecordsProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - AnswerRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnswerRecord").msgclass - ListAnswerRecordsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListAnswerRecordsRequest").msgclass - ListAnswerRecordsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListAnswerRecordsResponse").msgclass - UpdateAnswerRecordRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateAnswerRecordRequest").msgclass - AnswerFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnswerFeedback").msgclass - AnswerFeedback::CorrectnessLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel").enummodule - AgentAssistantFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback").msgclass - AgentAssistantFeedback::SummarizationFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.SummarizationFeedback").msgclass - AgentAssistantFeedback::KnowledgeSearchFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeSearchFeedback").msgclass - AgentAssistantFeedback::KnowledgeAssistFeedback = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.KnowledgeAssistFeedback").msgclass - AgentAssistantFeedback::AnswerRelevance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance").enummodule - AgentAssistantFeedback::DocumentCorrectness = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness").enummodule - AgentAssistantFeedback::DocumentEfficiency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency").enummodule - AgentAssistantRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentAssistantRecord").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb deleted file mode 100644 index 1aaf2c61052d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/answer_record.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/answer_record_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module AnswerRecords - # Service for managing - # [AnswerRecords][google.cloud.dialogflow.v2.AnswerRecord]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.AnswerRecords' - - # Returns the list of all answer records in the specified project in reverse - # chronological order. - rpc :ListAnswerRecords, ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest, ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse - # Updates the specified answer record. - rpc :UpdateAnswerRecord, ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest, ::Google::Cloud::Dialogflow::V2::AnswerRecord - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records.rb deleted file mode 100644 index 26fd3ddefaa5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/answer_records/credentials" -require "google/cloud/dialogflow/v2/answer_records/paths" -require "google/cloud/dialogflow/v2/answer_records/client" -require "google/cloud/dialogflow/v2/answer_records/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/answer_records" - # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/answer_records/rest" - # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new - # - module AnswerRecords - end - end - end - end -end - -helper_path = ::File.join __dir__, "answer_records", "helpers.rb" -require "google/cloud/dialogflow/v2/answer_records/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb deleted file mode 100644 index b0d532d92742..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/client.rb +++ /dev/null @@ -1,627 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/answer_record_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module AnswerRecords - ## - # Client for the AnswerRecords service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :answer_records_stub - - ## - # Configure the AnswerRecords Client class. - # - # See {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AnswerRecords clients - # ::Google::Cloud::Dialogflow::V2::AnswerRecords::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AnswerRecords 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::Dialogflow::V2::AnswerRecords::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 - @answer_records_stub.universe_domain - end - - ## - # Create a new AnswerRecords client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AnswerRecords 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/dialogflow/v2/answer_record_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 - - @answer_records_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::AnswerRecords::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 - ) - - @answer_records_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 = @answer_records_stub.endpoint - config.universe_domain = @answer_records_stub.universe_domain - config.logger = @answer_records_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 - @answer_records_stub.logger - end - - # Service calls - - ## - # Returns the list of all answer records in the specified project in reverse - # chronological order. - # - # @overload list_answer_records(request, options = nil) - # Pass arguments to `list_answer_records` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_answer_records(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_answer_records` via keyword arguments. Note that at - # least one keyword argument is 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 project to list all answer records for in reverse - # chronological order. Format: `projects//locations/`. - # @param filter [::String] - # Optional. Filters to restrict results to specific answer records. The - # expression has the following syntax: - # - # [AND ] ... - # - # The following fields and operators are supported: - # * conversation_id with equals(=) operator - # - # Examples: - # - # * `conversation_id=bar` matches answer records in the - # `projects/foo/locations/global/conversations/bar` conversation - # (assuming the parent is `projects/foo/locations/global`). - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param page_size [::Integer] - # Optional. The maximum number of records to return in a single page. - # The server may return fewer records than this. If unspecified, we use 10. - # The maximum is 100. - # @param page_token [::String] - # Optional. The - # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse#next_page_token ListAnswerRecordsResponse.next_page_token} - # value returned from a previous list request used to continue listing on - # the next page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new - # - # # Call the list_answer_records method. - # result = client.list_answer_records 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::Dialogflow::V2::AnswerRecord. - # p item - # end - # - def list_answer_records request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest - - # Converts hash and nil to 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_answer_records.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_answer_records.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_answer_records.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @answer_records_stub.call_rpc :list_answer_records, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @answer_records_stub, :list_answer_records, 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 specified answer record. - # - # @overload update_answer_record(request, options = nil) - # Pass arguments to `update_answer_record` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_answer_record(answer_record: nil, update_mask: nil) - # Pass arguments to `update_answer_record` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param answer_record [::Google::Cloud::Dialogflow::V2::AnswerRecord, ::Hash] - # Required. Answer record to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::AnswerRecord] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new - # - # # Call the update_answer_record method. - # result = client.update_answer_record request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::AnswerRecord. - # p result - # - def update_answer_record request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest - - # Converts hash and nil to 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_answer_record.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.answer_record&.name - header_params["answer_record.name"] = request.answer_record.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_answer_record.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_answer_record.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @answer_records_stub.call_rpc :update_answer_record, 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 AnswerRecords API. - # - # This class represents the configuration for AnswerRecords, - # 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::Dialogflow::V2::AnswerRecords::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_answer_records to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_answer_records.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_answer_records.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::Dialogflow::V2::AnswerRecords::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 AnswerRecords 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_answer_records` - # @return [::Gapic::Config::Method] - # - attr_reader :list_answer_records - ## - # RPC-specific configuration for `update_answer_record` - # @return [::Gapic::Config::Method] - # - attr_reader :update_answer_record - - # @private - def initialize parent_rpcs = nil - list_answer_records_config = parent_rpcs.list_answer_records if parent_rpcs.respond_to? :list_answer_records - @list_answer_records = ::Gapic::Config::Method.new list_answer_records_config - update_answer_record_config = parent_rpcs.update_answer_record if parent_rpcs.respond_to? :update_answer_record - @update_answer_record = ::Gapic::Config::Method.new update_answer_record_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb deleted file mode 100644 index 139ae2fe607b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module AnswerRecords - # Credentials for the AnswerRecords API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/paths.rb deleted file mode 100644 index 2de5551d2c3e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/paths.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! - - -module Google - module Cloud - module Dialogflow - module V2 - module AnswerRecords - # Path helper methods for the AnswerRecords API. - module Paths - ## - # Create a fully-qualified AnswerRecord resource string. - # - # @overload answer_record_path(project:, answer_record:) - # The resource will be in the following format: - # - # `projects/{project}/answerRecords/{answer_record}` - # - # @param project [String] - # @param answer_record [String] - # - # @overload answer_record_path(project:, location:, answer_record:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/answerRecords/{answer_record}` - # - # @param project [String] - # @param location [String] - # @param answer_record [String] - # - # @return [::String] - def answer_record_path **args - resources = { - "answer_record:project" => (proc do |project:, answer_record:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/answerRecords/#{answer_record}" - end), - "answer_record:location:project" => (proc do |project:, location:, answer_record:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/answerRecords/#{answer_record}" - 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 App resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # - # @return [::String] - def app_path project:, location:, app: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}" - end - - ## - # Create a fully-qualified Context resource string. - # - # @overload context_path(project:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @return [::String] - def context_path **args - resources = { - "context:project:session" => (proc do |project:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - end), - "context:location:project:session" => (proc do |project:, location:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - 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 Intent resource string. - # - # @overload intent_path(project:, intent:) - # The resource will be in the following format: - # - # `projects/{project}/agent/intents/{intent}` - # - # @param project [String] - # @param intent [String] - # - # @overload intent_path(project:, location:, intent:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/intents/{intent}` - # - # @param project [String] - # @param location [String] - # @param intent [String] - # - # @return [::String] - def intent_path **args - resources = { - "intent:project" => (proc do |project:, intent:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/agent/intents/#{intent}" - end), - "intent:location:project" => (proc do |project:, location:, intent:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/intents/#{intent}" - 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 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 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 - - ## - # Create a fully-qualified Tool resource string. - # - # @overload tool_path(project:, location:, tool:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param tool [String] - # - # @overload tool_path(project:, location:, app:, tool:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # @param tool [String] - # - # @return [::String] - def tool_path **args - resources = { - "location:project:tool" => (proc do |project:, location:, tool:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/tools/#{tool}" - end), - "app:location:project:tool" => (proc do |project:, location:, app:, tool:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}" - 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 Toolset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # @param toolset [String] - # - # @return [::String] - def toolset_path project:, location:, app:, toolset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest.rb deleted file mode 100644 index 27a1f9a77417..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/answer_records/credentials" -require "google/cloud/dialogflow/v2/answer_records/paths" -require "google/cloud/dialogflow/v2/answer_records/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/answer_records/rest" - # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new - # - module AnswerRecords - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/answer_records/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb deleted file mode 100644 index d35526a8663f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +++ /dev/null @@ -1,578 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/answer_record_pb" -require "google/cloud/dialogflow/v2/answer_records/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module AnswerRecords - module Rest - ## - # REST client for the AnswerRecords service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :answer_records_stub - - ## - # Configure the AnswerRecords Client class. - # - # See {::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AnswerRecords clients - # ::Google::Cloud::Dialogflow::V2::AnswerRecords::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AnswerRecords 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::Dialogflow::V2::AnswerRecords::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 - @answer_records_stub.universe_domain - end - - ## - # Create a new AnswerRecords REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AnswerRecords 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 - - @answer_records_stub = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @answer_records_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 = @answer_records_stub.endpoint - config.universe_domain = @answer_records_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @answer_records_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 - @answer_records_stub.logger - end - - # Service calls - - ## - # Returns the list of all answer records in the specified project in reverse - # chronological order. - # - # @overload list_answer_records(request, options = nil) - # Pass arguments to `list_answer_records` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_answer_records(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_answer_records` via keyword arguments. Note that at - # least one keyword argument is 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 project to list all answer records for in reverse - # chronological order. Format: `projects//locations/`. - # @param filter [::String] - # Optional. Filters to restrict results to specific answer records. The - # expression has the following syntax: - # - # [AND ] ... - # - # The following fields and operators are supported: - # * conversation_id with equals(=) operator - # - # Examples: - # - # * `conversation_id=bar` matches answer records in the - # `projects/foo/locations/global/conversations/bar` conversation - # (assuming the parent is `projects/foo/locations/global`). - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param page_size [::Integer] - # Optional. The maximum number of records to return in a single page. - # The server may return fewer records than this. If unspecified, we use 10. - # The maximum is 100. - # @param page_token [::String] - # Optional. The - # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse#next_page_token ListAnswerRecordsResponse.next_page_token} - # value returned from a previous list request used to continue listing on - # the next page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new - # - # # Call the list_answer_records method. - # result = client.list_answer_records 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::Dialogflow::V2::AnswerRecord. - # p item - # end - # - def list_answer_records request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest - - # Converts hash and nil to an 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_answer_records.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_answer_records.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_answer_records.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @answer_records_stub.list_answer_records request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @answer_records_stub, :list_answer_records, "answer_records", 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 specified answer record. - # - # @overload update_answer_record(request, options = nil) - # Pass arguments to `update_answer_record` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_answer_record(answer_record: nil, update_mask: nil) - # Pass arguments to `update_answer_record` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param answer_record [::Google::Cloud::Dialogflow::V2::AnswerRecord, ::Hash] - # Required. Answer record to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::AnswerRecord] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new - # - # # Call the update_answer_record method. - # result = client.update_answer_record request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::AnswerRecord. - # p result - # - def update_answer_record request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest - - # Converts hash and nil to an 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_answer_record.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_answer_record.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_answer_record.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @answer_records_stub.update_answer_record 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 AnswerRecords REST API. - # - # This class represents the configuration for AnswerRecords 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::Dialogflow::V2::AnswerRecords::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_answer_records to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_answer_records.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_answer_records.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 AnswerRecords 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_answer_records` - # @return [::Gapic::Config::Method] - # - attr_reader :list_answer_records - ## - # RPC-specific configuration for `update_answer_record` - # @return [::Gapic::Config::Method] - # - attr_reader :update_answer_record - - # @private - def initialize parent_rpcs = nil - list_answer_records_config = parent_rpcs.list_answer_records if parent_rpcs.respond_to? :list_answer_records - @list_answer_records = ::Gapic::Config::Method.new list_answer_records_config - update_answer_record_config = parent_rpcs.update_answer_record if parent_rpcs.respond_to? :update_answer_record - @update_answer_record = ::Gapic::Config::Method.new update_answer_record_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb deleted file mode 100644 index 08f8037ff523..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb +++ /dev/null @@ -1,219 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/answer_record_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module AnswerRecords - module Rest - ## - # REST service stub for the AnswerRecords 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_answer_records REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListAnswerRecordsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse] - # A result object deserialized from the server's reply - def list_answer_records request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_answer_records_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_answer_records", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse.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_answer_record REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::AnswerRecord] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord] - # A result object deserialized from the server's reply - def update_answer_record request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_answer_record_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_answer_record", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::AnswerRecord.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_answer_records REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest] - # 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_answer_records_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/answerRecords", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/answerRecords", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_answer_record REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest] - # 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_answer_record_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{answer_record.name}", - body: "answer_record", - matches: [ - ["answer_record.name", %r{^projects/[^/]+/answerRecords/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{answer_record.name}", - body: "answer_record", - matches: [ - ["answer_record.name", %r{^projects/[^/]+/locations/[^/]+/answerRecords/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb deleted file mode 100644 index dfbd9ef236e2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/audio_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' - - -descriptor_data = "\n-google/cloud/dialogflow/v2/audio_config.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\"9\n\rSpeechContext\x12\x14\n\x07phrases\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x62oost\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\"\x92\x01\n\x0eSpeechWordInfo\x12\x0c\n\x04word\x18\x03 \x01(\t\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xb6\x04\n\x10InputAudioConfig\x12\x46\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32).google.cloud.dialogflow.v2.AudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x10\x65nable_word_info\x18\r \x01(\x08\x12\x18\n\x0cphrase_hints\x18\x04 \x03(\tB\x02\x18\x01\x12\x42\n\x0fspeech_contexts\x18\x0b \x03(\x0b\x32).google.cloud.dialogflow.v2.SpeechContext\x12\r\n\x05model\x18\x07 \x01(\t\x12\x45\n\rmodel_variant\x18\n \x01(\x0e\x32..google.cloud.dialogflow.v2.SpeechModelVariant\x12\x18\n\x10single_utterance\x18\x08 \x01(\x08\x12*\n\"disable_no_speech_recognized_event\x18\x0e \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x11 \x01(\x08\x12\x39\n\x0bphrase_sets\x18\x14 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12)\n!opt_out_conformer_model_migration\x18\x1a \x01(\x08\"p\n\x14VoiceSelectionParams\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\x0bssml_gender\x18\x02 \x01(\x0e\x32+.google.cloud.dialogflow.v2.SsmlVoiceGenderB\x03\xe0\x41\x01\"\xa0\x02\n\x16SynthesizeSpeechConfig\x12\x1a\n\rspeaking_rate\x18\x01 \x01(\x01\x42\x03\xe0\x41\x01\x12\x12\n\x05pitch\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1b\n\x0evolume_gain_db\x18\x03 \x01(\x01\x42\x03\xe0\x41\x01\x12\x1f\n\x12\x65\x66\x66\x65\x63ts_profile_id\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12\x44\n\x05voice\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.VoiceSelectionParamsB\x03\xe0\x41\x01\x12R\n\x0epronunciations\x18\x06 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.CustomPronunciationParamsB\x03\xe0\x41\x01\"\x96\x02\n\x19\x43ustomPronunciationParams\x12\x0e\n\x06phrase\x18\x01 \x01(\t\x12\x61\n\x11phonetic_encoding\x18\x02 \x01(\x0e\x32\x46.google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding\x12\x15\n\rpronunciation\x18\x03 \x01(\t\"o\n\x10PhoneticEncoding\x12!\n\x1dPHONETIC_ENCODING_UNSPECIFIED\x10\x00\x12\x19\n\x15PHONETIC_ENCODING_IPA\x10\x01\x12\x1d\n\x19PHONETIC_ENCODING_X_SAMPA\x10\x02\"\xd2\x01\n\x11OutputAudioConfig\x12L\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32/.google.cloud.dialogflow.v2.OutputAudioEncodingB\x03\xe0\x41\x02\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12T\n\x18synthesize_speech_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig\"U\n\x13TelephonyDtmfEvents\x12>\n\x0b\x64tmf_events\x18\x01 \x03(\x0e\x32).google.cloud.dialogflow.v2.TelephonyDtmf\"\xe2\x02\n\x12SpeechToTextConfig\x12L\n\x14speech_model_variant\x18\x01 \x01(\x0e\x32..google.cloud.dialogflow.v2.SpeechModelVariant\x12\r\n\x05model\x18\x02 \x01(\t\x12\x39\n\x0bphrase_sets\x18\x04 \x03(\tB$\xfa\x41!\n\x1fspeech.googleapis.com/PhraseSet\x12\x41\n\x0e\x61udio_encoding\x18\x06 \x01(\x0e\x32).google.cloud.dialogflow.v2.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x07 \x01(\x05\x12\x15\n\rlanguage_code\x18\x08 \x01(\t\x12\x18\n\x10\x65nable_word_info\x18\t \x01(\x08\x12%\n\x1duse_timeout_based_endpointing\x18\x0b \x01(\x08*\x94\x02\n\rTelephonyDtmf\x12\x1e\n\x1aTELEPHONY_DTMF_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44TMF_ONE\x10\x01\x12\x0c\n\x08\x44TMF_TWO\x10\x02\x12\x0e\n\nDTMF_THREE\x10\x03\x12\r\n\tDTMF_FOUR\x10\x04\x12\r\n\tDTMF_FIVE\x10\x05\x12\x0c\n\x08\x44TMF_SIX\x10\x06\x12\x0e\n\nDTMF_SEVEN\x10\x07\x12\x0e\n\nDTMF_EIGHT\x10\x08\x12\r\n\tDTMF_NINE\x10\t\x12\r\n\tDTMF_ZERO\x10\n\x12\n\n\x06\x44TMF_A\x10\x0b\x12\n\n\x06\x44TMF_B\x10\x0c\x12\n\n\x06\x44TMF_C\x10\r\x12\n\n\x06\x44TMF_D\x10\x0e\x12\r\n\tDTMF_STAR\x10\x0f\x12\x0e\n\nDTMF_POUND\x10\x10*\x94\x02\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41UDIO_ENCODING_LINEAR_16\x10\x01\x12\x17\n\x13\x41UDIO_ENCODING_FLAC\x10\x02\x12\x18\n\x14\x41UDIO_ENCODING_MULAW\x10\x03\x12\x16\n\x12\x41UDIO_ENCODING_AMR\x10\x04\x12\x19\n\x15\x41UDIO_ENCODING_AMR_WB\x10\x05\x12\x1b\n\x17\x41UDIO_ENCODING_OGG_OPUS\x10\x06\x12)\n%AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x17\n\x13\x41UDIO_ENCODING_ALAW\x10\x08*v\n\x12SpeechModelVariant\x12$\n SPEECH_MODEL_VARIANT_UNSPECIFIED\x10\x00\x12\x16\n\x12USE_BEST_AVAILABLE\x10\x01\x12\x10\n\x0cUSE_STANDARD\x10\x02\x12\x10\n\x0cUSE_ENHANCED\x10\x03*\x8d\x01\n\x0fSsmlVoiceGender\x12!\n\x1dSSML_VOICE_GENDER_UNSPECIFIED\x10\x00\x12\x1a\n\x16SSML_VOICE_GENDER_MALE\x10\x01\x12\x1c\n\x18SSML_VOICE_GENDER_FEMALE\x10\x02\x12\x1d\n\x19SSML_VOICE_GENDER_NEUTRAL\x10\x03*\x90\x02\n\x13OutputAudioEncoding\x12%\n!OUTPUT_AUDIO_ENCODING_UNSPECIFIED\x10\x00\x12#\n\x1fOUTPUT_AUDIO_ENCODING_LINEAR_16\x10\x01\x12!\n\x19OUTPUT_AUDIO_ENCODING_MP3\x10\x02\x1a\x02\x08\x01\x12%\n!OUTPUT_AUDIO_ENCODING_MP3_64_KBPS\x10\x04\x12\"\n\x1eOUTPUT_AUDIO_ENCODING_OGG_OPUS\x10\x03\x12\x1f\n\x1bOUTPUT_AUDIO_ENCODING_MULAW\x10\x05\x12\x1e\n\x1aOUTPUT_AUDIO_ENCODING_ALAW\x10\x06\x42\xd3\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x10\x41udioConfigProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41U\n\x1b\x61utoml.googleapis.com/Model\x12\x36projects/{project}/locations/{location}/models/{model}\xea\x41\x62\n\x1fspeech.googleapis.com/PhraseSet\x12?projects/{project}/locations/{location}/phraseSets/{phrase_set}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - SpeechContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechContext").msgclass - SpeechWordInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechWordInfo").msgclass - InputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputAudioConfig").msgclass - VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.VoiceSelectionParams").msgclass - SynthesizeSpeechConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SynthesizeSpeechConfig").msgclass - CustomPronunciationParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CustomPronunciationParams").msgclass - CustomPronunciationParams::PhoneticEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CustomPronunciationParams.PhoneticEncoding").enummodule - OutputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioConfig").msgclass - TelephonyDtmfEvents = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TelephonyDtmfEvents").msgclass - SpeechToTextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechToTextConfig").msgclass - TelephonyDtmf = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TelephonyDtmf").enummodule - AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AudioEncoding").enummodule - SpeechModelVariant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechModelVariant").enummodule - SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SsmlVoiceGender").enummodule - OutputAudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioEncoding").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/bindings_override.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/bindings_override.rb deleted file mode 100644 index 037042b4f250..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/bindings_override.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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" - -module Google - module Cloud - module Dialogflow - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/dialogflow/v2/rest" - # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - module V2 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Dialogflow"] - 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v2/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb deleted file mode 100644 index 263ce7a87969..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_app_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/ces_app.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dialogflow/v2/tool_pb' - - -descriptor_data = "\n(google/cloud/dialogflow/v2/ces_app.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dialogflow/v2/tool.proto\"\x92\x02\n\nCesAppSpec\x12/\n\x07\x63\x65s_app\x18\x01 \x01(\tB\x1e\xe0\x41\x01\xfa\x41\x18\n\x16\x63\x65s.googleapis.com/App\x12_\n\x18\x63onfirmation_requirement\x18\x02 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xe0\x41\x01\x12#\n\x11proactive_enabled\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\"\n\x10reactive_enabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x42\x14\n\x12_proactive_enabledB\x13\n\x11_reactive_enabledB\xe0\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0b\x43\x65sAppProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41L\n\x16\x63\x65s.googleapis.com/App\x12\x32projects/{project}/locations/{location}/apps/{app}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - CesAppSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CesAppSpec").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_tool_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_tool_pb.rb deleted file mode 100644 index 4d90a84fcc1e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/ces_tool_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/ces_tool.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dialogflow/v2/tool_pb' - - -descriptor_data = "\n)google/cloud/dialogflow/v2/ces_tool.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dialogflow/v2/tool.proto\"\xa1\x01\n\x0b\x43\x65sToolSpec\x12\x31\n\x08\x63\x65s_tool\x18\x01 \x01(\tB\x1f\xe0\x41\x01\xfa\x41\x19\n\x17\x63\x65s.googleapis.com/Tool\x12_\n\x18\x63onfirmation_requirement\x18\x02 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xe0\x41\x01\x42\x92\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0c\x43\x65sToolProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - CesToolSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CesToolSpec").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_pb.rb deleted file mode 100644 index 231ea99427ce..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/context.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/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n(google/cloud/dialogflow/v2/context.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x8f\x04\n\x07\x43ontext\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0elifespan_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x30\n\nparameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01:\xa1\x03\xea\x41\x9d\x03\n!dialogflow.googleapis.com/Context\x12>projects/{project}/agent/sessions/{session}/contexts/{context}\x12\x66projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}\x12Sprojects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}\x12{projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}\"\x81\x01\n\x13ListContextsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Context\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\"f\n\x14ListContextsResponse\x12\x35\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11GetContextRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Context\"\x8c\x01\n\x14\x43reateContextRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Context\x12\x39\n\x07\x63ontext\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.v2.ContextB\x03\xe0\x41\x02\"\x87\x01\n\x14UpdateContextRequest\x12\x39\n\x07\x63ontext\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.v2.ContextB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"O\n\x14\x44\x65leteContextRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Context\"U\n\x18\x44\x65leteAllContextsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Context2\xe8\x14\n\x08\x43ontexts\x12\x9c\x03\n\x0cListContexts\x12/.google.cloud.dialogflow.v2.ListContextsRequest\x1a\x30.google.cloud.dialogflow.v2.ListContextsResponse\"\xa8\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x98\x02\x12\x31/v2/{parent=projects/*/agent/sessions/*}/contextsZJ\x12H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?\x12=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZV\x12T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts\x12\x89\x03\n\nGetContext\x12-.google.cloud.dialogflow.v2.GetContextRequest\x1a#.google.cloud.dialogflow.v2.Context\"\xa6\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x98\x02\x12\x31/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJ\x12H/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?\x12=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZV\x12T/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}\x12\xbd\x03\n\rCreateContext\x12\x30.google.cloud.dialogflow.v2.CreateContextRequest\x1a#.google.cloud.dialogflow.v2.Context\"\xd4\x02\xda\x41\x0eparent,context\x82\xd3\xe4\x93\x02\xbc\x02\"1/v2/{parent=projects/*/agent/sessions/*}/contexts:\x07\x63ontextZS\"H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts:\x07\x63ontextZH\"=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contexts:\x07\x63ontextZ_\"T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts:\x07\x63ontext\x12\xe2\x03\n\rUpdateContext\x12\x30.google.cloud.dialogflow.v2.UpdateContextRequest\x1a#.google.cloud.dialogflow.v2.Context\"\xf9\x02\xda\x41\x13\x63ontext,update_mask\x82\xd3\xe4\x93\x02\xdc\x02\x32\x39/v2/{context.name=projects/*/agent/sessions/*/contexts/*}:\x07\x63ontextZ[2P/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}:\x07\x63ontextZP2E/v2/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}:\x07\x63ontextZg2\\/v2/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}:\x07\x63ontext\x12\x82\x03\n\rDeleteContext\x12\x30.google.cloud.dialogflow.v2.DeleteContextRequest\x1a\x16.google.protobuf.Empty\"\xa6\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\x98\x02*1/v2/{name=projects/*/agent/sessions/*/contexts/*}ZJ*H/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}Z?*=/v2/{name=projects/*/locations/*/agent/sessions/*/contexts/*}ZV*T/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}\x12\x8c\x03\n\x11\x44\x65leteAllContexts\x12\x34.google.cloud.dialogflow.v2.DeleteAllContextsRequest\x1a\x16.google.protobuf.Empty\"\xa8\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x98\x02*1/v2/{parent=projects/*/agent/sessions/*}/contextsZJ*H/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contextsZ?*=/v2/{parent=projects/*/locations/*/agent/sessions/*}/contextsZV*T/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x92\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0c\x43ontextProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - Context = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Context").msgclass - ListContextsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListContextsRequest").msgclass - ListContextsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListContextsResponse").msgclass - GetContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetContextRequest").msgclass - CreateContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateContextRequest").msgclass - UpdateContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateContextRequest").msgclass - DeleteContextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteContextRequest").msgclass - DeleteAllContextsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteAllContextsRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_services_pb.rb deleted file mode 100644 index cb6eb6f793a2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/context_services_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/context.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/context_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Contexts - # Service for managing [Contexts][google.cloud.dialogflow.v2.Context]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Contexts' - - # Returns the list of all contexts in the specified session. - rpc :ListContexts, ::Google::Cloud::Dialogflow::V2::ListContextsRequest, ::Google::Cloud::Dialogflow::V2::ListContextsResponse - # Retrieves the specified context. - rpc :GetContext, ::Google::Cloud::Dialogflow::V2::GetContextRequest, ::Google::Cloud::Dialogflow::V2::Context - # Creates a context. - # - # If the specified context already exists, overrides the context. - rpc :CreateContext, ::Google::Cloud::Dialogflow::V2::CreateContextRequest, ::Google::Cloud::Dialogflow::V2::Context - # Updates the specified context. - rpc :UpdateContext, ::Google::Cloud::Dialogflow::V2::UpdateContextRequest, ::Google::Cloud::Dialogflow::V2::Context - # Deletes the specified context. - rpc :DeleteContext, ::Google::Cloud::Dialogflow::V2::DeleteContextRequest, ::Google::Protobuf::Empty - # Deletes all active contexts in the specified session. - rpc :DeleteAllContexts, ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts.rb deleted file mode 100644 index 848d100df06d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/contexts/credentials" -require "google/cloud/dialogflow/v2/contexts/paths" -require "google/cloud/dialogflow/v2/contexts/client" -require "google/cloud/dialogflow/v2/contexts/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/contexts" - # client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/contexts/rest" - # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new - # - module Contexts - end - end - end - end -end - -helper_path = ::File.join __dir__, "contexts", "helpers.rb" -require "google/cloud/dialogflow/v2/contexts/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb deleted file mode 100644 index f797ab9d7f73..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/client.rb +++ /dev/null @@ -1,999 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/context_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Contexts - ## - # Client for the Contexts service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :contexts_stub - - ## - # Configure the Contexts Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Contexts::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Contexts clients - # ::Google::Cloud::Dialogflow::V2::Contexts::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Contexts 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::Dialogflow::V2::Contexts::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 - @contexts_stub.universe_domain - end - - ## - # Create a new Contexts client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Contexts 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/dialogflow/v2/context_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 - - @contexts_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Contexts::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 - ) - - @contexts_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 = @contexts_stub.endpoint - config.universe_domain = @contexts_stub.universe_domain - config.logger = @contexts_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 - @contexts_stub.logger - end - - # Service calls - - ## - # Returns the list of all contexts in the specified session. - # - # @overload list_contexts(request, options = nil) - # Pass arguments to `list_contexts` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListContextsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListContextsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_contexts(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_contexts` via keyword arguments. Note that at - # least one keyword argument is 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 session to list all contexts from. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new - # - # # Call the list_contexts method. - # result = client.list_contexts 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::Dialogflow::V2::Context. - # p item - # end - # - def list_contexts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListContextsRequest - - # Converts hash and nil to 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_contexts.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_contexts.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_contexts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.call_rpc :list_contexts, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @contexts_stub, :list_contexts, 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 - - ## - # Retrieves the specified context. - # - # @overload get_context(request, options = nil) - # Pass arguments to `get_context` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetContextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetContextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_context(name: nil) - # Pass arguments to `get_context` via keyword arguments. Note that at - # least one keyword argument is required. To 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 context. Format: - # `projects//agent/sessions//contexts/` - # or `projects//agent/environments//users//sessions//contexts/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Context] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Context] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetContextRequest.new - # - # # Call the get_context method. - # result = client.get_context request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. - # p result - # - def get_context request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetContextRequest - - # Converts hash and nil to 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_context.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_context.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_context.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.call_rpc :get_context, 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 context. - # - # If the specified context already exists, overrides the context. - # - # @overload create_context(request, options = nil) - # Pass arguments to `create_context` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateContextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateContextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_context(parent: nil, context: nil) - # Pass arguments to `create_context` via keyword arguments. Note that at - # least one keyword argument is 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 session to create a context for. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @param context [::Google::Cloud::Dialogflow::V2::Context, ::Hash] - # Required. The context to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Context] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Context] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new - # - # # Call the create_context method. - # result = client.create_context request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. - # p result - # - def create_context request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateContextRequest - - # Converts hash and nil to 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_context.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_context.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_context.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.call_rpc :create_context, 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 the specified context. - # - # @overload update_context(request, options = nil) - # Pass arguments to `update_context` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateContextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateContextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_context(context: nil, update_mask: nil) - # Pass arguments to `update_context` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param context [::Google::Cloud::Dialogflow::V2::Context, ::Hash] - # Required. The context to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Context] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Context] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new - # - # # Call the update_context method. - # result = client.update_context request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. - # p result - # - def update_context request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateContextRequest - - # Converts hash and nil to 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_context.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.context&.name - header_params["context.name"] = request.context.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_context.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_context.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.call_rpc :update_context, 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 specified context. - # - # @overload delete_context(request, options = nil) - # Pass arguments to `delete_context` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteContextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteContextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_context(name: nil) - # Pass arguments to `delete_context` via keyword arguments. Note that at - # least one keyword argument is required. To 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 context to delete. Format: - # `projects//agent/sessions//contexts/` - # or `projects//agent/environments//users//sessions//contexts/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new - # - # # Call the delete_context method. - # result = client.delete_context request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_context request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteContextRequest - - # Converts hash and nil to 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_context.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_context.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_context.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.call_rpc :delete_context, 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 all active contexts in the specified session. - # - # @overload delete_all_contexts(request, options = nil) - # Pass arguments to `delete_all_contexts` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_all_contexts(parent: nil) - # Pass arguments to `delete_all_contexts` via keyword arguments. Note that at - # least one keyword argument is 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 name of the session to delete all contexts from. Format: - # `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. - # If `Environment ID` is not specified we assume default 'draft' environment. - # If `User ID` is not specified, we assume default '-' user. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new - # - # # Call the delete_all_contexts method. - # result = client.delete_all_contexts request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_all_contexts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest - - # Converts hash and nil to 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_all_contexts.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.delete_all_contexts.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_all_contexts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.call_rpc :delete_all_contexts, 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 Contexts API. - # - # This class represents the configuration for Contexts, - # 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::Dialogflow::V2::Contexts::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_contexts to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Contexts::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_contexts.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_contexts.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::Dialogflow::V2::Contexts::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Contexts 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_contexts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_contexts - ## - # RPC-specific configuration for `get_context` - # @return [::Gapic::Config::Method] - # - attr_reader :get_context - ## - # RPC-specific configuration for `create_context` - # @return [::Gapic::Config::Method] - # - attr_reader :create_context - ## - # RPC-specific configuration for `update_context` - # @return [::Gapic::Config::Method] - # - attr_reader :update_context - ## - # RPC-specific configuration for `delete_context` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_context - ## - # RPC-specific configuration for `delete_all_contexts` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_all_contexts - - # @private - def initialize parent_rpcs = nil - list_contexts_config = parent_rpcs.list_contexts if parent_rpcs.respond_to? :list_contexts - @list_contexts = ::Gapic::Config::Method.new list_contexts_config - get_context_config = parent_rpcs.get_context if parent_rpcs.respond_to? :get_context - @get_context = ::Gapic::Config::Method.new get_context_config - create_context_config = parent_rpcs.create_context if parent_rpcs.respond_to? :create_context - @create_context = ::Gapic::Config::Method.new create_context_config - update_context_config = parent_rpcs.update_context if parent_rpcs.respond_to? :update_context - @update_context = ::Gapic::Config::Method.new update_context_config - delete_context_config = parent_rpcs.delete_context if parent_rpcs.respond_to? :delete_context - @delete_context = ::Gapic::Config::Method.new delete_context_config - delete_all_contexts_config = parent_rpcs.delete_all_contexts if parent_rpcs.respond_to? :delete_all_contexts - @delete_all_contexts = ::Gapic::Config::Method.new delete_all_contexts_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/credentials.rb deleted file mode 100644 index bc6df1b4f9d4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Contexts - # Credentials for the Contexts API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/paths.rb deleted file mode 100644 index 905180a566d6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/paths.rb +++ /dev/null @@ -1,195 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module Contexts - # Path helper methods for the Contexts API. - module Paths - ## - # Create a fully-qualified Context resource string. - # - # @overload context_path(project:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @return [::String] - def context_path **args - resources = { - "context:project:session" => (proc do |project:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - end), - "context:location:project:session" => (proc do |project:, location:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - 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:, session:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}` - # - # @param project [String] - # @param session [String] - # - # @overload session_path(project:, environment:, user:, session:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # - # @overload session_path(project:, location:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # - # @overload session_path(project:, location:, environment:, user:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # - # @return [::String] - def session_path **args - resources = { - "project:session" => (proc do |project:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}" - end), - "environment:project:session:user" => (proc do |project:, environment:, user:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}" - end), - "location:project:session" => (proc do |project:, location:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}" - end), - "environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/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-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest.rb deleted file mode 100644 index 9ae1589a3b42..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/contexts/credentials" -require "google/cloud/dialogflow/v2/contexts/paths" -require "google/cloud/dialogflow/v2/contexts/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/contexts/rest" - # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new - # - module Contexts - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/contexts/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb deleted file mode 100644 index 017a756e70fe..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/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/dialogflow/v2/context_pb" -require "google/cloud/dialogflow/v2/contexts/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Contexts - module Rest - ## - # REST client for the Contexts service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :contexts_stub - - ## - # Configure the Contexts Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Contexts clients - # ::Google::Cloud::Dialogflow::V2::Contexts::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Contexts 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::Dialogflow::V2::Contexts::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 - @contexts_stub.universe_domain - end - - ## - # Create a new Contexts REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Contexts 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 - - @contexts_stub = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @contexts_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 = @contexts_stub.endpoint - config.universe_domain = @contexts_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @contexts_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 - @contexts_stub.logger - end - - # Service calls - - ## - # Returns the list of all contexts in the specified session. - # - # @overload list_contexts(request, options = nil) - # Pass arguments to `list_contexts` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListContextsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListContextsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_contexts(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_contexts` via keyword arguments. Note that at - # least one keyword argument is 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 session to list all contexts from. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Context>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new - # - # # Call the list_contexts method. - # result = client.list_contexts 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::Dialogflow::V2::Context. - # p item - # end - # - def list_contexts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListContextsRequest - - # Converts hash and nil to an 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_contexts.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_contexts.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_contexts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.list_contexts request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @contexts_stub, :list_contexts, "contexts", 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 - - ## - # Retrieves the specified context. - # - # @overload get_context(request, options = nil) - # Pass arguments to `get_context` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetContextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetContextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_context(name: nil) - # Pass arguments to `get_context` via keyword arguments. Note that at - # least one keyword argument is required. To 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 context. Format: - # `projects//agent/sessions//contexts/` - # or `projects//agent/environments//users//sessions//contexts/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Context] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Context] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetContextRequest.new - # - # # Call the get_context method. - # result = client.get_context request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. - # p result - # - def get_context request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetContextRequest - - # Converts hash and nil to an 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_context.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_context.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_context.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.get_context 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 context. - # - # If the specified context already exists, overrides the context. - # - # @overload create_context(request, options = nil) - # Pass arguments to `create_context` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateContextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateContextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_context(parent: nil, context: nil) - # Pass arguments to `create_context` via keyword arguments. Note that at - # least one keyword argument is 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 session to create a context for. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @param context [::Google::Cloud::Dialogflow::V2::Context, ::Hash] - # Required. The context to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Context] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Context] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new - # - # # Call the create_context method. - # result = client.create_context request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. - # p result - # - def create_context request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateContextRequest - - # Converts hash and nil to an 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_context.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_context.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_context.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.create_context 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 the specified context. - # - # @overload update_context(request, options = nil) - # Pass arguments to `update_context` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateContextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateContextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_context(context: nil, update_mask: nil) - # Pass arguments to `update_context` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param context [::Google::Cloud::Dialogflow::V2::Context, ::Hash] - # Required. The context to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Context] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Context] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new - # - # # Call the update_context method. - # result = client.update_context request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Context. - # p result - # - def update_context request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateContextRequest - - # Converts hash and nil to an 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_context.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_context.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_context.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.update_context 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 specified context. - # - # @overload delete_context(request, options = nil) - # Pass arguments to `delete_context` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteContextRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteContextRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_context(name: nil) - # Pass arguments to `delete_context` via keyword arguments. Note that at - # least one keyword argument is required. To 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 context to delete. Format: - # `projects//agent/sessions//contexts/` - # or `projects//agent/environments//users//sessions//contexts/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new - # - # # Call the delete_context method. - # result = client.delete_context request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_context request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteContextRequest - - # Converts hash and nil to an 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_context.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_context.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_context.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.delete_context 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 all active contexts in the specified session. - # - # @overload delete_all_contexts(request, options = nil) - # Pass arguments to `delete_all_contexts` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_all_contexts(parent: nil) - # Pass arguments to `delete_all_contexts` via keyword arguments. Note that at - # least one keyword argument is 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 name of the session to delete all contexts from. Format: - # `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. - # If `Environment ID` is not specified we assume default 'draft' environment. - # If `User ID` is not specified, we assume default '-' user. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new - # - # # Call the delete_all_contexts method. - # result = client.delete_all_contexts request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_all_contexts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest - - # Converts hash and nil to an 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_all_contexts.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_all_contexts.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_all_contexts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @contexts_stub.delete_all_contexts 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 Contexts REST API. - # - # This class represents the configuration for Contexts 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::Dialogflow::V2::Contexts::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_contexts to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_contexts.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_contexts.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Contexts 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_contexts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_contexts - ## - # RPC-specific configuration for `get_context` - # @return [::Gapic::Config::Method] - # - attr_reader :get_context - ## - # RPC-specific configuration for `create_context` - # @return [::Gapic::Config::Method] - # - attr_reader :create_context - ## - # RPC-specific configuration for `update_context` - # @return [::Gapic::Config::Method] - # - attr_reader :update_context - ## - # RPC-specific configuration for `delete_context` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_context - ## - # RPC-specific configuration for `delete_all_contexts` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_all_contexts - - # @private - def initialize parent_rpcs = nil - list_contexts_config = parent_rpcs.list_contexts if parent_rpcs.respond_to? :list_contexts - @list_contexts = ::Gapic::Config::Method.new list_contexts_config - get_context_config = parent_rpcs.get_context if parent_rpcs.respond_to? :get_context - @get_context = ::Gapic::Config::Method.new get_context_config - create_context_config = parent_rpcs.create_context if parent_rpcs.respond_to? :create_context - @create_context = ::Gapic::Config::Method.new create_context_config - update_context_config = parent_rpcs.update_context if parent_rpcs.respond_to? :update_context - @update_context = ::Gapic::Config::Method.new update_context_config - delete_context_config = parent_rpcs.delete_context if parent_rpcs.respond_to? :delete_context - @delete_context = ::Gapic::Config::Method.new delete_context_config - delete_all_contexts_config = parent_rpcs.delete_all_contexts if parent_rpcs.respond_to? :delete_all_contexts - @delete_all_contexts = ::Gapic::Config::Method.new delete_all_contexts_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb deleted file mode 100644 index 4dde350ccd99..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb +++ /dev/null @@ -1,581 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/context_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Contexts - module Rest - ## - # REST service stub for the Contexts 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_contexts REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListContextsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListContextsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListContextsResponse] - # A result object deserialized from the server's reply - def list_contexts request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_contexts_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_contexts", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListContextsResponse.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_context REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetContextRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Context] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Context] - # A result object deserialized from the server's reply - def get_context request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_context_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_context", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Context.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_context REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateContextRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Context] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Context] - # A result object deserialized from the server's reply - def create_context request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_context_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_context", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Context.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_context REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateContextRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Context] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Context] - # A result object deserialized from the server's reply - def update_context request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_context_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_context", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Context.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_context REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteContextRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_context request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_context_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_context", - 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 delete_all_contexts REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_all_contexts request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_all_contexts_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_all_contexts", - 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_contexts REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListContextsRequest] - # 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_contexts_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/contexts", - matches: [ - ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/contexts", - matches: [ - ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/contexts", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/contexts", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_context REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetContextRequest] - # 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_context_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_context REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateContextRequest] - # 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_context_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/contexts", - body: "context", - matches: [ - ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/contexts", - body: "context", - matches: [ - ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/contexts", - body: "context", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/contexts", - body: "context", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_context REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateContextRequest] - # 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_context_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{context.name}", - body: "context", - matches: [ - ["context.name", %r{^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{context.name}", - body: "context", - matches: [ - ["context.name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{context.name}", - body: "context", - matches: [ - ["context.name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{context.name}", - body: "context", - matches: [ - ["context.name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_context REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteContextRequest] - # 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_context_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/contexts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_all_contexts REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest] - # 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_all_contexts_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{parent}/contexts", - matches: [ - ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{parent}/contexts", - matches: [ - ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{parent}/contexts", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{parent}/contexts", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_pb.rb deleted file mode 100644 index 98a0a8d805a1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_pb.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/conversation_dataset.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/dialogflow/v2/gcs_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n5google/cloud/dialogflow/v2/conversation_dataset.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/dialogflow/v2/gcs.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\".\n\x10\x43onversationInfo\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x01\"U\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.v2.GcsSourcesH\x00\x42\x08\n\x06source\"\xb7\x04\n\x13\x43onversationDataset\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x42\n\x0cinput_config\x18\x05 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.InputConfigB\x03\xe0\x41\x03\x12L\n\x11\x63onversation_info\x18\x06 \x01(\x0b\x32,.google.cloud.dialogflow.v2.ConversationInfoB\x03\xe0\x41\x03\x12\x1f\n\x12\x63onversation_count\x18\x07 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzi\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1f\n\rsatisfies_pzs\x18\t \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01:\x88\x01\xea\x41\x84\x01\n-dialogflow.googleapis.com/ConversationDataset\x12Sprojects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}B\x10\n\x0e_satisfies_pziB\x10\n\x0e_satisfies_pzs\"\x8b\x01\n CreateConversationDatasetRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12R\n\x14\x63onversation_dataset\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationDatasetB\x03\xe0\x41\x02\"d\n\x1dGetConversationDatasetRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\"\x99\x01\n\x1fListConversationDatasetsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationDataset\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\"\x8b\x01\n ListConversationDatasetsResponse\x12N\n\x15\x63onversation_datasets\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.v2.ConversationDataset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n DeleteConversationDatasetRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\"\xa8\x01\n\x1dImportConversationDataRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\x12\x42\n\x0cinput_config\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.InputConfigB\x03\xe0\x41\x02\"\xda\x01\n\'ImportConversationDataOperationMetadata\x12P\n\x14\x63onversation_dataset\x18\x01 \x01(\tB2\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\x12,\n\x10partial_failures\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x91\x01\n\'ImportConversationDataOperationResponse\x12P\n\x14\x63onversation_dataset\x18\x01 \x01(\tB2\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\x12\x14\n\x0cimport_count\x18\x03 \x01(\x05\"~\n*CreateConversationDatasetOperationMetadata\x12P\n\x14\x63onversation_dataset\x18\x01 \x01(\tB2\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\",\n*DeleteConversationDatasetOperationMetadata2\xd6\x0c\n\x14\x43onversationDatasets\x12\xb3\x02\n\x19\x43reateConversationDataset\x12<.google.cloud.dialogflow.v2.CreateConversationDatasetRequest\x1a\x1d.google.longrunning.Operation\"\xb8\x01\xca\x41\x41\n\x13\x43onversationDataset\x12*CreateConversationDatasetOperationMetadata\xda\x41\x1bparent,conversation_dataset\x82\xd3\xe4\x93\x02P\"8/v2/{parent=projects/*/locations/*}/conversationDatasets:\x14\x63onversation_dataset\x12\xfd\x01\n\x16GetConversationDataset\x12\x39.google.cloud.dialogflow.v2.GetConversationDatasetRequest\x1a/.google.cloud.dialogflow.v2.ConversationDataset\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j\x12,/v2/{name=projects/*/conversationDatasets/*}Z:\x12\x38/v2/{name=projects/*/locations/*/conversationDatasets/*}\x12\x90\x02\n\x18ListConversationDatasets\x12;.google.cloud.dialogflow.v2.ListConversationDatasetsRequest\x1a<.google.cloud.dialogflow.v2.ListConversationDatasetsResponse\"y\xda\x41\x06parent\x82\xd3\xe4\x93\x02j\x12,/v2/{parent=projects/*}/conversationDatasetsZ:\x12\x38/v2/{parent=projects/*/locations/*}/conversationDatasets\x12\x88\x02\n\x19\x44\x65leteConversationDataset\x12<.google.cloud.dialogflow.v2.DeleteConversationDatasetRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41\x43\n\x15google.protobuf.Empty\x12*DeleteConversationDatasetOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v2/{name=projects/*/locations/*/conversationDatasets/*}\x12\xef\x02\n\x16ImportConversationData\x12\x39.google.cloud.dialogflow.v2.ImportConversationDataRequest\x1a\x1d.google.longrunning.Operation\"\xfa\x01\xca\x41R\n\'ImportConversationDataOperationResponse\x12\'ImportConversationDataOperationMetadata\x82\xd3\xe4\x93\x02\x9e\x01\"C/v2/{name=projects/*/conversationDatasets/*}:importConversationData:\x01*ZT\"O/v2/{name=projects/*/locations/*/conversationDatasets/*}:importConversationData:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9e\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x18\x43onversationDatasetProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - ConversationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationInfo").msgclass - InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputConfig").msgclass - ConversationDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationDataset").msgclass - CreateConversationDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationDatasetRequest").msgclass - GetConversationDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationDatasetRequest").msgclass - ListConversationDatasetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationDatasetsRequest").msgclass - ListConversationDatasetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationDatasetsResponse").msgclass - DeleteConversationDatasetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationDatasetRequest").msgclass - ImportConversationDataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportConversationDataRequest").msgclass - ImportConversationDataOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata").msgclass - ImportConversationDataOperationResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportConversationDataOperationResponse").msgclass - CreateConversationDatasetOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata").msgclass - DeleteConversationDatasetOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_services_pb.rb deleted file mode 100644 index 9f7bb2a35751..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_dataset_services_pb.rb +++ /dev/null @@ -1,86 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/conversation_dataset.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/conversation_dataset_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationDatasets - # Conversation datasets. - # - # Conversation datasets contain raw conversation files and their - # customizable metadata that can be used for model training. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.ConversationDatasets' - - # Creates a new conversation dataset. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] - # - `response`: - # [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset] - rpc :CreateConversationDataset, ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, ::Google::Longrunning::Operation - # Retrieves the specified conversation dataset. - rpc :GetConversationDataset, ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, ::Google::Cloud::Dialogflow::V2::ConversationDataset - # Returns the list of all conversation datasets in the specified - # project and location. - rpc :ListConversationDatasets, ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse - # Deletes the specified conversation dataset. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - rpc :DeleteConversationDataset, ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, ::Google::Longrunning::Operation - # Import data into the specified conversation dataset. Note that it - # is not allowed to import data to a conversation dataset that - # already has data in it. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] - # - `response`: - # [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] - rpc :ImportConversationData, ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets.rb deleted file mode 100644 index 103bd3699f39..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/conversation_datasets/credentials" -require "google/cloud/dialogflow/v2/conversation_datasets/paths" -require "google/cloud/dialogflow/v2/conversation_datasets/operations" -require "google/cloud/dialogflow/v2/conversation_datasets/client" -require "google/cloud/dialogflow/v2/conversation_datasets/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Conversation datasets. - # - # Conversation datasets contain raw conversation files and their - # customizable metadata that can be used for model training. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/conversation_datasets" - # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/conversation_datasets/rest" - # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new - # - module ConversationDatasets - end - end - end - end -end - -helper_path = ::File.join __dir__, "conversation_datasets", "helpers.rb" -require "google/cloud/dialogflow/v2/conversation_datasets/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb deleted file mode 100644 index 1e1ad2cdbde7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb +++ /dev/null @@ -1,962 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_dataset_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationDatasets - ## - # Client for the ConversationDatasets service. - # - # Conversation datasets. - # - # Conversation datasets contain raw conversation files and their - # customizable metadata that can be used for model training. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversation_datasets_stub - - ## - # Configure the ConversationDatasets Client class. - # - # See {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationDatasets clients - # ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::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 - @conversation_datasets_stub.universe_domain - end - - ## - # Create a new ConversationDatasets client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationDatasets 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/dialogflow/v2/conversation_dataset_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 - - @conversation_datasets_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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 - ) - - @conversation_datasets_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 = @conversation_datasets_stub.endpoint - config.universe_domain = @conversation_datasets_stub.universe_domain - config.logger = @conversation_datasets_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationDatasets::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 - @conversation_datasets_stub.logger - end - - # Service calls - - ## - # Creates a new conversation dataset. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::CreateConversationDatasetOperationMetadata CreateConversationDatasetOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ConversationDataset ConversationDataset} - # - # @overload create_conversation_dataset(request, options = nil) - # Pass arguments to `create_conversation_dataset` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(parent: nil, conversation_dataset: nil) - # Pass arguments to `create_conversation_dataset` via keyword arguments. Note that at - # least one keyword argument is 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 project to create conversation dataset for. Format: - # `projects//locations/` - # @param conversation_dataset [::Google::Cloud::Dialogflow::V2::ConversationDataset, ::Hash] - # Required. The conversation dataset 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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new - # - # # Call the create_conversation_dataset method. - # result = client.create_conversation_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_conversation_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest - - # Converts hash and nil to 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_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_conversation_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.call_rpc :create_conversation_dataset, 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 - - ## - # Retrieves the specified conversation dataset. - # - # @overload get_conversation_dataset(request, options = nil) - # Pass arguments to `get_conversation_dataset` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `get_conversation_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To 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 conversation dataset to retrieve. Format: - # `projects//locations//conversationDatasets/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationDataset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationDataset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new - # - # # Call the get_conversation_dataset method. - # result = client.get_conversation_dataset request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. - # p result - # - def get_conversation_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest - - # Converts hash and nil to 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_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_conversation_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.call_rpc :get_conversation_dataset, 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 - - ## - # Returns the list of all conversation datasets in the specified - # project and location. - # - # @overload list_conversation_datasets(request, options = nil) - # Pass arguments to `list_conversation_datasets` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_datasets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_conversation_datasets` via keyword arguments. Note that at - # least one keyword argument is 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 project and location name to list all conversation datasets - # for. Format: `projects//locations/` - # @param page_size [::Integer] - # Optional. Maximum number of conversation datasets to return in a single - # page. By default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new - # - # # Call the list_conversation_datasets method. - # result = client.list_conversation_datasets 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::Dialogflow::V2::ConversationDataset. - # p item - # end - # - def list_conversation_datasets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest - - # Converts hash and nil to 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_conversation_datasets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_conversation_datasets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_conversation_datasets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.call_rpc :list_conversation_datasets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @conversation_datasets_stub, :list_conversation_datasets, 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 the specified conversation dataset. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetOperationMetadata DeleteConversationDatasetOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload delete_conversation_dataset(request, options = nil) - # Pass arguments to `delete_conversation_dataset` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `delete_conversation_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To 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 conversation dataset to delete. Format: - # `projects//locations//conversationDatasets/` - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new - # - # # Call the delete_conversation_dataset method. - # result = client.delete_conversation_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_conversation_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest - - # Converts hash and nil to 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_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_dataset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_conversation_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.call_rpc :delete_conversation_dataset, 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 - - ## - # Import data into the specified conversation dataset. Note that it - # is not allowed to import data to a conversation dataset that - # already has data in it. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::ImportConversationDataOperationMetadata ImportConversationDataOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ImportConversationDataOperationResponse ImportConversationDataOperationResponse} - # - # @overload import_conversation_data(request, options = nil) - # Pass arguments to `import_conversation_data` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_data(name: nil, input_config: nil) - # Pass arguments to `import_conversation_data` via keyword arguments. Note that at - # least one keyword argument is required. To 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. Dataset resource name. Format: - # `projects//locations//conversationDatasets/` - # @param input_config [::Google::Cloud::Dialogflow::V2::InputConfig, ::Hash] - # Required. Configuration describing where to import data from. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new - # - # # Call the import_conversation_data method. - # result = client.import_conversation_data request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_conversation_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest - - # Converts hash and nil to 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_conversation_data.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.import_conversation_data.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_conversation_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.call_rpc :import_conversation_data, 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 ConversationDatasets API. - # - # This class represents the configuration for ConversationDatasets, - # 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::Dialogflow::V2::ConversationDatasets::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_conversation_dataset to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation_dataset.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation_dataset.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::Dialogflow::V2::ConversationDatasets::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 ConversationDatasets 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_conversation_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation_dataset - ## - # RPC-specific configuration for `get_conversation_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation_dataset - ## - # RPC-specific configuration for `list_conversation_datasets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversation_datasets - ## - # RPC-specific configuration for `delete_conversation_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_conversation_dataset - ## - # RPC-specific configuration for `import_conversation_data` - # @return [::Gapic::Config::Method] - # - attr_reader :import_conversation_data - - # @private - def initialize parent_rpcs = nil - create_conversation_dataset_config = parent_rpcs.create_conversation_dataset if parent_rpcs.respond_to? :create_conversation_dataset - @create_conversation_dataset = ::Gapic::Config::Method.new create_conversation_dataset_config - get_conversation_dataset_config = parent_rpcs.get_conversation_dataset if parent_rpcs.respond_to? :get_conversation_dataset - @get_conversation_dataset = ::Gapic::Config::Method.new get_conversation_dataset_config - list_conversation_datasets_config = parent_rpcs.list_conversation_datasets if parent_rpcs.respond_to? :list_conversation_datasets - @list_conversation_datasets = ::Gapic::Config::Method.new list_conversation_datasets_config - delete_conversation_dataset_config = parent_rpcs.delete_conversation_dataset if parent_rpcs.respond_to? :delete_conversation_dataset - @delete_conversation_dataset = ::Gapic::Config::Method.new delete_conversation_dataset_config - import_conversation_data_config = parent_rpcs.import_conversation_data if parent_rpcs.respond_to? :import_conversation_data - @import_conversation_data = ::Gapic::Config::Method.new import_conversation_data_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/credentials.rb deleted file mode 100644 index 700f2a11e779..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationDatasets - # Credentials for the ConversationDatasets API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb deleted file mode 100644 index 140f9cd3f8b4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module ConversationDatasets - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ConversationDatasets 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 ConversationDatasets 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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/paths.rb deleted file mode 100644 index 80386ca17ead..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/paths.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module ConversationDatasets - # Path helper methods for the ConversationDatasets API. - module Paths - ## - # Create a fully-qualified ConversationDataset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}` - # - # @param project [String] - # @param location [String] - # @param conversation_dataset [String] - # - # @return [::String] - def conversation_dataset_path project:, location:, conversation_dataset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversationDatasets/#{conversation_dataset}" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest.rb deleted file mode 100644 index 8cf159548273..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/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 "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/conversation_datasets/credentials" -require "google/cloud/dialogflow/v2/conversation_datasets/paths" -require "google/cloud/dialogflow/v2/conversation_datasets/rest/operations" -require "google/cloud/dialogflow/v2/conversation_datasets/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Conversation datasets. - # - # Conversation datasets contain raw conversation files and their - # customizable metadata that can be used for model training. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/conversation_datasets/rest" - # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new - # - module ConversationDatasets - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/conversation_datasets/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb deleted file mode 100644 index 4d76ed64255a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +++ /dev/null @@ -1,892 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_dataset_pb" -require "google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationDatasets - module Rest - ## - # REST client for the ConversationDatasets service. - # - # Conversation datasets. - # - # Conversation datasets contain raw conversation files and their - # customizable metadata that can be used for model training. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversation_datasets_stub - - ## - # Configure the ConversationDatasets Client class. - # - # See {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationDatasets clients - # ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::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 - @conversation_datasets_stub.universe_domain - end - - ## - # Create a new ConversationDatasets REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::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 - - @conversation_datasets_stub = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @conversation_datasets_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 = @conversation_datasets_stub.endpoint - config.universe_domain = @conversation_datasets_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @conversation_datasets_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationDatasets::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 - @conversation_datasets_stub.logger - end - - # Service calls - - ## - # Creates a new conversation dataset. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::CreateConversationDatasetOperationMetadata CreateConversationDatasetOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ConversationDataset ConversationDataset} - # - # @overload create_conversation_dataset(request, options = nil) - # Pass arguments to `create_conversation_dataset` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(parent: nil, conversation_dataset: nil) - # Pass arguments to `create_conversation_dataset` via keyword arguments. Note that at - # least one keyword argument is 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 project to create conversation dataset for. Format: - # `projects//locations/` - # @param conversation_dataset [::Google::Cloud::Dialogflow::V2::ConversationDataset, ::Hash] - # Required. The conversation dataset 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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new - # - # # Call the create_conversation_dataset method. - # result = client.create_conversation_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_conversation_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest - - # Converts hash and nil to an 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_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_conversation_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.create_conversation_dataset 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 - - ## - # Retrieves the specified conversation dataset. - # - # @overload get_conversation_dataset(request, options = nil) - # Pass arguments to `get_conversation_dataset` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `get_conversation_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To 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 conversation dataset to retrieve. Format: - # `projects//locations//conversationDatasets/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationDataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationDataset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new - # - # # Call the get_conversation_dataset method. - # result = client.get_conversation_dataset request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. - # p result - # - def get_conversation_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest - - # Converts hash and nil to an 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_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_conversation_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.get_conversation_dataset 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 - - ## - # Returns the list of all conversation datasets in the specified - # project and location. - # - # @overload list_conversation_datasets(request, options = nil) - # Pass arguments to `list_conversation_datasets` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_datasets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_conversation_datasets` via keyword arguments. Note that at - # least one keyword argument is 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 project and location name to list all conversation datasets - # for. Format: `projects//locations/` - # @param page_size [::Integer] - # Optional. Maximum number of conversation datasets to return in a single - # page. By default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationDataset>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new - # - # # Call the list_conversation_datasets method. - # result = client.list_conversation_datasets 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::Dialogflow::V2::ConversationDataset. - # p item - # end - # - def list_conversation_datasets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest - - # Converts hash and nil to an 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_conversation_datasets.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_conversation_datasets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_conversation_datasets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.list_conversation_datasets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @conversation_datasets_stub, :list_conversation_datasets, "conversation_datasets", 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 the specified conversation dataset. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetOperationMetadata DeleteConversationDatasetOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload delete_conversation_dataset(request, options = nil) - # Pass arguments to `delete_conversation_dataset` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dataset(name: nil) - # Pass arguments to `delete_conversation_dataset` via keyword arguments. Note that at - # least one keyword argument is required. To 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 conversation dataset to delete. Format: - # `projects//locations//conversationDatasets/` - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new - # - # # Call the delete_conversation_dataset method. - # result = client.delete_conversation_dataset request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_conversation_dataset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest - - # Converts hash and nil to an 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_dataset.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_dataset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_conversation_dataset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.delete_conversation_dataset 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 - - ## - # Import data into the specified conversation dataset. Note that it - # is not allowed to import data to a conversation dataset that - # already has data in it. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::ImportConversationDataOperationMetadata ImportConversationDataOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ImportConversationDataOperationResponse ImportConversationDataOperationResponse} - # - # @overload import_conversation_data(request, options = nil) - # Pass arguments to `import_conversation_data` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_data(name: nil, input_config: nil) - # Pass arguments to `import_conversation_data` via keyword arguments. Note that at - # least one keyword argument is required. To 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. Dataset resource name. Format: - # `projects//locations//conversationDatasets/` - # @param input_config [::Google::Cloud::Dialogflow::V2::InputConfig, ::Hash] - # Required. Configuration describing where to import data from. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new - # - # # Call the import_conversation_data method. - # result = client.import_conversation_data request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_conversation_data request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest - - # Converts hash and nil to an 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_conversation_data.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_conversation_data.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_conversation_data.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_datasets_stub.import_conversation_data 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 ConversationDatasets REST API. - # - # This class represents the configuration for ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::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_conversation_dataset to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation_dataset.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation_dataset.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 ConversationDatasets 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_conversation_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation_dataset - ## - # RPC-specific configuration for `get_conversation_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation_dataset - ## - # RPC-specific configuration for `list_conversation_datasets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversation_datasets - ## - # RPC-specific configuration for `delete_conversation_dataset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_conversation_dataset - ## - # RPC-specific configuration for `import_conversation_data` - # @return [::Gapic::Config::Method] - # - attr_reader :import_conversation_data - - # @private - def initialize parent_rpcs = nil - create_conversation_dataset_config = parent_rpcs.create_conversation_dataset if parent_rpcs.respond_to? :create_conversation_dataset - @create_conversation_dataset = ::Gapic::Config::Method.new create_conversation_dataset_config - get_conversation_dataset_config = parent_rpcs.get_conversation_dataset if parent_rpcs.respond_to? :get_conversation_dataset - @get_conversation_dataset = ::Gapic::Config::Method.new get_conversation_dataset_config - list_conversation_datasets_config = parent_rpcs.list_conversation_datasets if parent_rpcs.respond_to? :list_conversation_datasets - @list_conversation_datasets = ::Gapic::Config::Method.new list_conversation_datasets_config - delete_conversation_dataset_config = parent_rpcs.delete_conversation_dataset if parent_rpcs.respond_to? :delete_conversation_dataset - @delete_conversation_dataset = ::Gapic::Config::Method.new delete_conversation_dataset_config - import_conversation_data_config = parent_rpcs.import_conversation_data if parent_rpcs.respond_to? :import_conversation_data - @import_conversation_data = ::Gapic::Config::Method.new import_conversation_data_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb deleted file mode 100644 index d6e78f68bdf0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb +++ /dev/null @@ -1,947 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module ConversationDatasets - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ConversationDatasets 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 ConversationDatasets 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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb deleted file mode 100644 index 1d4282fe9c2b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb +++ /dev/null @@ -1,410 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_dataset_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationDatasets - module Rest - ## - # REST service stub for the ConversationDatasets 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_conversation_dataset REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_conversation_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_dataset", - 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_conversation_dataset REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ConversationDataset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationDataset] - # A result object deserialized from the server's reply - def get_conversation_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_dataset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ConversationDataset.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_conversation_datasets REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListConversationDatasetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse] - # A result object deserialized from the server's reply - def list_conversation_datasets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_conversation_datasets_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_conversation_datasets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse.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_dataset REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_conversation_dataset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_conversation_dataset_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_dataset", - 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_conversation_data REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_conversation_data request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_conversation_data_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_conversation_data", - 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 create_conversation_dataset REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest] - # 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_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/conversationDatasets", - body: "conversation_dataset", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_conversation_dataset REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest] - # 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_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/conversationDatasets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationDatasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_conversation_datasets REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest] - # 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_conversation_datasets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/conversationDatasets", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/conversationDatasets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_conversation_dataset REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest] - # 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_dataset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationDatasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_conversation_data REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest] - # 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_conversation_data_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:importConversationData", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/conversationDatasets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:importConversationData", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationDatasets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb deleted file mode 100644 index 5d369255036d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/conversation_event.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dialogflow/v2/participant_pb' -require 'google/cloud/dialogflow/v2/session_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n3google/cloud/dialogflow/v2/conversation_event.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a\x17google/rpc/status.proto\"\xff\x03\n\x11\x43onversationEvent\x12\x14\n\x0c\x63onversation\x18\x01 \x01(\t\x12@\n\x04type\x18\x02 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.ConversationEvent.Type\x12(\n\x0c\x65rror_status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x42\n\x13new_message_payload\x18\x04 \x01(\x0b\x32#.google.cloud.dialogflow.v2.MessageH\x00\x12`\n\x1enew_recognition_result_payload\x18\x05 \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.StreamingRecognitionResultH\x00\"\xb6\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43ONVERSATION_STARTED\x10\x01\x12\x19\n\x15\x43ONVERSATION_FINISHED\x10\x02\x12\x1d\n\x19HUMAN_INTERVENTION_NEEDED\x10\x03\x12\x0f\n\x0bNEW_MESSAGE\x10\x05\x12\x1a\n\x16NEW_RECOGNITION_RESULT\x10\x07\x12\x17\n\x13UNRECOVERABLE_ERROR\x10\x04\x42\t\n\x07payloadB\x9c\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x16\x43onversationEventProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - ConversationEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationEvent").msgclass - ConversationEvent::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationEvent.Type").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_pb.rb deleted file mode 100644 index c171ffc226cc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/conversation_model.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 = "\n3google/cloud/dialogflow/v2/conversation_model.proto\x12\x1agoogle.cloud.dialogflow.v2\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\"\x8d\x08\n\x11\x43onversationModel\x12\x0c\n\x04name\x18\x01 \x01(\t\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?\n\x08\x64\x61tasets\x18\x04 \x03(\x0b\x32(.google.cloud.dialogflow.v2.InputDatasetB\x03\xe0\x41\x02\x12G\n\x05state\x18\x07 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.ConversationModel.StateB\x03\xe0\x41\x03\x12\x15\n\rlanguage_code\x18\x13 \x01(\t\x12g\n!article_suggestion_model_metadata\x18\x08 \x01(\x0b\x32:.google.cloud.dialogflow.v2.ArticleSuggestionModelMetadataH\x00\x12Y\n\x1asmart_reply_model_metadata\x18\t \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SmartReplyModelMetadataH\x00\x12\x1f\n\rsatisfies_pzs\x18\x19 \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x1a \x01(\x08\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\"\x91\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0e\n\nUNDEPLOYED\x10\x02\x12\r\n\tDEPLOYING\x10\x03\x12\x0c\n\x08\x44\x45PLOYED\x10\x04\x12\x0f\n\x0bUNDEPLOYING\x10\x05\x12\x0c\n\x08\x44\x45LETING\x10\x06\x12\n\n\x06\x46\x41ILED\x10\x07\x12\x0b\n\x07PENDING\x10\x08\"g\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\"\n\x1eSMART_REPLY_DUAL_ENCODER_MODEL\x10\x02\x12\x1a\n\x16SMART_REPLY_BERT_MODEL\x10\x06:\xbe\x01\xea\x41\xba\x01\n+dialogflow.googleapis.com/ConversationModel\x12Oprojects/{project}/locations/{location}/conversationModels/{conversation_model}\x12:projects/{project}/conversationModels/{conversation_model}B\x10\n\x0emodel_metadataB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"\xcf\x04\n\x1b\x43onversationModelEvaluation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12L\n\x11\x65valuation_config\x18\x06 \x01(\x0b\x32,.google.cloud.dialogflow.v2.EvaluationConfigB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Q\n\x13smart_reply_metrics\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SmartReplyMetricsB\x03\xe0\x41\x03H\x00\x12(\n\x1braw_human_eval_template_csv\x18\x08 \x01(\tB\x03\xe0\x41\x03:\xfa\x01\xea\x41\xf6\x01\n5dialogflow.googleapis.com/ConversationModelEvaluation\x12Sprojects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}\x12hprojects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}B\t\n\x07metrics\"\x9c\x04\n\x10\x45valuationConfig\x12?\n\x08\x64\x61tasets\x18\x03 \x03(\x0b\x32(.google.cloud.dialogflow.v2.InputDatasetB\x03\xe0\x41\x02\x12[\n\x12smart_reply_config\x18\x02 \x01(\x0b\x32=.google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfigH\x00\x12_\n\x14smart_compose_config\x18\x04 \x01(\x0b\x32?.google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfigH\x00\x1av\n\x10SmartReplyConfig\x12\x43\n\x12\x61llowlist_document\x18\x01 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/Document\x12\x1d\n\x10max_result_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1ax\n\x12SmartComposeConfig\x12\x43\n\x12\x61llowlist_document\x18\x01 \x01(\tB\'\xfa\x41$\n\"dialogflow.googleapis.com/Document\x12\x1d\n\x10max_result_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x42\x17\n\x15model_specific_config\"V\n\x0cInputDataset\x12\x46\n\x07\x64\x61taset\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationDataset\"{\n\x1e\x41rticleSuggestionModelMetadata\x12Y\n\x13training_model_type\x18\x03 \x01(\x0e\x32\x37.google.cloud.dialogflow.v2.ConversationModel.ModelTypeB\x03\xe0\x41\x01\"t\n\x17SmartReplyModelMetadata\x12Y\n\x13training_model_type\x18\x06 \x01(\x0e\x32\x37.google.cloud.dialogflow.v2.ConversationModel.ModelTypeB\x03\xe0\x41\x01\"\xc7\x01\n\x11SmartReplyMetrics\x12\x1a\n\x12\x61llowlist_coverage\x18\x01 \x01(\x02\x12P\n\rtop_n_metrics\x18\x02 \x03(\x0b\x32\x39.google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics\x12\x1a\n\x12\x63onversation_count\x18\x03 \x01(\x03\x1a(\n\x0bTopNMetrics\x12\t\n\x01n\x18\x01 \x01(\x05\x12\x0e\n\x06recall\x18\x02 \x01(\x02\"\x80\x01\n\x1e\x43reateConversationModelRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12N\n\x12\x63onversation_model\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.v2.ConversationModelB\x03\xe0\x41\x02\"0\n\x1bGetConversationModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"e\n\x1dListConversationModelsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\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\"\x85\x01\n\x1eListConversationModelsResponse\x12J\n\x13\x63onversation_models\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.v2.ConversationModel\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"3\n\x1e\x44\x65leteConversationModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"3\n\x1e\x44\x65ployConversationModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"5\n UndeployConversationModelRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\":\n%GetConversationModelEvaluationRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"o\n\'ListConversationModelEvaluationsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\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\"\xa4\x01\n(ListConversationModelEvaluationsResponse\x12_\n\x1e\x63onversation_model_evaluations\x18\x01 \x03(\x0b\x32\x37.google.cloud.dialogflow.v2.ConversationModelEvaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xde\x01\n(CreateConversationModelEvaluationRequest\x12M\n\x06parent\x18\x01 \x01(\tB=\xe0\x41\x02\xfa\x41\x37\x12\x35\x64ialogflow.googleapis.com/ConversationModelEvaluation\x12\x63\n\x1d\x63onversation_model_evaluation\x18\x02 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.ConversationModelEvaluationB\x03\xe0\x41\x02\"\xf6\x02\n(CreateConversationModelOperationMetadata\x12\x1a\n\x12\x63onversation_model\x18\x01 \x01(\t\x12Y\n\x05state\x18\x02 \x01(\x0e\x32J.google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"s\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\x0c\n\x08TRAINING\x10\x06\"\xa6\x01\n(DeployConversationModelOperationMetadata\x12\x1a\n\x12\x63onversation_model\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa8\x01\n*UndeployConversationModelOperationMetadata\x12\x1a\n\x12\x63onversation_model\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa6\x01\n(DeleteConversationModelOperationMetadata\x12\x1a\n\x12\x63onversation_model\x18\x01 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\tdone_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xf6\x02\n2CreateConversationModelEvaluationOperationMetadata\x12%\n\x1d\x63onversation_model_evaluation\x18\x01 \x01(\t\x12\x1a\n\x12\x63onversation_model\x18\x04 \x01(\t\x12\x63\n\x05state\x18\x02 \x01(\x0e\x32T.google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"g\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x32\xfe\x16\n\x12\x43onversationModels\x12\xe8\x02\n\x17\x43reateConversationModel\x12:.google.cloud.dialogflow.v2.CreateConversationModelRequest\x1a\x1d.google.longrunning.Operation\"\xf1\x01\xca\x41=\n\x11\x43onversationModel\x12(CreateConversationModelOperationMetadata\xda\x41\x19parent,conversation_model\x82\xd3\xe4\x93\x02\x8e\x01\"*/v2/{parent=projects/*}/conversationModels:\x12\x63onversation_modelZL\"6/v2/{parent=projects/*/locations/*}/conversationModels:\x12\x63onversation_model\x12\xf3\x01\n\x14GetConversationModel\x12\x37.google.cloud.dialogflow.v2.GetConversationModelRequest\x1a-.google.cloud.dialogflow.v2.ConversationModel\"s\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\x12*/v2/{name=projects/*/conversationModels/*}Z8\x12\x36/v2/{name=projects/*/locations/*/conversationModels/*}\x12\x86\x02\n\x16ListConversationModels\x12\x39.google.cloud.dialogflow.v2.ListConversationModelsRequest\x1a:.google.cloud.dialogflow.v2.ListConversationModelsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v2/{parent=projects/*}/conversationModelsZ8\x12\x36/v2/{parent=projects/*/locations/*}/conversationModels\x12\xae\x02\n\x17\x44\x65leteConversationModel\x12:.google.cloud.dialogflow.v2.DeleteConversationModelRequest\x1a\x1d.google.longrunning.Operation\"\xb7\x01\xca\x41\x41\n\x15google.protobuf.Empty\x12(DeleteConversationModelOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66**/v2/{name=projects/*/conversationModels/*}Z8*6/v2/{name=projects/*/locations/*/conversationModels/*}\x12\xbb\x02\n\x17\x44\x65ployConversationModel\x12:.google.cloud.dialogflow.v2.DeployConversationModelRequest\x1a\x1d.google.longrunning.Operation\"\xc4\x01\xca\x41\x41\n\x15google.protobuf.Empty\x12(DeployConversationModelOperationMetadata\x82\xd3\xe4\x93\x02z\"1/v2/{name=projects/*/conversationModels/*}:deploy:\x01*ZB\"=/v2/{name=projects/*/locations/*/conversationModels/*}:deploy:\x01*\x12\xc5\x02\n\x19UndeployConversationModel\x12<.google.cloud.dialogflow.v2.UndeployConversationModelRequest\x1a\x1d.google.longrunning.Operation\"\xca\x01\xca\x41\x43\n\x15google.protobuf.Empty\x12*UndeployConversationModelOperationMetadata\x82\xd3\xe4\x93\x02~\"3/v2/{name=projects/*/conversationModels/*}:undeploy:\x01*ZD\"?/v2/{name=projects/*/locations/*/conversationModels/*}:undeploy:\x01*\x12\xaf\x02\n\x1eGetConversationModelEvaluation\x12\x41.google.cloud.dialogflow.v2.GetConversationModelEvaluationRequest\x1a\x37.google.cloud.dialogflow.v2.ConversationModelEvaluation\"\x90\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x82\x01\x12\x38/v2/{name=projects/*/conversationModels/*/evaluations/*}ZF\x12\x44/v2/{name=projects/*/locations/*/conversationModels/*/evaluations/*}\x12\xc2\x02\n ListConversationModelEvaluations\x12\x43.google.cloud.dialogflow.v2.ListConversationModelEvaluationsRequest\x1a\x44.google.cloud.dialogflow.v2.ListConversationModelEvaluationsResponse\"\x92\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x82\x01\x12\x38/v2/{parent=projects/*/conversationModels/*}/evaluationsZF\x12\x44/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations\x12\xd5\x02\n!CreateConversationModelEvaluation\x12\x44.google.cloud.dialogflow.v2.CreateConversationModelEvaluationRequest\x1a\x1d.google.longrunning.Operation\"\xca\x01\xca\x41Q\n\x1b\x43onversationModelEvaluation\x12\x32\x43reateConversationModelEvaluationOperationMetadata\xda\x41$parent,conversation_model_evaluation\x82\xd3\xe4\x93\x02I\"D/v2/{parent=projects/*/locations/*/conversationModels/*}/evaluations:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9c\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x16\x43onversationModelProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - ConversationModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationModel").msgclass - ConversationModel::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationModel.State").enummodule - ConversationModel::ModelType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationModel.ModelType").enummodule - ConversationModelEvaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationModelEvaluation").msgclass - EvaluationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EvaluationConfig").msgclass - EvaluationConfig::SmartReplyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EvaluationConfig.SmartReplyConfig").msgclass - EvaluationConfig::SmartComposeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EvaluationConfig.SmartComposeConfig").msgclass - InputDataset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputDataset").msgclass - ArticleSuggestionModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ArticleSuggestionModelMetadata").msgclass - SmartReplyModelMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyModelMetadata").msgclass - SmartReplyMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyMetrics").msgclass - SmartReplyMetrics::TopNMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyMetrics.TopNMetrics").msgclass - CreateConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelRequest").msgclass - GetConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationModelRequest").msgclass - ListConversationModelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationModelsRequest").msgclass - ListConversationModelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationModelsResponse").msgclass - DeleteConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationModelRequest").msgclass - DeployConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeployConversationModelRequest").msgclass - UndeployConversationModelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UndeployConversationModelRequest").msgclass - GetConversationModelEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationModelEvaluationRequest").msgclass - ListConversationModelEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationModelEvaluationsRequest").msgclass - ListConversationModelEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationModelEvaluationsResponse").msgclass - CreateConversationModelEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelEvaluationRequest").msgclass - CreateConversationModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata").msgclass - CreateConversationModelOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata.State").enummodule - DeployConversationModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata").msgclass - UndeployConversationModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata").msgclass - DeleteConversationModelOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata").msgclass - CreateConversationModelEvaluationOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata").msgclass - CreateConversationModelEvaluationOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationModelEvaluationOperationMetadata.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_services_pb.rb deleted file mode 100644 index 20b1fc988c19..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_model_services_pb.rb +++ /dev/null @@ -1,103 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/conversation_model.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/conversation_model_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationModels - # Manages a collection of models for human agent assistant. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.ConversationModels' - - # Creates a model. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] - # - `response`: - # [ConversationModel][google.cloud.dialogflow.v2.ConversationModel] - rpc :CreateConversationModel, ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, ::Google::Longrunning::Operation - # Gets conversation model. - rpc :GetConversationModel, ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, ::Google::Cloud::Dialogflow::V2::ConversationModel - # Lists conversation models. - rpc :ListConversationModels, ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, ::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse - # Deletes a model. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - rpc :DeleteConversationModel, ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, ::Google::Longrunning::Operation - # Deploys a model. If a model is already deployed, deploying it - # has no effect. A model can only serve prediction requests after it gets - # deployed. For article suggestion, custom model will not be used unless - # it is deployed. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - rpc :DeployConversationModel, ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, ::Google::Longrunning::Operation - # Undeploys a model. If the model is not deployed this method has no effect. - # If the model is currently being used: - # - For article suggestion, article suggestion will fallback to the default - # model if model is undeployed. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - rpc :UndeployConversationModel, ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, ::Google::Longrunning::Operation - # Gets an evaluation of conversation model. - rpc :GetConversationModelEvaluation, ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation - # Lists evaluations of a conversation model. - rpc :ListConversationModelEvaluations, ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse - # Creates evaluation of a conversation model. - rpc :CreateConversationModelEvaluation, ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models.rb deleted file mode 100644 index 838bdbd3e609..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/conversation_models/credentials" -require "google/cloud/dialogflow/v2/conversation_models/paths" -require "google/cloud/dialogflow/v2/conversation_models/operations" -require "google/cloud/dialogflow/v2/conversation_models/client" -require "google/cloud/dialogflow/v2/conversation_models/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Manages a collection of models for human agent assistant. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/conversation_models" - # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/conversation_models/rest" - # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - module ConversationModels - end - end - end - end -end - -helper_path = ::File.join __dir__, "conversation_models", "helpers.rb" -require "google/cloud/dialogflow/v2/conversation_models/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb deleted file mode 100644 index 28a4a2fd13e9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/client.rb +++ /dev/null @@ -1,1371 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_model_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationModels - ## - # Client for the ConversationModels service. - # - # Manages a collection of models for human agent assistant. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversation_models_stub - - ## - # Configure the ConversationModels Client class. - # - # See {::Google::Cloud::Dialogflow::V2::ConversationModels::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationModels clients - # ::Google::Cloud::Dialogflow::V2::ConversationModels::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationModels 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::Dialogflow::V2::ConversationModels::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 - @conversation_models_stub.universe_domain - end - - ## - # Create a new ConversationModels client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationModels 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/dialogflow/v2/conversation_model_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 - - @conversation_models_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::ConversationModels::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 - ) - - @conversation_models_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 = @conversation_models_stub.endpoint - config.universe_domain = @conversation_models_stub.universe_domain - config.logger = @conversation_models_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationModels::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 - @conversation_models_stub.logger - end - - # Service calls - - ## - # Creates a model. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::CreateConversationModelOperationMetadata CreateConversationModelOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ConversationModel ConversationModel} - # - # @overload create_conversation_model(request, options = nil) - # Pass arguments to `create_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(parent: nil, conversation_model: nil) - # Pass arguments to `create_conversation_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 parent [::String] - # The project to create conversation model for. Format: - # `projects/` - # @param conversation_model [::Google::Cloud::Dialogflow::V2::ConversationModel, ::Hash] - # Required. The conversation model 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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new - # - # # Call the create_conversation_model method. - # result = client.create_conversation_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 create_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest - - # Converts hash and nil to 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_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.call_rpc :create_conversation_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 conversation model. - # - # @overload get_conversation_model(request, options = nil) - # Pass arguments to `get_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `get_conversation_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 name [::String] - # Required. The conversation model to retrieve. Format: - # `projects//conversationModels/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationModel] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationModel] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new - # - # # Call the get_conversation_model method. - # result = client.get_conversation_model request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. - # p result - # - def get_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest - - # Converts hash and nil to 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_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.call_rpc :get_conversation_model, 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 conversation models. - # - # @overload list_conversation_models(request, options = nil) - # Pass arguments to `list_conversation_models` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_models(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_conversation_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 parent [::String] - # Required. The project to list all conversation models for. - # Format: `projects/` - # @param page_size [::Integer] - # Optional. Maximum number of conversation models to return in a single - # page. By default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new - # - # # Call the list_conversation_models method. - # result = client.list_conversation_models 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::Dialogflow::V2::ConversationModel. - # p item - # end - # - def list_conversation_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest - - # Converts hash and nil to 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_conversation_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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_conversation_models.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_conversation_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.call_rpc :list_conversation_models, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @conversation_models_stub, :list_conversation_models, 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 model. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::DeleteConversationModelOperationMetadata DeleteConversationModelOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload delete_conversation_model(request, options = nil) - # Pass arguments to `delete_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `delete_conversation_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 name [::String] - # Required. The conversation model to delete. Format: - # `projects//conversationModels/` - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new - # - # # Call the delete_conversation_model method. - # result = client.delete_conversation_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 delete_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest - - # Converts hash and nil to 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_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.call_rpc :delete_conversation_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 - - ## - # Deploys a model. If a model is already deployed, deploying it - # has no effect. A model can only serve prediction requests after it gets - # deployed. For article suggestion, custom model will not be used unless - # it is deployed. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::DeployConversationModelOperationMetadata DeployConversationModelOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload deploy_conversation_model(request, options = nil) - # Pass arguments to `deploy_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload deploy_conversation_model(name: nil) - # Pass arguments to `deploy_conversation_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 name [::String] - # Required. The conversation model to deploy. Format: - # `projects//conversationModels/` - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new - # - # # Call the deploy_conversation_model method. - # result = client.deploy_conversation_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 deploy_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.deploy_conversation_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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.deploy_conversation_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.deploy_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.call_rpc :deploy_conversation_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 - - ## - # Undeploys a model. If the model is not deployed this method has no effect. - # If the model is currently being used: - # - For article suggestion, article suggestion will fallback to the default - # model if model is undeployed. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::UndeployConversationModelOperationMetadata UndeployConversationModelOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload undeploy_conversation_model(request, options = nil) - # Pass arguments to `undeploy_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undeploy_conversation_model(name: nil) - # Pass arguments to `undeploy_conversation_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 name [::String] - # Required. The conversation model to undeploy. Format: - # `projects//conversationModels/` - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new - # - # # Call the undeploy_conversation_model method. - # result = client.undeploy_conversation_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 undeploy_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.undeploy_conversation_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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.undeploy_conversation_model.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undeploy_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.call_rpc :undeploy_conversation_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 an evaluation of conversation model. - # - # @overload get_conversation_model_evaluation(request, options = nil) - # Pass arguments to `get_conversation_model_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model_evaluation(name: nil) - # Pass arguments to `get_conversation_model_evaluation` via keyword arguments. Note that at - # least one keyword argument is required. To 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 conversation model evaluation resource name. Format: - # `projects//conversationModels//evaluations/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new - # - # # Call the get_conversation_model_evaluation method. - # result = client.get_conversation_model_evaluation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. - # p result - # - def get_conversation_model_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest - - # Converts hash and nil to 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_model_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_model_evaluation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_conversation_model_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.call_rpc :get_conversation_model_evaluation, 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 evaluations of a conversation model. - # - # @overload list_conversation_model_evaluations(request, options = nil) - # Pass arguments to `list_conversation_model_evaluations` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_model_evaluations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_conversation_model_evaluations` via keyword arguments. Note that at - # least one keyword argument is 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 conversation model resource name. Format: - # `projects//conversationModels/` - # @param page_size [::Integer] - # Optional. Maximum number of evaluations to return in a - # single page. By default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new - # - # # Call the list_conversation_model_evaluations method. - # result = client.list_conversation_model_evaluations 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::Dialogflow::V2::ConversationModelEvaluation. - # p item - # end - # - def list_conversation_model_evaluations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest - - # Converts hash and nil to 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_conversation_model_evaluations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_conversation_model_evaluations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_conversation_model_evaluations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.call_rpc :list_conversation_model_evaluations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @conversation_models_stub, :list_conversation_model_evaluations, 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 evaluation of a conversation model. - # - # @overload create_conversation_model_evaluation(request, options = nil) - # Pass arguments to `create_conversation_model_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model_evaluation(parent: nil, conversation_model_evaluation: nil) - # Pass arguments to `create_conversation_model_evaluation` via keyword arguments. Note that at - # least one keyword argument is 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 conversation model resource name. Format: - # `projects//locations//conversationModels/` - # @param conversation_model_evaluation [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation, ::Hash] - # Required. The conversation model evaluation to be created. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new - # - # # Call the create_conversation_model_evaluation method. - # result = client.create_conversation_model_evaluation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_conversation_model_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest - - # Converts hash and nil to 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_model_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_model_evaluation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_conversation_model_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.call_rpc :create_conversation_model_evaluation, 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 ConversationModels API. - # - # This class represents the configuration for ConversationModels, - # 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::Dialogflow::V2::ConversationModels::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_conversation_model to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation_model.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation_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::Dialogflow::V2::ConversationModels::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 ConversationModels 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation_model - ## - # RPC-specific configuration for `get_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation_model - ## - # RPC-specific configuration for `list_conversation_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversation_models - ## - # RPC-specific configuration for `delete_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_conversation_model - ## - # RPC-specific configuration for `deploy_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_conversation_model - ## - # RPC-specific configuration for `undeploy_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_conversation_model - ## - # RPC-specific configuration for `get_conversation_model_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation_model_evaluation - ## - # RPC-specific configuration for `list_conversation_model_evaluations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversation_model_evaluations - ## - # RPC-specific configuration for `create_conversation_model_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation_model_evaluation - - # @private - def initialize parent_rpcs = nil - create_conversation_model_config = parent_rpcs.create_conversation_model if parent_rpcs.respond_to? :create_conversation_model - @create_conversation_model = ::Gapic::Config::Method.new create_conversation_model_config - get_conversation_model_config = parent_rpcs.get_conversation_model if parent_rpcs.respond_to? :get_conversation_model - @get_conversation_model = ::Gapic::Config::Method.new get_conversation_model_config - list_conversation_models_config = parent_rpcs.list_conversation_models if parent_rpcs.respond_to? :list_conversation_models - @list_conversation_models = ::Gapic::Config::Method.new list_conversation_models_config - delete_conversation_model_config = parent_rpcs.delete_conversation_model if parent_rpcs.respond_to? :delete_conversation_model - @delete_conversation_model = ::Gapic::Config::Method.new delete_conversation_model_config - deploy_conversation_model_config = parent_rpcs.deploy_conversation_model if parent_rpcs.respond_to? :deploy_conversation_model - @deploy_conversation_model = ::Gapic::Config::Method.new deploy_conversation_model_config - undeploy_conversation_model_config = parent_rpcs.undeploy_conversation_model if parent_rpcs.respond_to? :undeploy_conversation_model - @undeploy_conversation_model = ::Gapic::Config::Method.new undeploy_conversation_model_config - get_conversation_model_evaluation_config = parent_rpcs.get_conversation_model_evaluation if parent_rpcs.respond_to? :get_conversation_model_evaluation - @get_conversation_model_evaluation = ::Gapic::Config::Method.new get_conversation_model_evaluation_config - list_conversation_model_evaluations_config = parent_rpcs.list_conversation_model_evaluations if parent_rpcs.respond_to? :list_conversation_model_evaluations - @list_conversation_model_evaluations = ::Gapic::Config::Method.new list_conversation_model_evaluations_config - create_conversation_model_evaluation_config = parent_rpcs.create_conversation_model_evaluation if parent_rpcs.respond_to? :create_conversation_model_evaluation - @create_conversation_model_evaluation = ::Gapic::Config::Method.new create_conversation_model_evaluation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/credentials.rb deleted file mode 100644 index dbb05638c52e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationModels - # Credentials for the ConversationModels API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb deleted file mode 100644 index 71432ed69344..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module ConversationModels - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ConversationModels 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 ConversationModels 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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/paths.rb deleted file mode 100644 index 820b0249a7e2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/paths.rb +++ /dev/null @@ -1,183 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module ConversationModels - # Path helper methods for the ConversationModels API. - module Paths - ## - # Create a fully-qualified ConversationDataset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}` - # - # @param project [String] - # @param location [String] - # @param conversation_dataset [String] - # - # @return [::String] - def conversation_dataset_path project:, location:, conversation_dataset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversationDatasets/#{conversation_dataset}" - end - - ## - # Create a fully-qualified ConversationModel resource string. - # - # @overload conversation_model_path(project:, location:, conversation_model:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversationModels/{conversation_model}` - # - # @param project [String] - # @param location [String] - # @param conversation_model [String] - # - # @overload conversation_model_path(project:, conversation_model:) - # The resource will be in the following format: - # - # `projects/{project}/conversationModels/{conversation_model}` - # - # @param project [String] - # @param conversation_model [String] - # - # @return [::String] - def conversation_model_path **args - resources = { - "conversation_model:location:project" => (proc do |project:, location:, conversation_model:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}" - end), - "conversation_model:project" => (proc do |project:, conversation_model:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/conversationModels/#{conversation_model}" - 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 ConversationModelEvaluation resource string. - # - # @overload conversation_model_evaluation_path(project:, conversation_model:, evaluation:) - # The resource will be in the following format: - # - # `projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}` - # - # @param project [String] - # @param conversation_model [String] - # @param evaluation [String] - # - # @overload conversation_model_evaluation_path(project:, location:, conversation_model:, evaluation:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}` - # - # @param project [String] - # @param location [String] - # @param conversation_model [String] - # @param evaluation [String] - # - # @return [::String] - def conversation_model_evaluation_path **args - resources = { - "conversation_model:evaluation:project" => (proc do |project:, conversation_model:, evaluation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "conversation_model cannot contain /" if conversation_model.to_s.include? "/" - - "projects/#{project}/conversationModels/#{conversation_model}/evaluations/#{evaluation}" - end), - "conversation_model:evaluation:location:project" => (proc do |project:, location:, conversation_model:, evaluation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "conversation_model cannot contain /" if conversation_model.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}/evaluations/#{evaluation}" - 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:, knowledge_base:, document:) - # The resource will be in the following format: - # - # `projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}` - # - # @param project [String] - # @param knowledge_base [String] - # @param document [String] - # - # @overload document_path(project:, location:, knowledge_base:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param knowledge_base [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" - - "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}" - end), - "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" - - "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/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 - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest.rb deleted file mode 100644 index d4682b5d4ea8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/conversation_models/credentials" -require "google/cloud/dialogflow/v2/conversation_models/paths" -require "google/cloud/dialogflow/v2/conversation_models/rest/operations" -require "google/cloud/dialogflow/v2/conversation_models/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Manages a collection of models for human agent assistant. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/conversation_models/rest" - # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - module ConversationModels - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/conversation_models/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb deleted file mode 100644 index e78945a16b3c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +++ /dev/null @@ -1,1273 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_model_pb" -require "google/cloud/dialogflow/v2/conversation_models/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationModels - module Rest - ## - # REST client for the ConversationModels service. - # - # Manages a collection of models for human agent assistant. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversation_models_stub - - ## - # Configure the ConversationModels Client class. - # - # See {::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationModels clients - # ::Google::Cloud::Dialogflow::V2::ConversationModels::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationModels 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::Dialogflow::V2::ConversationModels::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 - @conversation_models_stub.universe_domain - end - - ## - # Create a new ConversationModels REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationModels 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::Dialogflow::V2::ConversationModels::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 - - @conversation_models_stub = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @conversation_models_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 = @conversation_models_stub.endpoint - config.universe_domain = @conversation_models_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @conversation_models_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationModels::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 - @conversation_models_stub.logger - end - - # Service calls - - ## - # Creates a model. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::CreateConversationModelOperationMetadata CreateConversationModelOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ConversationModel ConversationModel} - # - # @overload create_conversation_model(request, options = nil) - # Pass arguments to `create_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(parent: nil, conversation_model: nil) - # Pass arguments to `create_conversation_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 parent [::String] - # The project to create conversation model for. Format: - # `projects/` - # @param conversation_model [::Google::Cloud::Dialogflow::V2::ConversationModel, ::Hash] - # Required. The conversation model 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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new - # - # # Call the create_conversation_model method. - # result = client.create_conversation_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 create_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest - - # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.create_conversation_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 conversation model. - # - # @overload get_conversation_model(request, options = nil) - # Pass arguments to `get_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `get_conversation_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 name [::String] - # Required. The conversation model to retrieve. Format: - # `projects//conversationModels/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationModel] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationModel] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new - # - # # Call the get_conversation_model method. - # result = client.get_conversation_model request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. - # p result - # - def get_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest - - # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.get_conversation_model 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 conversation models. - # - # @overload list_conversation_models(request, options = nil) - # Pass arguments to `list_conversation_models` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_models(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_conversation_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 parent [::String] - # Required. The project to list all conversation models for. - # Format: `projects/` - # @param page_size [::Integer] - # Optional. Maximum number of conversation models to return in a single - # page. By default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModel>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new - # - # # Call the list_conversation_models method. - # result = client.list_conversation_models 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::Dialogflow::V2::ConversationModel. - # p item - # end - # - def list_conversation_models request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest - - # Converts hash and nil to an 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_conversation_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_conversation_models.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_conversation_models.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.list_conversation_models request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @conversation_models_stub, :list_conversation_models, "conversation_models", 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 model. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::DeleteConversationModelOperationMetadata DeleteConversationModelOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload delete_conversation_model(request, options = nil) - # Pass arguments to `delete_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model(name: nil) - # Pass arguments to `delete_conversation_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 name [::String] - # Required. The conversation model to delete. Format: - # `projects//conversationModels/` - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new - # - # # Call the delete_conversation_model method. - # result = client.delete_conversation_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 delete_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest - - # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.delete_conversation_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 - - ## - # Deploys a model. If a model is already deployed, deploying it - # has no effect. A model can only serve prediction requests after it gets - # deployed. For article suggestion, custom model will not be used unless - # it is deployed. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::DeployConversationModelOperationMetadata DeployConversationModelOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload deploy_conversation_model(request, options = nil) - # Pass arguments to `deploy_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload deploy_conversation_model(name: nil) - # Pass arguments to `deploy_conversation_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 name [::String] - # Required. The conversation model to deploy. Format: - # `projects//conversationModels/` - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new - # - # # Call the deploy_conversation_model method. - # result = client.deploy_conversation_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 deploy_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.deploy_conversation_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.deploy_conversation_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.deploy_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.deploy_conversation_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 - - ## - # Undeploys a model. If the model is not deployed this method has no effect. - # If the model is currently being used: - # - For article suggestion, article suggestion will fallback to the default - # model if model is undeployed. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::UndeployConversationModelOperationMetadata UndeployConversationModelOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload undeploy_conversation_model(request, options = nil) - # Pass arguments to `undeploy_conversation_model` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undeploy_conversation_model(name: nil) - # Pass arguments to `undeploy_conversation_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 name [::String] - # Required. The conversation model to undeploy. Format: - # `projects//conversationModels/` - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new - # - # # Call the undeploy_conversation_model method. - # result = client.undeploy_conversation_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 undeploy_conversation_model request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.undeploy_conversation_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.undeploy_conversation_model.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undeploy_conversation_model.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.undeploy_conversation_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 an evaluation of conversation model. - # - # @overload get_conversation_model_evaluation(request, options = nil) - # Pass arguments to `get_conversation_model_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model_evaluation(name: nil) - # Pass arguments to `get_conversation_model_evaluation` via keyword arguments. Note that at - # least one keyword argument is required. To 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 conversation model evaluation resource name. Format: - # `projects//conversationModels//evaluations/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new - # - # # Call the get_conversation_model_evaluation method. - # result = client.get_conversation_model_evaluation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. - # p result - # - def get_conversation_model_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest - - # Converts hash and nil to an 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_model_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_model_evaluation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_conversation_model_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.get_conversation_model_evaluation 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 evaluations of a conversation model. - # - # @overload list_conversation_model_evaluations(request, options = nil) - # Pass arguments to `list_conversation_model_evaluations` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_model_evaluations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_conversation_model_evaluations` via keyword arguments. Note that at - # least one keyword argument is 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 conversation model resource name. Format: - # `projects//conversationModels/` - # @param page_size [::Integer] - # Optional. Maximum number of evaluations to return in a - # single page. By default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new - # - # # Call the list_conversation_model_evaluations method. - # result = client.list_conversation_model_evaluations 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::Dialogflow::V2::ConversationModelEvaluation. - # p item - # end - # - def list_conversation_model_evaluations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest - - # Converts hash and nil to an 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_conversation_model_evaluations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_conversation_model_evaluations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_conversation_model_evaluations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.list_conversation_model_evaluations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @conversation_models_stub, :list_conversation_model_evaluations, "conversation_model_evaluations", 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 evaluation of a conversation model. - # - # @overload create_conversation_model_evaluation(request, options = nil) - # Pass arguments to `create_conversation_model_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_model_evaluation(parent: nil, conversation_model_evaluation: nil) - # Pass arguments to `create_conversation_model_evaluation` via keyword arguments. Note that at - # least one keyword argument is 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 conversation model resource name. Format: - # `projects//locations//conversationModels/` - # @param conversation_model_evaluation [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation, ::Hash] - # Required. The conversation model evaluation to be created. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new - # - # # Call the create_conversation_model_evaluation method. - # result = client.create_conversation_model_evaluation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_conversation_model_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest - - # Converts hash and nil to an 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_model_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_model_evaluation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_conversation_model_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_models_stub.create_conversation_model_evaluation 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 ConversationModels REST API. - # - # This class represents the configuration for ConversationModels 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::Dialogflow::V2::ConversationModels::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_conversation_model to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation_model.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 ConversationModels 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation_model - ## - # RPC-specific configuration for `get_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation_model - ## - # RPC-specific configuration for `list_conversation_models` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversation_models - ## - # RPC-specific configuration for `delete_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_conversation_model - ## - # RPC-specific configuration for `deploy_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_conversation_model - ## - # RPC-specific configuration for `undeploy_conversation_model` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_conversation_model - ## - # RPC-specific configuration for `get_conversation_model_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation_model_evaluation - ## - # RPC-specific configuration for `list_conversation_model_evaluations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversation_model_evaluations - ## - # RPC-specific configuration for `create_conversation_model_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation_model_evaluation - - # @private - def initialize parent_rpcs = nil - create_conversation_model_config = parent_rpcs.create_conversation_model if parent_rpcs.respond_to? :create_conversation_model - @create_conversation_model = ::Gapic::Config::Method.new create_conversation_model_config - get_conversation_model_config = parent_rpcs.get_conversation_model if parent_rpcs.respond_to? :get_conversation_model - @get_conversation_model = ::Gapic::Config::Method.new get_conversation_model_config - list_conversation_models_config = parent_rpcs.list_conversation_models if parent_rpcs.respond_to? :list_conversation_models - @list_conversation_models = ::Gapic::Config::Method.new list_conversation_models_config - delete_conversation_model_config = parent_rpcs.delete_conversation_model if parent_rpcs.respond_to? :delete_conversation_model - @delete_conversation_model = ::Gapic::Config::Method.new delete_conversation_model_config - deploy_conversation_model_config = parent_rpcs.deploy_conversation_model if parent_rpcs.respond_to? :deploy_conversation_model - @deploy_conversation_model = ::Gapic::Config::Method.new deploy_conversation_model_config - undeploy_conversation_model_config = parent_rpcs.undeploy_conversation_model if parent_rpcs.respond_to? :undeploy_conversation_model - @undeploy_conversation_model = ::Gapic::Config::Method.new undeploy_conversation_model_config - get_conversation_model_evaluation_config = parent_rpcs.get_conversation_model_evaluation if parent_rpcs.respond_to? :get_conversation_model_evaluation - @get_conversation_model_evaluation = ::Gapic::Config::Method.new get_conversation_model_evaluation_config - list_conversation_model_evaluations_config = parent_rpcs.list_conversation_model_evaluations if parent_rpcs.respond_to? :list_conversation_model_evaluations - @list_conversation_model_evaluations = ::Gapic::Config::Method.new list_conversation_model_evaluations_config - create_conversation_model_evaluation_config = parent_rpcs.create_conversation_model_evaluation if parent_rpcs.respond_to? :create_conversation_model_evaluation - @create_conversation_model_evaluation = ::Gapic::Config::Method.new create_conversation_model_evaluation_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb deleted file mode 100644 index 3a713822e9d0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb +++ /dev/null @@ -1,947 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module ConversationModels - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ConversationModels 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 ConversationModels 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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb deleted file mode 100644 index 8fea35bb3655..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb +++ /dev/null @@ -1,693 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_model_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationModels - module Rest - ## - # REST service stub for the ConversationModels 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_conversation_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_conversation_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_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: "create_conversation_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 get_conversation_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ConversationModel] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationModel] - # A result object deserialized from the server's reply - def get_conversation_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_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: "get_conversation_model", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ConversationModel.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_conversation_models REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListConversationModelsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse] - # A result object deserialized from the server's reply - def list_conversation_models request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_conversation_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_conversation_models", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse.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_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_conversation_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_conversation_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: "delete_conversation_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 deploy_conversation_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 deploy_conversation_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_deploy_conversation_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: "deploy_conversation_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 undeploy_conversation_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 undeploy_conversation_model request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_conversation_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: "undeploy_conversation_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 get_conversation_model_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ConversationModelEvaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] - # A result object deserialized from the server's reply - def get_conversation_model_evaluation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_model_evaluation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_model_evaluation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation.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_conversation_model_evaluations REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListConversationModelEvaluationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse] - # A result object deserialized from the server's reply - def list_conversation_model_evaluations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_conversation_model_evaluations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_conversation_model_evaluations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse.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_model_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_conversation_model_evaluation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_model_evaluation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_model_evaluation", - 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 create_conversation_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/conversationModels", - body: "conversation_model", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/conversationModels", - body: "conversation_model", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_conversation_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_conversation_models REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest] - # 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_conversation_models_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/conversationModels", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/conversationModels", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_conversation_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest] - # 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_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the deploy_conversation_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_deploy_conversation_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:deploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:deploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undeploy_conversation_model REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undeploy_conversation_model_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:undeploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:undeploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_conversation_model_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest] - # 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_model_evaluation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/conversationModels/[^/]+/evaluations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/evaluations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_conversation_model_evaluations REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest] - # 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_conversation_model_evaluations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/evaluations", - matches: [ - ["parent", %r{^projects/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/evaluations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_conversation_model_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest] - # 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_model_evaluation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/evaluations", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/conversationModels/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb deleted file mode 100644 index 83f9f95b1577..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_pb.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/conversation.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/dialogflow/v2/conversation_profile_pb' -require 'google/cloud/dialogflow/v2/generator_pb' -require 'google/cloud/dialogflow/v2/participant_pb' -require 'google/cloud/dialogflow/v2/session_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/cloud/dialogflow/v2/conversation.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/dialogflow/v2/conversation_profile.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf4\x16\n\x0c\x43onversation\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12U\n\x0flifecycle_state\x18\x02 \x01(\x0e\x32\x37.google.cloud.dialogflow.v2.Conversation.LifecycleStateB\x03\xe0\x41\x03\x12S\n\x14\x63onversation_profile\x18\x03 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\x12N\n\x0cphone_number\x18\x04 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.ConversationPhoneNumberB\x03\xe0\x41\x03\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\x12[\n\x12\x63onversation_stage\x18\x07 \x01(\x0e\x32:.google.cloud.dialogflow.v2.Conversation.ConversationStageB\x03\xe0\x41\x01\x12h\n\x19telephony_connection_info\x18\n \x01(\x0b\x32@.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfoB\x03\xe0\x41\x03\x12]\n\x1cinitial_conversation_profile\x18\x0f \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x06\xe0\x41\x01\xe0\x41\x03\x12q\n\x1bingested_context_references\x18\x11 \x03(\x0b\x32G.google.cloud.dialogflow.v2.Conversation.IngestedContextReferencesEntryB\x03\xe0\x41\x03\x12o\n\x1ainitial_generator_contexts\x18\x12 \x03(\x0b\x32\x46.google.cloud.dialogflow.v2.Conversation.InitialGeneratorContextsEntryB\x03\xe0\x41\x03\x1a\x8e\x03\n\x17TelephonyConnectionInfo\x12\x1a\n\rdialed_number\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03sdp\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x64\n\x0bsip_headers\x18\x0c \x03(\x0b\x32J.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeaderB\x03\xe0\x41\x03\x12n\n\x13\x65xtra_mime_contents\x18\r \x03(\x0b\x32L.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContentB\x03\xe0\x41\x03\x1a\x32\n\tSipHeader\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a;\n\x0bMimeContent\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ontent\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x01\x1a\xac\x05\n\x10\x43ontextReference\x12g\n\x10\x63ontext_contents\x18\x01 \x03(\x0b\x32H.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContentB\x03\xe0\x41\x02\x12^\n\x0bupdate_mode\x18\x02 \x01(\x0e\x32\x44.google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateModeB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\xb6\x02\n\x0e\x43ontextContent\x12\x14\n\x07\x63ontent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12s\n\x0e\x63ontent_format\x18\x02 \x01(\x0e\x32V.google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormatB\x03\xe0\x41\x02\x12\x37\n\x0eingestion_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\ranswer_record\x18\x04 \x01(\t\"I\n\rContentFormat\x12\x1e\n\x1a\x43ONTENT_FORMAT_UNSPECIFIED\x10\x00\x12\x08\n\x04JSON\x10\x01\x12\x0e\n\nPLAIN_TEXT\x10\x02\"D\n\nUpdateMode\x12\x1b\n\x17UPDATE_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41PPEND\x10\x01\x12\r\n\tOVERWRITE\x10\x02\x1a\xa6\x02\n\x10GeneratorContext\x12\x64\n\x0egenerator_type\x18\x01 \x01(\x0e\x32G.google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorTypeB\x03\xe0\x41\x03\"\xab\x01\n\rGeneratorType\x12\x1e\n\x1aGENERATOR_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFREE_FORM\x10\x01\x12\x12\n\x0e\x41GENT_COACHING\x10\x02\x12\x11\n\rSUMMARIZATION\x10\x03\x12\x0f\n\x0bTRANSLATION\x10\x04\x12\x12\n\x0e\x41GENT_FEEDBACK\x10\x05\x12\x1f\n\x1b\x43USTOMER_MESSAGE_GENERATION\x10\x06\x1a{\n\x1eIngestedContextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\x1az\n\x1dInitialGeneratorContextsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.GeneratorContext:\x02\x38\x01\"Q\n\x0eLifecycleState\x12\x1f\n\x1bLIFECYCLE_STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\r\n\tCOMPLETED\x10\x02\"h\n\x11\x43onversationStage\x12\"\n\x1e\x43ONVERSATION_STAGE_UNSPECIFIED\x10\x00\x12\x17\n\x13VIRTUAL_AGENT_STAGE\x10\x01\x12\x16\n\x12HUMAN_ASSIST_STAGE\x10\x02:\xc0\x01\xea\x41\xbc\x01\n&dialogflow.googleapis.com/Conversation\x12/projects/{project}/conversations/{conversation}\x12\x44projects/{project}/locations/{location}/conversations/{conversation}*\rconversations2\x0c\x63onversation\"\xbe\x01\n\x19\x43reateConversationRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/Conversation\x12\x43\n\x0c\x63onversation\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.v2.ConversationB\x03\xe0\x41\x02\x12\x1c\n\x0f\x63onversation_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x18ListConversationsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&dialogflow.googleapis.com/Conversation\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\"u\n\x19ListConversationsResponse\x12?\n\rconversations\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.Conversation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"V\n\x16GetConversationRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\"[\n\x1b\x43ompleteConversationRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\"\x96\x01\n\x13ListMessagesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Message\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\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\"f\n\x14ListMessagesResponse\x12\x35\n\x08messages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"O\n\x17\x43onversationPhoneNumber\x12\x19\n\x0c\x63ountry_code\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x0cphone_number\x18\x03 \x01(\tB\x03\xe0\x41\x03\"\xcf\x02\n\x1eIngestContextReferencesRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12r\n\x12\x63ontext_references\x18\x02 \x03(\x0b\x32Q.google.cloud.dialogflow.v2.IngestContextReferencesRequest.ContextReferencesEntryB\x03\xe0\x41\x02\x1as\n\x16\x43ontextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\"\x9f\x02\n\x1fIngestContextReferencesResponse\x12\x7f\n\x1bingested_context_references\x18\x01 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.IngestContextReferencesResponse.IngestedContextReferencesEntry\x1a{\n\x1eIngestedContextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\"\x9c\x02\n!SuggestConversationSummaryRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12S\n\x13\x61ssist_query_params\x18\x05 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParametersB\x03\xe0\x41\x01\"\xaa\x05\n\"SuggestConversationSummaryResponse\x12W\n\x07summary\x18\x01 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x1a\xd4\x03\n\x07Summary\x12\x0c\n\x04text\x18\x01 \x01(\t\x12o\n\rtext_sections\x18\x04 \x03(\x0b\x32X.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.TextSectionsEntry\x12s\n\x14sorted_text_sections\x18\x06 \x03(\x0b\x32U.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x12\x1e\n\x16\x62\x61seline_model_version\x18\x05 \x01(\t\x1a<\n\x0eSummarySection\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07summary\x18\x02 \x01(\tB\x03\xe0\x41\x03\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xdc\x03\n\x1fGenerateStatelessSummaryRequest\x12t\n\x16stateless_conversation\x18\x01 \x01(\x0b\x32O.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversationB\x03\xe0\x41\x02\x12R\n\x14\x63onversation_profile\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\x12\x41\n\x0elatest_message\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x1d\n\x10max_context_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x1a\x8c\x01\n\x13MinimalConversation\x12:\n\x08messages\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.MessageB\x03\xe0\x41\x02\x12\x39\n\x06parent\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\"\xad\x03\n GenerateStatelessSummaryResponse\x12U\n\x07summary\x18\x01 \x01(\x0b\x32\x44.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x1a\xdb\x01\n\x07Summary\x12\x0c\n\x04text\x18\x01 \x01(\t\x12m\n\rtext_sections\x18\x02 \x03(\x0b\x32V.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary.TextSectionsEntry\x12\x1e\n\x16\x62\x61seline_model_version\x18\x04 \x01(\t\x1a\x33\n\x11TextSectionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xf3\x04\n\"GenerateStatelessSuggestionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12:\n\tgenerator\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorH\x00\x12\x18\n\x0egenerator_name\x18\x03 \x01(\tH\x00\x12v\n\x12\x63ontext_references\x18\x04 \x03(\x0b\x32U.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.ContextReferencesEntryB\x03\xe0\x41\x01\x12R\n\x14\x63onversation_context\x18\x05 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationContextB\x03\xe0\x41\x01\x12\x45\n\x0etrigger_events\x18\x06 \x03(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x12\x1e\n\x11security_settings\x18\x08 \x01(\tB\x03\xe0\x41\x01\x1as\n\x16\x43ontextReferencesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Conversation.ContextReference:\x02\x38\x01\x42\x14\n\x12generator_resource\"y\n#GenerateStatelessSuggestionResponse\x12R\n\x14generator_suggestion\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xe0\x41\x02\"\x9c\x12\n\x16SearchKnowledgeRequest\x12\x13\n\x06parent\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x05query\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputB\x03\xe0\x41\x02\x12S\n\x14\x63onversation_profile\x18\x02 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\x12\x17\n\nsession_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x44\n\x0c\x63onversation\x18\x04 \x01(\tB.\xe0\x41\x01\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x05 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12Y\n\x0cquery_source\x18\x07 \x01(\x0e\x32>.google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySourceB\x03\xe0\x41\x01\x12\x37\n\x11\x65nd_user_metadata\x18\t \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12[\n\rsearch_config\x18\x0b \x01(\x0b\x32?.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfigB\x03\xe0\x41\x01\x12\x19\n\x0c\x65xact_search\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x1a\xdb\x0c\n\x0cSearchConfig\x12\x64\n\x0b\x62oost_specs\x18\x01 \x03(\x0b\x32J.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecsB\x03\xe0\x41\x01\x12\x66\n\x0c\x66ilter_specs\x18\x02 \x03(\x0b\x32K.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecsB\x03\xe0\x41\x01\x1a\xbe\n\n\nBoostSpecs\x12\x45\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB0\xe0\x41\x01\xfa\x41*\n(discoveryengine.googleapis.com/DataStore\x12g\n\x04spec\x18\x02 \x03(\x0b\x32T.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpecB\x03\xe0\x41\x01\x1a\xff\x08\n\tBoostSpec\x12\x8b\x01\n\x15\x63ondition_boost_specs\x18\x01 \x03(\x0b\x32g.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpecB\x03\xe0\x41\x01\x1a\xe3\x07\n\x12\x43onditionBoostSpec\x12\x16\n\tcondition\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x62oost\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\x12\x99\x01\n\x12\x62oost_control_spec\x18\x04 \x01(\x0b\x32x.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpecB\x03\xe0\x41\x01\x1a\x84\x06\n\x10\x42oostControlSpec\x12\x17\n\nfield_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\xa4\x01\n\x0e\x61ttribute_type\x18\x02 \x01(\x0e\x32\x86\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeTypeB\x03\xe0\x41\x01\x12\xac\x01\n\x12interpolation_type\x18\x03 \x01(\x0e\x32\x8a\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationTypeB\x03\xe0\x41\x01\x12\xa3\x01\n\x0e\x63ontrol_points\x18\x04 \x03(\x0b\x32\x85\x01.google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.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\x1a<\n\x0b\x46ilterSpecs\x12\x18\n\x0b\x64\x61ta_stores\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x01\"Q\n\x0bQuerySource\x12\x1c\n\x18QUERY_SOURCE_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x41GENT_QUERY\x10\x01\x12\x13\n\x0fSUGGESTED_QUERY\x10\x02\"\xa4\x04\n\x18SearchKnowledgeDebugInfo\x12V\n\x19\x64\x61tastore_response_reason\x18\x01 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\n\x19search_knowledge_behavior\x18\x02 \x01(\x0b\x32L.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior\x12l\n%ingested_context_reference_debug_info\x18\x03 \x01(\x0b\x32=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12\x43\n\x0fservice_latency\x18\x04 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ServiceLatency\x1a\x8b\x01\n\x17SearchKnowledgeBehavior\x12%\n\x1d\x61nswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\n\x1a\x65nd_user_metadata_included\x18\x02 \x01(\x08\x12%\n\x1dthird_party_connector_allowed\x18\x04 \x01(\x08\"\xd1\x01\n\x17SearchKnowledgeResponse\x12\x42\n\x07\x61nswers\x18\x02 \x03(\x0b\x32\x31.google.cloud.dialogflow.v2.SearchKnowledgeAnswer\x12\x17\n\x0frewritten_query\x18\x03 \x01(\t\x12Y\n\x1bsearch_knowledge_debug_info\x18\x04 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo\"\xe7\x03\n\x15SearchKnowledgeAnswer\x12\x0e\n\x06\x61nswer\x18\x01 \x01(\t\x12Q\n\x0b\x61nswer_type\x18\x02 \x01(\x0e\x32<.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType\x12V\n\x0e\x61nswer_sources\x18\x03 \x03(\x0b\x32>.google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource\x12\x42\n\ranswer_record\x18\x05 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x1a\x66\n\x0c\x41nswerSource\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x0f\n\x07snippet\x18\x03 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\"g\n\nAnswerType\x12\x1b\n\x17\x41NSWER_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x46\x41Q\x10\x01\x12\x0e\n\nGENERATIVE\x10\x02\x12\n\n\x06INTENT\x10\x03\x12\x0c\n\x08PLAYBOOK\x10\x04\x12\t\n\x05\x45VENT\x10\x05\"\xec\x01\n\x1aGenerateSuggestionsRequest\x12\x44\n\x0c\x63onversation\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&dialogflow.googleapis.com/Conversation\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x45\n\x0etrigger_events\x18\x03 \x03(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x32\xa6\x1a\n\rConversations\x12\x8c\x02\n\x12\x43reateConversation\x12\x35.google.cloud.dialogflow.v2.CreateConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"\x94\x01\xda\x41\x13parent,conversation\x82\xd3\xe4\x93\x02x\"%/v2/{parent=projects/*}/conversations:\x0c\x63onversationZA\"1/v2/{parent=projects/*/locations/*}/conversations:\x0c\x63onversation\x12\xed\x01\n\x11ListConversations\x12\x34.google.cloud.dialogflow.v2.ListConversationsRequest\x1a\x35.google.cloud.dialogflow.v2.ListConversationsResponse\"k\xda\x41\x06parent\x82\xd3\xe4\x93\x02\\\x12%/v2/{parent=projects/*}/conversationsZ3\x12\x31/v2/{parent=projects/*/locations/*}/conversations\x12\xda\x01\n\x0fGetConversation\x12\x32.google.cloud.dialogflow.v2.GetConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\\x12%/v2/{name=projects/*/conversations/*}Z3\x12\x31/v2/{name=projects/*/locations/*/conversations/*}\x12\xfd\x01\n\x14\x43ompleteConversation\x12\x37.google.cloud.dialogflow.v2.CompleteConversationRequest\x1a(.google.cloud.dialogflow.v2.Conversation\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\"./v2/{name=projects/*/conversations/*}:complete:\x01*Z?\":/v2/{name=projects/*/locations/*/conversations/*}:complete:\x01*\x12\x92\x02\n\x17IngestContextReferences\x12:.google.cloud.dialogflow.v2.IngestContextReferencesRequest\x1a;.google.cloud.dialogflow.v2.IngestContextReferencesResponse\"~\xda\x41\x1f\x63onversation,context_references\x82\xd3\xe4\x93\x02V\"Q/v2/{conversation=projects/*/locations/*/conversations/*}:ingestContextReferences:\x01*\x12\xf5\x01\n\x0cListMessages\x12/.google.cloud.dialogflow.v2.ListMessagesRequest\x1a\x30.google.cloud.dialogflow.v2.ListMessagesResponse\"\x81\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02r\x12\x30/v2/{parent=projects/*/conversations/*}/messagesZ>\x12.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse\"\xd6\x01\xda\x41\x0c\x63onversation\x82\xd3\xe4\x93\x02\xc0\x01\"T/v2/{conversation=projects/*/conversations/*}/suggestions:suggestConversationSummary:\x01*Ze\"`/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:suggestConversationSummary:\x01*\x12\xdd\x02\n\x18GenerateStatelessSummary\x12;.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest\x1a<.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse\"\xc5\x01\x82\xd3\xe4\x93\x02\xbe\x01\"S/v2/{stateless_conversation.parent=projects/*}/suggestions:generateStatelessSummary:\x01*Zd\"_/v2/{stateless_conversation.parent=projects/*/locations/*}/suggestions:generateStatelessSummary:\x01*\x12\xeb\x01\n\x1bGenerateStatelessSuggestion\x12>.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest\x1a?.google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse\"K\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/locations/*}/statelessSuggestion:generate:\x01*\x12\xae\x03\n\x0fSearchKnowledge\x12\x32.google.cloud.dialogflow.v2.SearchKnowledgeRequest\x1a\x33.google.cloud.dialogflow.v2.SearchKnowledgeResponse\"\xb1\x02\x82\xd3\xe4\x93\x02\xaa\x02\"3/v2/{parent=projects/*}/suggestions:searchKnowledge:\x01*ZD\"?/v2/{parent=projects/*/locations/*}/suggestions:searchKnowledge:\x01*ZN\"I/v2/{conversation=projects/*/conversations/*}/suggestions:searchKnowledge:\x01*ZZ\"U/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:searchKnowledge:\x01*\x12\xbb\x02\n\x13GenerateSuggestions\x12\x36.google.cloud.dialogflow.v2.GenerateSuggestionsRequest\x1a\x37.google.cloud.dialogflow.v2.GenerateSuggestionsResponse\"\xb2\x01\xda\x41\x0c\x63onversation\x82\xd3\xe4\x93\x02\x9c\x01\"B/v2/{conversation=projects/*/conversations/*}/suggestions:generate:\x01*ZS\"N/v2/{conversation=projects/*/locations/*/conversations/*}/suggestions:generate:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xbd\x03\n\x1e\x63om.google.cloud.dialogflow.v2B\x11\x43onversationProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\xc5\x01\n(discoveryengine.googleapis.com/DataStore\x12Xprojects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}\x12?projects/{project}/locations/{location}/dataStores/{data_store}\xea\x41Z\n\x17\x63\x65s.googleapis.com/Tool\x12?projects/{project}/locations/{location}/apps/{app}/tools/{tool}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - Conversation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation").msgclass - Conversation::TelephonyConnectionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo").msgclass - Conversation::TelephonyConnectionInfo::SipHeader = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.SipHeader").msgclass - Conversation::TelephonyConnectionInfo::MimeContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo.MimeContent").msgclass - Conversation::ContextReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ContextReference").msgclass - Conversation::ContextReference::ContextContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent").msgclass - Conversation::ContextReference::ContextContent::ContentFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat").enummodule - Conversation::ContextReference::UpdateMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode").enummodule - Conversation::GeneratorContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.GeneratorContext").msgclass - Conversation::GeneratorContext::GeneratorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.GeneratorContext.GeneratorType").enummodule - Conversation::LifecycleState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.LifecycleState").enummodule - Conversation::ConversationStage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Conversation.ConversationStage").enummodule - CreateConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationRequest").msgclass - ListConversationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationsRequest").msgclass - ListConversationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationsResponse").msgclass - GetConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationRequest").msgclass - CompleteConversationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CompleteConversationRequest").msgclass - ListMessagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListMessagesRequest").msgclass - ListMessagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListMessagesResponse").msgclass - ConversationPhoneNumber = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationPhoneNumber").msgclass - IngestContextReferencesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestContextReferencesRequest").msgclass - IngestContextReferencesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestContextReferencesResponse").msgclass - SuggestConversationSummaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestConversationSummaryRequest").msgclass - SuggestConversationSummaryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestConversationSummaryResponse").msgclass - SuggestConversationSummaryResponse::Summary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary").msgclass - SuggestConversationSummaryResponse::Summary::SummarySection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.Summary.SummarySection").msgclass - GenerateStatelessSummaryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest").msgclass - GenerateStatelessSummaryRequest::MinimalConversation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation").msgclass - GenerateStatelessSummaryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse").msgclass - GenerateStatelessSummaryResponse::Summary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.Summary").msgclass - GenerateStatelessSuggestionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest").msgclass - GenerateStatelessSuggestionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse").msgclass - SearchKnowledgeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest").msgclass - SearchKnowledgeRequest::SearchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig").msgclass - SearchKnowledgeRequest::SearchConfig::BoostSpecs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs").msgclass - SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec").msgclass - SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec").msgclass - SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec").msgclass - SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::ControlPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.ControlPoint").msgclass - SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::AttributeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.AttributeType").enummodule - SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType").enummodule - SearchKnowledgeRequest::SearchConfig::FilterSpecs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.FilterSpecs").msgclass - SearchKnowledgeRequest::QuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource").enummodule - SearchKnowledgeDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo").msgclass - SearchKnowledgeDebugInfo::SearchKnowledgeBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior").msgclass - SearchKnowledgeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeResponse").msgclass - SearchKnowledgeAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeAnswer").msgclass - SearchKnowledgeAnswer::AnswerSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerSource").msgclass - SearchKnowledgeAnswer::AnswerType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SearchKnowledgeAnswer.AnswerType").enummodule - GenerateSuggestionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateSuggestionsRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb deleted file mode 100644 index b77e7d6ecac1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/conversation_profile.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/dialogflow/v2/audio_config_pb' -require 'google/cloud/dialogflow/v2/generator_pb' -require 'google/cloud/dialogflow/v2/participant_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n5google/cloud/dialogflow/v2/conversation_profile.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a,google/cloud/dialogflow/v2/participant.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\n\n\x13\x43onversationProfile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x16\x61utomated_agent_config\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.AutomatedAgentConfig\x12[\n\x1chuman_agent_assistant_config\x18\x04 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.HumanAgentAssistantConfig\x12W\n\x1ahuman_agent_handoff_config\x18\x05 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.HumanAgentHandoffConfig\x12K\n\x13notification_config\x18\x06 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12\x41\n\x0elogging_config\x18\x07 \x01(\x0b\x32).google.cloud.dialogflow.v2.LoggingConfig\x12]\n%new_message_event_notification_config\x18\x08 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12g\n*new_recognition_result_notification_config\x18\x15 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfigB\x03\xe0\x41\x01\x12\x42\n\nstt_config\x18\t \x01(\x0b\x32..google.cloud.dialogflow.v2.SpeechToTextConfig\x12\x15\n\rlanguage_code\x18\n \x01(\t\x12>\n\nsip_config\x18\x10 \x01(\x0b\x32%.google.cloud.dialogflow.v2.SipConfigB\x03\xe0\x41\x01\x12\x11\n\ttime_zone\x18\x0e \x01(\t\x12L\n\x11security_settings\x18\r \x01(\tB1\xfa\x41.\n,dialogflow.googleapis.com/CXSecuritySettings\x12\x46\n\ntts_config\x18\x12 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig:\xc8\x01\xea\x41\xc4\x01\n-dialogflow.googleapis.com/ConversationProfile\x12>projects/{project}/conversationProfiles/{conversation_profile}\x12Sprojects/{project}/locations/{location}/conversationProfiles/{conversation_profile}\"\x8f\x01\n\x1fListConversationProfilesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationProfile\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8b\x01\n ListConversationProfilesResponse\x12N\n\x15\x63onversation_profiles\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfile\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"d\n\x1dGetConversationProfileRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\"\xbd\x01\n CreateConversationProfileRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/ConversationProfile\x12R\n\x14\x63onversation_profile\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\"\xac\x01\n UpdateConversationProfileRequest\x12R\n\x14\x63onversation_profile\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationProfileB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"g\n DeleteConversationProfileRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/ConversationProfile\"\x83\x01\n\x14\x41utomatedAgentConfig\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x33\n\x0bsession_ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\"\xee\x1e\n\x19HumanAgentAssistantConfig\x12K\n\x13notification_config\x18\x02 \x01(\x0b\x32..google.cloud.dialogflow.v2.NotificationConfig\x12m\n\x1dhuman_agent_suggestion_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12j\n\x1a\x65nd_user_suggestion_config\x18\x04 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig\x12l\n\x17message_analysis_config\x18\x05 \x01(\x0b\x32K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig\x1aH\n\x19SuggestionTriggerSettings\x12\x14\n\x0cno_smalltalk\x18\x01 \x01(\x08\x12\x15\n\ronly_end_user\x18\x02 \x01(\x08\x1a\xf1\x07\n\x17SuggestionFeatureConfig\x12I\n\x12suggestion_feature\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SuggestionFeature\x12%\n\x1d\x65nable_event_based_suggestion\x18\x03 \x01(\x08\x12(\n\x1b\x64isable_agent_query_logging\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\x12\x33\n&enable_query_suggestion_when_no_answer\x18\x0f \x01(\x08\x42\x03\xe0\x41\x01\x12\x30\n#enable_conversation_augmented_query\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_query_suggestion_only\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_response_debug_info\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x12\x42\n\x0crai_settings\x18\x13 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.RaiSettingsB\x03\xe0\x41\x01\x12O\n\x18suggestion_trigger_event\x18\x14 \x01(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x12)\n\x1c\x64isable_query_search_context\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12t\n\x1bsuggestion_trigger_settings\x18\n \x01(\x0b\x32O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings\x12\x61\n\x0cquery_config\x18\x06 \x01(\x0b\x32K.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig\x12p\n\x19\x63onversation_model_config\x18\x07 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig\x12t\n\x1b\x63onversation_process_config\x18\x08 \x01(\x0b\x32O.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig\x1a\x9d\x03\n\x10SuggestionConfig\x12\x66\n\x0f\x66\x65\x61ture_configs\x18\x02 \x03(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig\x12\"\n\x1agroup_suggestion_responses\x18\x03 \x01(\x08\x12?\n\ngenerators\x18\x04 \x03(\tB+\xe0\x41\x01\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\x38\n+disable_high_latency_features_sync_delivery\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12.\n!skip_empty_event_based_suggestion\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12-\n use_unredacted_conversation_data\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12#\n\x16\x65nable_async_tool_call\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x1a\x99\r\n\x15SuggestionQueryConfig\x12\x8b\x01\n\x1bknowledge_base_query_source\x18\x01 \x01(\x0b\x32\x64.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySourceH\x00\x12\x80\x01\n\x15\x64ocument_query_source\x18\x02 \x01(\x0b\x32_.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySourceH\x00\x12\x84\x01\n\x17\x64ialogflow_query_source\x18\x03 \x01(\x0b\x32\x61.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySourceH\x00\x12\x13\n\x0bmax_results\x18\x04 \x01(\x05\x12\x1c\n\x14\x63onfidence_threshold\x18\x05 \x01(\x02\x12\x82\x01\n\x17\x63ontext_filter_settings\x18\x07 \x01(\x0b\x32\x61.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings\x12k\n\x08sections\x18\x08 \x01(\x0b\x32T.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.SectionsB\x03\xe0\x41\x01\x12\x19\n\x0c\x63ontext_size\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x1a\x64\n\x18KnowledgeBaseQuerySource\x12H\n\x0fknowledge_bases\x18\x01 \x03(\tB/\xe0\x41\x02\xfa\x41)\n\'dialogflow.googleapis.com/KnowledgeBase\x1aT\n\x13\x44ocumentQuerySource\x12=\n\tdocuments\x18\x01 \x03(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\x1a\xbe\x02\n\x15\x44ialogflowQuerySource\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x12\x9c\x01\n\x17human_agent_side_config\x18\x03 \x01(\x0b\x32v.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfigB\x03\xe0\x41\x01\x1aN\n\x14HumanAgentSideConfig\x12\x36\n\x05\x61gent\x18\x01 \x01(\tB\'\xe0\x41\x01\xfa\x41!\n\x1f\x64ialogflow.googleapis.com/Agent\x1av\n\x15\x43ontextFilterSettings\x12\x1d\n\x15\x64rop_handoff_messages\x18\x01 \x01(\x08\x12#\n\x1b\x64rop_virtual_agent_messages\x18\x02 \x01(\x08\x12\x19\n\x11\x64rop_ivr_messages\x18\x03 \x01(\x08\x1a\xa2\x02\n\x08Sections\x12w\n\rsection_types\x18\x01 \x03(\x0e\x32`.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType\"\x9c\x01\n\x0bSectionType\x12\x1c\n\x18SECTION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSITUATION\x10\x01\x12\n\n\x06\x41\x43TION\x10\x02\x12\x0e\n\nRESOLUTION\x10\x03\x12\x1b\n\x17REASON_FOR_CANCELLATION\x10\x04\x12\x19\n\x15\x43USTOMER_SATISFACTION\x10\x05\x12\x0c\n\x08\x45NTITIES\x10\x06\x42\x0e\n\x0cquery_source\x1az\n\x17\x43onversationModelConfig\x12?\n\x05model\x18\x01 \x01(\tB0\xfa\x41-\n+dialogflow.googleapis.com/ConversationModel\x12\x1e\n\x16\x62\x61seline_model_version\x18\x08 \x01(\t\x1a;\n\x19\x43onversationProcessConfig\x12\x1e\n\x16recent_sentences_count\x18\x02 \x01(\x05\x1a\x87\x01\n\x15MessageAnalysisConfig\x12 \n\x18\x65nable_entity_extraction\x18\x02 \x01(\x08\x12!\n\x19\x65nable_sentiment_analysis\x18\x03 \x01(\x08\x12)\n\x1c\x65nable_sentiment_analysis_v3\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xc4\x03\n\x17HumanAgentHandoffConfig\x12\x62\n\x12live_person_config\x18\x01 \x01(\x0b\x32\x44.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfigH\x00\x12u\n\x1csalesforce_live_agent_config\x18\x02 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfigH\x00\x1a/\n\x10LivePersonConfig\x12\x1b\n\x0e\x61\x63\x63ount_number\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\x8b\x01\n\x19SalesforceLiveAgentConfig\x12\x1c\n\x0forganization_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rdeployment_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tbutton_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0f\x65ndpoint_domain\x18\x04 \x01(\tB\x03\xe0\x41\x02\x42\x0f\n\ragent_service\"\xbf\x01\n\x12NotificationConfig\x12\r\n\x05topic\x18\x01 \x01(\t\x12T\n\x0emessage_format\x18\x02 \x01(\x0e\x32<.google.cloud.dialogflow.v2.NotificationConfig.MessageFormat\"D\n\rMessageFormat\x12\x1e\n\x1aMESSAGE_FORMAT_UNSPECIFIED\x10\x00\x12\t\n\x05PROTO\x10\x01\x12\x08\n\x04JSON\x10\x02\"3\n\rLoggingConfig\x12\"\n\x1a\x65nable_stackdriver_logging\x18\x03 \x01(\x08\"\xa8\x02\n\tSipConfig\x12&\n\x1e\x63reate_conversation_on_the_fly\x18\x01 \x01(\x08\x12\x16\n\x0einactive_start\x18\x03 \x01(\x08\x12?\n\x1cmax_audio_recording_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\'\n\x1f\x61llow_virtual_agent_interaction\x18\x05 \x01(\x08\x12!\n\x19keep_conversation_running\x18\x06 \x01(\x08\x12%\n\x1d\x63opy_inbound_call_leg_headers\x18\x08 \x03(\t\x12\'\n\x1fignore_reinvite_media_direction\x18\t \x01(\x08\"\xf2\x01\n\x11SuggestionFeature\x12@\n\x04type\x18\x01 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.Type\"\x9a\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41RTICLE_SUGGESTION\x10\x01\x12\x07\n\x03\x46\x41Q\x10\x02\x12\x0f\n\x0bSMART_REPLY\x10\x03\x12\x1e\n\x1a\x43ONVERSATION_SUMMARIZATION\x10\x08\x12\x14\n\x10KNOWLEDGE_SEARCH\x10\x0e\x12\x14\n\x10KNOWLEDGE_ASSIST\x10\x0f\"\x8a\x02\n!SetSuggestionFeatureConfigRequest\x12!\n\x14\x63onversation_profile\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12u\n\x19suggestion_feature_config\x18\x03 \x01(\x0b\x32M.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfigB\x03\xe0\x41\x02\"\xef\x01\n#ClearSuggestionFeatureConfigRequest\x12!\n\x14\x63onversation_profile\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\"\xa3\x02\n+SetSuggestionFeatureConfigOperationMetadata\x12\x1c\n\x14\x63onversation_profile\x18\x01 \x01(\t\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xa5\x02\n-ClearSuggestionFeatureConfigOperationMetadata\x12\x1c\n\x14\x63onversation_profile\x18\x01 \x01(\t\x12K\n\x10participant_role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x02\x12X\n\x17suggestion_feature_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionFeature.TypeB\x03\xe0\x41\x02\x12/\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xb3\x14\n\x14\x43onversationProfiles\x12\x90\x02\n\x18ListConversationProfiles\x12;.google.cloud.dialogflow.v2.ListConversationProfilesRequest\x1a<.google.cloud.dialogflow.v2.ListConversationProfilesResponse\"y\xda\x41\x06parent\x82\xd3\xe4\x93\x02j\x12,/v2/{parent=projects/*}/conversationProfilesZ:\x12\x38/v2/{parent=projects/*/locations/*}/conversationProfiles\x12\xfd\x01\n\x16GetConversationProfile\x12\x39.google.cloud.dialogflow.v2.GetConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j\x12,/v2/{name=projects/*/conversationProfiles/*}Z:\x12\x38/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xc8\x02\n\x19\x43reateConversationProfile\x12<.google.cloud.dialogflow.v2.CreateConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"\xbb\x01\xda\x41\x1bparent,conversation_profile\x82\xd3\xe4\x93\x02\x96\x01\",/v2/{parent=projects/*}/conversationProfiles:\x14\x63onversation_profileZP\"8/v2/{parent=projects/*/locations/*}/conversationProfiles:\x14\x63onversation_profile\x12\xf7\x02\n\x19UpdateConversationProfile\x12<.google.cloud.dialogflow.v2.UpdateConversationProfileRequest\x1a/.google.cloud.dialogflow.v2.ConversationProfile\"\xea\x01\xda\x41 conversation_profile,update_mask\x82\xd3\xe4\x93\x02\xc0\x01\x32\x41/v2/{conversation_profile.name=projects/*/conversationProfiles/*}:\x14\x63onversation_profileZe2M/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}:\x14\x63onversation_profile\x12\xea\x01\n\x19\x44\x65leteConversationProfile\x12<.google.cloud.dialogflow.v2.DeleteConversationProfileRequest\x1a\x16.google.protobuf.Empty\"w\xda\x41\x04name\x82\xd3\xe4\x93\x02j*,/v2/{name=projects/*/conversationProfiles/*}Z:*8/v2/{name=projects/*/locations/*/conversationProfiles/*}\x12\xe8\x03\n\x1aSetSuggestionFeatureConfig\x12=.google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x02\xca\x41\x42\n\x13\x43onversationProfile\x12+SetSuggestionFeatureConfigOperationMetadata\xda\x41\x14\x63onversation_profile\xda\x41?conversation_profile,participant_role,suggestion_feature_config\x82\xd3\xe4\x93\x02\xc6\x01\"W/v2/{conversation_profile=projects/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*Zh\"c/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:setSuggestionFeatureConfig:\x01*\x12\xf0\x03\n\x1c\x43learSuggestionFeatureConfig\x12?.google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest\x1a\x1d.google.longrunning.Operation\"\xef\x02\xca\x41\x44\n\x13\x43onversationProfile\x12-ClearSuggestionFeatureConfigOperationMetadata\xda\x41\x14\x63onversation_profile\xda\x41=conversation_profile,participant_role,suggestion_feature_type\x82\xd3\xe4\x93\x02\xca\x01\"Y/v2/{conversation_profile=projects/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*Zj\"e/v2/{conversation_profile=projects/*/locations/*/conversationProfiles/*}:clearSuggestionFeatureConfig:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9d\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x18\x43onversationProfileProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41|\n,dialogflow.googleapis.com/CXSecuritySettings\x12Lprojects/{project}/locations/{location}/securitySettings/{security_settings}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - ConversationProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationProfile").msgclass - ListConversationProfilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationProfilesRequest").msgclass - ListConversationProfilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListConversationProfilesResponse").msgclass - GetConversationProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetConversationProfileRequest").msgclass - CreateConversationProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateConversationProfileRequest").msgclass - UpdateConversationProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateConversationProfileRequest").msgclass - DeleteConversationProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteConversationProfileRequest").msgclass - AutomatedAgentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AutomatedAgentConfig").msgclass - HumanAgentAssistantConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig").msgclass - HumanAgentAssistantConfig::SuggestionTriggerSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings").msgclass - HumanAgentAssistantConfig::SuggestionFeatureConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig").msgclass - HumanAgentAssistantConfig::SuggestionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig").msgclass - HumanAgentAssistantConfig::SuggestionQueryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig").msgclass - HumanAgentAssistantConfig::SuggestionQueryConfig::KnowledgeBaseQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource").msgclass - HumanAgentAssistantConfig::SuggestionQueryConfig::DocumentQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource").msgclass - HumanAgentAssistantConfig::SuggestionQueryConfig::DialogflowQuerySource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource").msgclass - HumanAgentAssistantConfig::SuggestionQueryConfig::DialogflowQuerySource::HumanAgentSideConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.HumanAgentSideConfig").msgclass - HumanAgentAssistantConfig::SuggestionQueryConfig::ContextFilterSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings").msgclass - HumanAgentAssistantConfig::SuggestionQueryConfig::Sections = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections").msgclass - HumanAgentAssistantConfig::SuggestionQueryConfig::Sections::SectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.Sections.SectionType").enummodule - HumanAgentAssistantConfig::ConversationModelConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig").msgclass - HumanAgentAssistantConfig::ConversationProcessConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationProcessConfig").msgclass - HumanAgentAssistantConfig::MessageAnalysisConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig").msgclass - HumanAgentHandoffConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentHandoffConfig").msgclass - HumanAgentHandoffConfig::LivePersonConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig").msgclass - HumanAgentHandoffConfig::SalesforceLiveAgentConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig").msgclass - NotificationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.NotificationConfig").msgclass - NotificationConfig::MessageFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.NotificationConfig.MessageFormat").enummodule - LoggingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.LoggingConfig").msgclass - SipConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SipConfig").msgclass - SuggestionFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionFeature").msgclass - SuggestionFeature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionFeature.Type").enummodule - SetSuggestionFeatureConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SetSuggestionFeatureConfigRequest").msgclass - ClearSuggestionFeatureConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigRequest").msgclass - SetSuggestionFeatureConfigOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata").msgclass - ClearSuggestionFeatureConfigOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb deleted file mode 100644 index 96eeda3402a9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +++ /dev/null @@ -1,99 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/conversation_profile.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/conversation_profile_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationProfiles - # Service for managing - # [ConversationProfiles][google.cloud.dialogflow.v2.ConversationProfile]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.ConversationProfiles' - - # Returns the list of all conversation profiles in the specified project. - rpc :ListConversationProfiles, ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest, ::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse - # Retrieves the specified conversation profile. - rpc :GetConversationProfile, ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest, ::Google::Cloud::Dialogflow::V2::ConversationProfile - # Creates a conversation profile in the specified project. - # - # [ConversationProfile.create_time][google.cloud.dialogflow.v2.ConversationProfile.create_time] - # and - # [ConversationProfile.update_time][google.cloud.dialogflow.v2.ConversationProfile.update_time] - # aren't populated in the response. You can retrieve them via - # [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] - # API. - rpc :CreateConversationProfile, ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest, ::Google::Cloud::Dialogflow::V2::ConversationProfile - # Updates the specified conversation profile. - # - # [ConversationProfile.create_time][google.cloud.dialogflow.v2.ConversationProfile.create_time] - # and - # [ConversationProfile.update_time][google.cloud.dialogflow.v2.ConversationProfile.update_time] - # aren't populated in the response. You can retrieve them via - # [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] - # API. - rpc :UpdateConversationProfile, ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest, ::Google::Cloud::Dialogflow::V2::ConversationProfile - # Deletes the specified conversation profile. - rpc :DeleteConversationProfile, ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest, ::Google::Protobuf::Empty - # Adds or updates a suggestion feature in a conversation profile. - # If the conversation profile contains the type of suggestion feature for - # the participant role, it will update it. Otherwise it will insert the - # suggestion feature. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] - # - `response`: - # [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] - # - # If a long running operation to add or update suggestion feature - # config for the same conversation profile, participant role and suggestion - # feature type exists, please cancel the existing long running operation - # before sending such request, otherwise the request will be rejected. - rpc :SetSuggestionFeatureConfig, ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest, ::Google::Longrunning::Operation - # Clears a suggestion feature from a conversation profile for the given - # participant role. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] - # - `response`: - # [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] - rpc :ClearSuggestionFeatureConfig, ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles.rb deleted file mode 100644 index d5fa39f75883..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/conversation_profiles/credentials" -require "google/cloud/dialogflow/v2/conversation_profiles/paths" -require "google/cloud/dialogflow/v2/conversation_profiles/operations" -require "google/cloud/dialogflow/v2/conversation_profiles/client" -require "google/cloud/dialogflow/v2/conversation_profiles/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfiles}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/conversation_profiles" - # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/conversation_profiles/rest" - # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - module ConversationProfiles - end - end - end - end -end - -helper_path = ::File.join __dir__, "conversation_profiles", "helpers.rb" -require "google/cloud/dialogflow/v2/conversation_profiles/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb deleted file mode 100644 index a4ac55877982..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +++ /dev/null @@ -1,1158 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_profile_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationProfiles - ## - # Client for the ConversationProfiles service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfiles}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversation_profiles_stub - - ## - # Configure the ConversationProfiles Client class. - # - # See {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationProfiles clients - # ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::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 - @conversation_profiles_stub.universe_domain - end - - ## - # Create a new ConversationProfiles client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationProfiles 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/dialogflow/v2/conversation_profile_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 - - @conversation_profiles_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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 - ) - - @conversation_profiles_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 = @conversation_profiles_stub.endpoint - config.universe_domain = @conversation_profiles_stub.universe_domain - config.logger = @conversation_profiles_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfiles::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 - @conversation_profiles_stub.logger - end - - # Service calls - - ## - # Returns the list of all conversation profiles in the specified project. - # - # @overload list_conversation_profiles(request, options = nil) - # Pass arguments to `list_conversation_profiles` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_profiles(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_conversation_profiles` via keyword arguments. Note that at - # least one keyword argument is 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 project to list all conversation profiles from. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new - # - # # Call the list_conversation_profiles method. - # result = client.list_conversation_profiles 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::Dialogflow::V2::ConversationProfile. - # p item - # end - # - def list_conversation_profiles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest - - # Converts hash and nil to 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_conversation_profiles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_conversation_profiles.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_conversation_profiles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.call_rpc :list_conversation_profiles, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @conversation_profiles_stub, :list_conversation_profiles, 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 - - ## - # Retrieves the specified conversation profile. - # - # @overload get_conversation_profile(request, options = nil) - # Pass arguments to `get_conversation_profile` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_profile(name: nil) - # Pass arguments to `get_conversation_profile` via keyword arguments. Note that at - # least one keyword argument is required. To 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 profile. - # Format: `projects//locations//conversationProfiles/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new - # - # # Call the get_conversation_profile method. - # result = client.get_conversation_profile request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. - # p result - # - def get_conversation_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest - - # Converts hash and nil to 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_profile.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_conversation_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.call_rpc :get_conversation_profile, 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 profile in the specified project. - # - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#create_time ConversationProfile.create_time} - # and - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#update_time ConversationProfile.update_time} - # aren't populated in the response. You can retrieve them via - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile GetConversationProfile} - # API. - # - # @overload create_conversation_profile(request, options = nil) - # Pass arguments to `create_conversation_profile` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_profile(parent: nil, conversation_profile: nil) - # Pass arguments to `create_conversation_profile` via keyword arguments. Note that at - # least one keyword argument is 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 project to create a conversation profile for. - # Format: `projects//locations/`. - # @param conversation_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] - # Required. The conversation profile to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new - # - # # Call the create_conversation_profile method. - # result = client.create_conversation_profile request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. - # p result - # - def create_conversation_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest - - # Converts hash and nil to 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_profile.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_conversation_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.call_rpc :create_conversation_profile, 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 the specified conversation profile. - # - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#create_time ConversationProfile.create_time} - # and - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#update_time ConversationProfile.update_time} - # aren't populated in the response. You can retrieve them via - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile GetConversationProfile} - # API. - # - # @overload update_conversation_profile(request, options = nil) - # Pass arguments to `update_conversation_profile` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_profile(conversation_profile: nil, update_mask: nil) - # Pass arguments to `update_conversation_profile` via keyword arguments. Note that at - # least one keyword argument is 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_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] - # Required. The conversation profile to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields to update. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new - # - # # Call the update_conversation_profile method. - # result = client.update_conversation_profile request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. - # p result - # - def update_conversation_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest - - # Converts hash and nil to 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_profile&.name - header_params["conversation_profile.name"] = request.conversation_profile.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_profile.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_conversation_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.call_rpc :update_conversation_profile, 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 specified conversation profile. - # - # @overload delete_conversation_profile(request, options = nil) - # Pass arguments to `delete_conversation_profile` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_profile(name: nil) - # Pass arguments to `delete_conversation_profile` via keyword arguments. Note that at - # least one keyword argument is required. To 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 conversation profile to delete. - # Format: `projects//locations//conversationProfiles/`. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new - # - # # Call the delete_conversation_profile method. - # result = client.delete_conversation_profile request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_conversation_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest - - # Converts hash and nil to 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_profile.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_conversation_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.call_rpc :delete_conversation_profile, 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 - - ## - # Adds or updates a suggestion feature in a conversation profile. - # If the conversation profile contains the type of suggestion feature for - # the participant role, it will update it. Otherwise it will insert the - # suggestion feature. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigOperationMetadata SetSuggestionFeatureConfigOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} - # - # If a long running operation to add or update suggestion feature - # config for the same conversation profile, participant role and suggestion - # feature type exists, please cancel the existing long running operation - # before sending such request, otherwise the request will be rejected. - # - # @overload set_suggestion_feature_config(request, options = nil) - # Pass arguments to `set_suggestion_feature_config` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_config: nil) - # Pass arguments to `set_suggestion_feature_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 conversation_profile [::String] - # Required. The Conversation Profile to add or update the suggestion feature - # config. Format: `projects//locations//conversationProfiles/`. - # @param participant_role [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Required. The participant role to add or update the suggestion feature - # config. Only HUMAN_AGENT or END_USER can be used. - # @param suggestion_feature_config [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig, ::Hash] - # Required. The suggestion feature config to add or update. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new - # - # # Call the set_suggestion_feature_config method. - # result = client.set_suggestion_feature_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 set_suggestion_feature_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_suggestion_feature_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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_profile - header_params["conversation_profile"] = request.conversation_profile - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_suggestion_feature_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_suggestion_feature_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.call_rpc :set_suggestion_feature_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 - - ## - # Clears a suggestion feature from a conversation profile for the given - # participant role. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigOperationMetadata ClearSuggestionFeatureConfigOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} - # - # @overload clear_suggestion_feature_config(request, options = nil) - # Pass arguments to `clear_suggestion_feature_config` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload clear_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_type: nil) - # Pass arguments to `clear_suggestion_feature_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 conversation_profile [::String] - # Required. The Conversation Profile to add or update the suggestion feature - # config. Format: `projects//locations//conversationProfiles/`. - # @param participant_role [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Required. The participant role to remove the suggestion feature - # config. Only HUMAN_AGENT or END_USER can be used. - # @param suggestion_feature_type [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] - # Required. The type of the suggestion feature to remove. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new - # - # # Call the clear_suggestion_feature_config method. - # result = client.clear_suggestion_feature_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 clear_suggestion_feature_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.clear_suggestion_feature_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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_profile - header_params["conversation_profile"] = request.conversation_profile - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.clear_suggestion_feature_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.clear_suggestion_feature_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.call_rpc :clear_suggestion_feature_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 ConversationProfiles API. - # - # This class represents the configuration for ConversationProfiles, - # 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::Dialogflow::V2::ConversationProfiles::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_conversation_profiles to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_conversation_profiles.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_conversation_profiles.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::Dialogflow::V2::ConversationProfiles::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 ConversationProfiles 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_conversation_profiles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversation_profiles - ## - # RPC-specific configuration for `get_conversation_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation_profile - ## - # RPC-specific configuration for `create_conversation_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation_profile - ## - # RPC-specific configuration for `update_conversation_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :update_conversation_profile - ## - # RPC-specific configuration for `delete_conversation_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_conversation_profile - ## - # RPC-specific configuration for `set_suggestion_feature_config` - # @return [::Gapic::Config::Method] - # - attr_reader :set_suggestion_feature_config - ## - # RPC-specific configuration for `clear_suggestion_feature_config` - # @return [::Gapic::Config::Method] - # - attr_reader :clear_suggestion_feature_config - - # @private - def initialize parent_rpcs = nil - list_conversation_profiles_config = parent_rpcs.list_conversation_profiles if parent_rpcs.respond_to? :list_conversation_profiles - @list_conversation_profiles = ::Gapic::Config::Method.new list_conversation_profiles_config - get_conversation_profile_config = parent_rpcs.get_conversation_profile if parent_rpcs.respond_to? :get_conversation_profile - @get_conversation_profile = ::Gapic::Config::Method.new get_conversation_profile_config - create_conversation_profile_config = parent_rpcs.create_conversation_profile if parent_rpcs.respond_to? :create_conversation_profile - @create_conversation_profile = ::Gapic::Config::Method.new create_conversation_profile_config - update_conversation_profile_config = parent_rpcs.update_conversation_profile if parent_rpcs.respond_to? :update_conversation_profile - @update_conversation_profile = ::Gapic::Config::Method.new update_conversation_profile_config - delete_conversation_profile_config = parent_rpcs.delete_conversation_profile if parent_rpcs.respond_to? :delete_conversation_profile - @delete_conversation_profile = ::Gapic::Config::Method.new delete_conversation_profile_config - set_suggestion_feature_config_config = parent_rpcs.set_suggestion_feature_config if parent_rpcs.respond_to? :set_suggestion_feature_config - @set_suggestion_feature_config = ::Gapic::Config::Method.new set_suggestion_feature_config_config - clear_suggestion_feature_config_config = parent_rpcs.clear_suggestion_feature_config if parent_rpcs.respond_to? :clear_suggestion_feature_config - @clear_suggestion_feature_config = ::Gapic::Config::Method.new clear_suggestion_feature_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb deleted file mode 100644 index 94054753a29a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationProfiles - # Credentials for the ConversationProfiles API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb deleted file mode 100644 index 2f1dfece87b0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module ConversationProfiles - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ConversationProfiles 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 ConversationProfiles 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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb deleted file mode 100644 index 543a40c5b1cd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +++ /dev/null @@ -1,325 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module ConversationProfiles - # Path helper methods for the ConversationProfiles API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # @overload agent_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/agent` - # - # @param project [String] - # - # @overload agent_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def agent_path **args - resources = { - "project" => (proc do |project:| - "projects/#{project}/agent" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent" - 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 CXSecuritySettings resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/securitySettings/{security_settings}` - # - # @param project [String] - # @param location [String] - # @param security_settings [String] - # - # @return [::String] - def cx_security_settings_path project:, location:, security_settings: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/securitySettings/#{security_settings}" - end - - ## - # Create a fully-qualified ConversationModel resource string. - # - # @overload conversation_model_path(project:, location:, conversation_model:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversationModels/{conversation_model}` - # - # @param project [String] - # @param location [String] - # @param conversation_model [String] - # - # @overload conversation_model_path(project:, conversation_model:) - # The resource will be in the following format: - # - # `projects/{project}/conversationModels/{conversation_model}` - # - # @param project [String] - # @param conversation_model [String] - # - # @return [::String] - def conversation_model_path **args - resources = { - "conversation_model:location:project" => (proc do |project:, location:, conversation_model:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}" - end), - "conversation_model:project" => (proc do |project:, conversation_model:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/conversationModels/#{conversation_model}" - 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 ConversationProfile resource string. - # - # @overload conversation_profile_path(project:, conversation_profile:) - # The resource will be in the following format: - # - # `projects/{project}/conversationProfiles/{conversation_profile}` - # - # @param project [String] - # @param conversation_profile [String] - # - # @overload conversation_profile_path(project:, location:, conversation_profile:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}` - # - # @param project [String] - # @param location [String] - # @param conversation_profile [String] - # - # @return [::String] - def conversation_profile_path **args - resources = { - "conversation_profile:project" => (proc do |project:, conversation_profile:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/conversationProfiles/#{conversation_profile}" - end), - "conversation_profile:location:project" => (proc do |project:, location:, conversation_profile:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversationProfiles/#{conversation_profile}" - 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:, knowledge_base:, document:) - # The resource will be in the following format: - # - # `projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}` - # - # @param project [String] - # @param knowledge_base [String] - # @param document [String] - # - # @overload document_path(project:, location:, knowledge_base:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param knowledge_base [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" - - "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}" - end), - "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" - - "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/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 Generator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/generators/{generator}` - # - # @param project [String] - # @param location [String] - # @param generator [String] - # - # @return [::String] - def generator_path project:, location:, generator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/generators/#{generator}" - end - - ## - # Create a fully-qualified KnowledgeBase resource string. - # - # @overload knowledge_base_path(project:, knowledge_base:) - # The resource will be in the following format: - # - # `projects/{project}/knowledgeBases/{knowledge_base}` - # - # @param project [String] - # @param knowledge_base [String] - # - # @overload knowledge_base_path(project:, location:, knowledge_base:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}` - # - # @param project [String] - # @param location [String] - # @param knowledge_base [String] - # - # @return [::String] - def knowledge_base_path **args - resources = { - "knowledge_base:project" => (proc do |project:, knowledge_base:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/knowledgeBases/#{knowledge_base}" - end), - "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}" - 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 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 PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - ## - # 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest.rb deleted file mode 100644 index af2abdf0a9a3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/conversation_profiles/credentials" -require "google/cloud/dialogflow/v2/conversation_profiles/paths" -require "google/cloud/dialogflow/v2/conversation_profiles/rest/operations" -require "google/cloud/dialogflow/v2/conversation_profiles/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfiles}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/conversation_profiles/rest" - # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - module ConversationProfiles - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/conversation_profiles/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb deleted file mode 100644 index 7beb6950af46..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +++ /dev/null @@ -1,1074 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_profile_pb" -require "google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationProfiles - module Rest - ## - # REST client for the ConversationProfiles service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfiles}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversation_profiles_stub - - ## - # Configure the ConversationProfiles Client class. - # - # See {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ConversationProfiles clients - # ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::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 - @conversation_profiles_stub.universe_domain - end - - ## - # Create a new ConversationProfiles REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::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 - - @conversation_profiles_stub = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @conversation_profiles_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 = @conversation_profiles_stub.endpoint - config.universe_domain = @conversation_profiles_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @conversation_profiles_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfiles::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 - @conversation_profiles_stub.logger - end - - # Service calls - - ## - # Returns the list of all conversation profiles in the specified project. - # - # @overload list_conversation_profiles(request, options = nil) - # Pass arguments to `list_conversation_profiles` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation_profiles(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_conversation_profiles` via keyword arguments. Note that at - # least one keyword argument is 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 project to list all conversation profiles from. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new - # - # # Call the list_conversation_profiles method. - # result = client.list_conversation_profiles 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::Dialogflow::V2::ConversationProfile. - # p item - # end - # - def list_conversation_profiles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest - - # Converts hash and nil to an 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_conversation_profiles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_conversation_profiles.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_conversation_profiles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.list_conversation_profiles request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @conversation_profiles_stub, :list_conversation_profiles, "conversation_profiles", 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 - - ## - # Retrieves the specified conversation profile. - # - # @overload get_conversation_profile(request, options = nil) - # Pass arguments to `get_conversation_profile` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_profile(name: nil) - # Pass arguments to `get_conversation_profile` via keyword arguments. Note that at - # least one keyword argument is required. To 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 profile. - # Format: `projects//locations//conversationProfiles/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new - # - # # Call the get_conversation_profile method. - # result = client.get_conversation_profile request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. - # p result - # - def get_conversation_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest - - # Converts hash and nil to an 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_conversation_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.get_conversation_profile 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 profile in the specified project. - # - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#create_time ConversationProfile.create_time} - # and - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#update_time ConversationProfile.update_time} - # aren't populated in the response. You can retrieve them via - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client#get_conversation_profile GetConversationProfile} - # API. - # - # @overload create_conversation_profile(request, options = nil) - # Pass arguments to `create_conversation_profile` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_profile(parent: nil, conversation_profile: nil) - # Pass arguments to `create_conversation_profile` via keyword arguments. Note that at - # least one keyword argument is 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 project to create a conversation profile for. - # Format: `projects//locations/`. - # @param conversation_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] - # Required. The conversation profile to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new - # - # # Call the create_conversation_profile method. - # result = client.create_conversation_profile request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. - # p result - # - def create_conversation_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest - - # Converts hash and nil to an 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_conversation_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.create_conversation_profile 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 the specified conversation profile. - # - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#create_time ConversationProfile.create_time} - # and - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#update_time ConversationProfile.update_time} - # aren't populated in the response. You can retrieve them via - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client#get_conversation_profile GetConversationProfile} - # API. - # - # @overload update_conversation_profile(request, options = nil) - # Pass arguments to `update_conversation_profile` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_profile(conversation_profile: nil, update_mask: nil) - # Pass arguments to `update_conversation_profile` via keyword arguments. Note that at - # least one keyword argument is 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_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] - # Required. The conversation profile to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields to update. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new - # - # # Call the update_conversation_profile method. - # result = client.update_conversation_profile request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. - # p result - # - def update_conversation_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest - - # Converts hash and nil to an 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_conversation_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.update_conversation_profile 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 specified conversation profile. - # - # @overload delete_conversation_profile(request, options = nil) - # Pass arguments to `delete_conversation_profile` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_profile(name: nil) - # Pass arguments to `delete_conversation_profile` via keyword arguments. Note that at - # least one keyword argument is required. To 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 conversation profile to delete. - # Format: `projects//locations//conversationProfiles/`. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new - # - # # Call the delete_conversation_profile method. - # result = client.delete_conversation_profile request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_conversation_profile request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest - - # Converts hash and nil to an 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_profile.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_profile.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_conversation_profile.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.delete_conversation_profile 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 - - ## - # Adds or updates a suggestion feature in a conversation profile. - # If the conversation profile contains the type of suggestion feature for - # the participant role, it will update it. Otherwise it will insert the - # suggestion feature. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigOperationMetadata SetSuggestionFeatureConfigOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} - # - # If a long running operation to add or update suggestion feature - # config for the same conversation profile, participant role and suggestion - # feature type exists, please cancel the existing long running operation - # before sending such request, otherwise the request will be rejected. - # - # @overload set_suggestion_feature_config(request, options = nil) - # Pass arguments to `set_suggestion_feature_config` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_config: nil) - # Pass arguments to `set_suggestion_feature_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 conversation_profile [::String] - # Required. The Conversation Profile to add or update the suggestion feature - # config. Format: `projects//locations//conversationProfiles/`. - # @param participant_role [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Required. The participant role to add or update the suggestion feature - # config. Only HUMAN_AGENT or END_USER can be used. - # @param suggestion_feature_config [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig, ::Hash] - # Required. The suggestion feature config to add or update. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new - # - # # Call the set_suggestion_feature_config method. - # result = client.set_suggestion_feature_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 set_suggestion_feature_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_suggestion_feature_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_suggestion_feature_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_suggestion_feature_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.set_suggestion_feature_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 - - ## - # Clears a suggestion feature from a conversation profile for the given - # participant role. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigOperationMetadata ClearSuggestionFeatureConfigOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} - # - # @overload clear_suggestion_feature_config(request, options = nil) - # Pass arguments to `clear_suggestion_feature_config` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload clear_suggestion_feature_config(conversation_profile: nil, participant_role: nil, suggestion_feature_type: nil) - # Pass arguments to `clear_suggestion_feature_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 conversation_profile [::String] - # Required. The Conversation Profile to add or update the suggestion feature - # config. Format: `projects//locations//conversationProfiles/`. - # @param participant_role [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Required. The participant role to remove the suggestion feature - # config. Only HUMAN_AGENT or END_USER can be used. - # @param suggestion_feature_type [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] - # Required. The type of the suggestion feature to remove. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new - # - # # Call the clear_suggestion_feature_config method. - # result = client.clear_suggestion_feature_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 clear_suggestion_feature_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.clear_suggestion_feature_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.clear_suggestion_feature_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.clear_suggestion_feature_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversation_profiles_stub.clear_suggestion_feature_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 ConversationProfiles REST API. - # - # This class represents the configuration for ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::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_conversation_profiles to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_conversation_profiles.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_conversation_profiles.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 ConversationProfiles 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_conversation_profiles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversation_profiles - ## - # RPC-specific configuration for `get_conversation_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation_profile - ## - # RPC-specific configuration for `create_conversation_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation_profile - ## - # RPC-specific configuration for `update_conversation_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :update_conversation_profile - ## - # RPC-specific configuration for `delete_conversation_profile` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_conversation_profile - ## - # RPC-specific configuration for `set_suggestion_feature_config` - # @return [::Gapic::Config::Method] - # - attr_reader :set_suggestion_feature_config - ## - # RPC-specific configuration for `clear_suggestion_feature_config` - # @return [::Gapic::Config::Method] - # - attr_reader :clear_suggestion_feature_config - - # @private - def initialize parent_rpcs = nil - list_conversation_profiles_config = parent_rpcs.list_conversation_profiles if parent_rpcs.respond_to? :list_conversation_profiles - @list_conversation_profiles = ::Gapic::Config::Method.new list_conversation_profiles_config - get_conversation_profile_config = parent_rpcs.get_conversation_profile if parent_rpcs.respond_to? :get_conversation_profile - @get_conversation_profile = ::Gapic::Config::Method.new get_conversation_profile_config - create_conversation_profile_config = parent_rpcs.create_conversation_profile if parent_rpcs.respond_to? :create_conversation_profile - @create_conversation_profile = ::Gapic::Config::Method.new create_conversation_profile_config - update_conversation_profile_config = parent_rpcs.update_conversation_profile if parent_rpcs.respond_to? :update_conversation_profile - @update_conversation_profile = ::Gapic::Config::Method.new update_conversation_profile_config - delete_conversation_profile_config = parent_rpcs.delete_conversation_profile if parent_rpcs.respond_to? :delete_conversation_profile - @delete_conversation_profile = ::Gapic::Config::Method.new delete_conversation_profile_config - set_suggestion_feature_config_config = parent_rpcs.set_suggestion_feature_config if parent_rpcs.respond_to? :set_suggestion_feature_config - @set_suggestion_feature_config = ::Gapic::Config::Method.new set_suggestion_feature_config_config - clear_suggestion_feature_config_config = parent_rpcs.clear_suggestion_feature_config if parent_rpcs.respond_to? :clear_suggestion_feature_config - @clear_suggestion_feature_config = ::Gapic::Config::Method.new clear_suggestion_feature_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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb deleted file mode 100644 index 4fe8e5f380f8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb +++ /dev/null @@ -1,947 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module ConversationProfiles - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ConversationProfiles 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 ConversationProfiles 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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb deleted file mode 100644 index 0ee320bc115b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb +++ /dev/null @@ -1,565 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_profile_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module ConversationProfiles - module Rest - ## - # REST service stub for the ConversationProfiles 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_conversation_profiles REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListConversationProfilesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse] - # A result object deserialized from the server's reply - def list_conversation_profiles request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_conversation_profiles_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_conversation_profiles", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse.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_profile REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ConversationProfile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # A result object deserialized from the server's reply - def get_conversation_profile request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_conversation_profile_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_profile", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.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_profile REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ConversationProfile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # A result object deserialized from the server's reply - def create_conversation_profile request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_conversation_profile_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_profile", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.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_profile REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ConversationProfile] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # A result object deserialized from the server's reply - def update_conversation_profile request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_conversation_profile_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_profile", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.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_profile REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_profile request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_conversation_profile_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_profile", - 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 set_suggestion_feature_config REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 set_suggestion_feature_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_suggestion_feature_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: "set_suggestion_feature_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 clear_suggestion_feature_config REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 clear_suggestion_feature_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_clear_suggestion_feature_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: "clear_suggestion_feature_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 list_conversation_profiles REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest] - # 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_conversation_profiles_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/conversationProfiles", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/conversationProfiles", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_conversation_profile REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest] - # 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_profile_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_conversation_profile REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest] - # 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_profile_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/conversationProfiles", - body: "conversation_profile", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/conversationProfiles", - body: "conversation_profile", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_conversation_profile REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest] - # 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_profile_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{conversation_profile.name}", - body: "conversation_profile", - matches: [ - ["conversation_profile.name", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{conversation_profile.name}", - body: "conversation_profile", - matches: [ - ["conversation_profile.name", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_conversation_profile REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest] - # 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_profile_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_suggestion_feature_config REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_suggestion_feature_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation_profile}:setSuggestionFeatureConfig", - body: "*", - matches: [ - ["conversation_profile", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation_profile}:setSuggestionFeatureConfig", - body: "*", - matches: [ - ["conversation_profile", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the clear_suggestion_feature_config REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_clear_suggestion_feature_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation_profile}:clearSuggestionFeatureConfig", - body: "*", - matches: [ - ["conversation_profile", %r{^projects/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation_profile}:clearSuggestionFeatureConfig", - body: "*", - matches: [ - ["conversation_profile", %r{^projects/[^/]+/locations/[^/]+/conversationProfiles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb deleted file mode 100644 index 0638df8aff60..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +++ /dev/null @@ -1,98 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/conversation.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/conversation_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Conversations - # Service for managing - # [Conversations][google.cloud.dialogflow.v2.Conversation]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Conversations' - - # Creates a new conversation. Conversations are auto-completed after 24 - # hours. - # - # Conversation Lifecycle: - # There are two stages during a conversation: Automated Agent Stage and - # Assist Stage. - # - # For Automated Agent Stage, there will be a dialogflow agent responding to - # user queries. - # - # For Assist Stage, there's no dialogflow agent responding to user queries. - # But we will provide suggestions which are generated from conversation. - # - # If - # [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] - # is configured for a dialogflow agent, conversation will start from - # `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And - # during `Automated Agent Stage`, once an - # [Intent][google.cloud.dialogflow.v2.Intent] with - # [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] - # is triggered, conversation will transfer to Assist Stage. - rpc :CreateConversation, ::Google::Cloud::Dialogflow::V2::CreateConversationRequest, ::Google::Cloud::Dialogflow::V2::Conversation - # Returns the list of all conversations in the specified project. - rpc :ListConversations, ::Google::Cloud::Dialogflow::V2::ListConversationsRequest, ::Google::Cloud::Dialogflow::V2::ListConversationsResponse - # Retrieves the specific conversation. - rpc :GetConversation, ::Google::Cloud::Dialogflow::V2::GetConversationRequest, ::Google::Cloud::Dialogflow::V2::Conversation - # Completes the specified conversation. Finished conversations are purged - # from the database after 30 days. - rpc :CompleteConversation, ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest, ::Google::Cloud::Dialogflow::V2::Conversation - # Data ingestion API. - # Ingests context references for an existing conversation. - rpc :IngestContextReferences, ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest, ::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse - # Lists messages that belong to a given conversation. - # `messages` are ordered by `create_time` in descending order. To fetch - # updates without duplication, send request with filter - # `create_time_epoch_microseconds > - # [first item's create_time of previous request]` and empty page_token. - rpc :ListMessages, ::Google::Cloud::Dialogflow::V2::ListMessagesRequest, ::Google::Cloud::Dialogflow::V2::ListMessagesResponse - # Suggests summary for a conversation based on specific historical messages. - # The range of the messages to be used for summary can be specified in the - # request. - rpc :SuggestConversationSummary, ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest, ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse - # Generates and returns a summary for a conversation that does not have a - # resource created for it. - rpc :GenerateStatelessSummary, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse - # Generates and returns a suggestion for a conversation that does not have a - # resource created for it. - rpc :GenerateStatelessSuggestion, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse - # Get answers for the given query based on knowledge documents. - rpc :SearchKnowledge, ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse - # Generates all the suggestions using generators configured in the - # conversation profile. A generator is used only if its trigger event is - # matched. - rpc :GenerateSuggestions, ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest, ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations.rb deleted file mode 100644 index dc1025ee6d00..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/conversations/credentials" -require "google/cloud/dialogflow/v2/conversations/paths" -require "google/cloud/dialogflow/v2/conversations/client" -require "google/cloud/dialogflow/v2/conversations/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::Conversation Conversations}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/conversations" - # client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/conversations/rest" - # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - module Conversations - end - end - end - end -end - -helper_path = ::File.join __dir__, "conversations", "helpers.rb" -require "google/cloud/dialogflow/v2/conversations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb deleted file mode 100644 index fcf8cfea67dd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/client.rb +++ /dev/null @@ -1,1639 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Conversations - ## - # Client for the Conversations service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::Conversation Conversations}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversations_stub - - ## - # Configure the Conversations Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Conversations::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Conversations clients - # ::Google::Cloud::Dialogflow::V2::Conversations::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Conversations 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::Dialogflow::V2::Conversations::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 - @conversations_stub.universe_domain - end - - ## - # Create a new Conversations client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Conversations 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/dialogflow/v2/conversation_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 - - @conversations_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Conversations::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 - ) - - @conversations_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 = @conversations_stub.endpoint - config.universe_domain = @conversations_stub.universe_domain - config.logger = @conversations_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 - @conversations_stub.logger - end - - # Service calls - - ## - # Creates a new conversation. Conversations are auto-completed after 24 - # hours. - # - # Conversation Lifecycle: - # There are two stages during a conversation: Automated Agent Stage and - # Assist Stage. - # - # For Automated Agent Stage, there will be a dialogflow agent responding to - # user queries. - # - # For Assist Stage, there's no dialogflow agent responding to user queries. - # But we will provide suggestions which are generated from conversation. - # - # If - # {::Google::Cloud::Dialogflow::V2::Conversation#conversation_profile Conversation.conversation_profile} - # is configured for a dialogflow agent, conversation will start from - # `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And - # during `Automated Agent Stage`, once an - # {::Google::Cloud::Dialogflow::V2::Intent Intent} with - # {::Google::Cloud::Dialogflow::V2::Intent#live_agent_handoff Intent.live_agent_handoff} - # is triggered, conversation will transfer to Assist Stage. - # - # @overload create_conversation(request, options = nil) - # Pass arguments to `create_conversation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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, conversation_id: 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. Resource identifier of the project creating the conversation. - # Format: `projects//locations/`. - # @param conversation [::Google::Cloud::Dialogflow::V2::Conversation, ::Hash] - # Required. The conversation to create. - # @param conversation_id [::String] - # Optional. Identifier of the conversation. Generally it's auto generated by - # Google. Only set it if you cannot wait for the response to return a - # auto-generated one to you. - # - # The conversation ID must be compliant with the regression formula - # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - # If the field is provided, the caller is responsible for - # 1. the uniqueness of the ID, otherwise the request will be rejected. - # 2. the consistency for whether to use custom ID or not under a project to - # better ensure uniqueness. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Conversation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Conversation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new - # - # # Call the create_conversation method. - # result = client.create_conversation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - - @conversations_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 - - ## - # Returns the list of all conversations in the specified project. - # - # @overload list_conversations(request, options = nil) - # Pass arguments to `list_conversations` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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) - # 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 project from which to list all conversation. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @param filter [::String] - # Optional. A filter expression that filters conversations listed in the - # response. Only `lifecycle_state` can be filtered on in this way. For - # example, the following expression only returns `COMPLETED` conversations: - # - # `lifecycle_state = "COMPLETED"` - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - - @conversations_stub.call_rpc :list_conversations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @conversations_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 - - ## - # Retrieves the specific conversation. - # - # @overload get_conversation(request, options = nil) - # Pass arguments to `get_conversation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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 name of the conversation. Format: - # `projects//locations//conversations/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Conversation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Conversation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new - # - # # Call the get_conversation method. - # result = client.get_conversation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - - @conversations_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 - - ## - # Completes the specified conversation. Finished conversations are purged - # from the database after 30 days. - # - # @overload complete_conversation(request, options = nil) - # Pass arguments to `complete_conversation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CompleteConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CompleteConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation(name: nil) - # Pass arguments to `complete_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. Resource identifier of the conversation to close. - # Format: `projects//locations//conversations/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Conversation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Conversation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new - # - # # Call the complete_conversation method. - # result = client.complete_conversation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. - # p result - # - def complete_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest - - # Converts hash and nil to 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_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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.complete_conversation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.complete_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.call_rpc :complete_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 - - ## - # Data ingestion API. - # Ingests context references for an existing conversation. - # - # @overload ingest_context_references(request, options = nil) - # Pass arguments to `ingest_context_references` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload ingest_context_references(conversation: nil, context_references: nil) - # Pass arguments to `ingest_context_references` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. Resource identifier of the conversation to ingest context - # information for. Format: `projects//locations//conversations/`. - # @param context_references [::Hash{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference, ::Hash}] - # Required. The context references to ingest. The key is the name of the - # context reference and the value contains the contents of the context - # reference. The key is used to incorporate ingested context references to - # enhance the generator. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new - # - # # Call the ingest_context_references method. - # result = client.ingest_context_references request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse. - # p result - # - def ingest_context_references request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.ingest_context_references.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - header_params["conversation"] = request.conversation - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.ingest_context_references.timeout, - metadata: metadata, - retry_policy: @config.rpcs.ingest_context_references.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.call_rpc :ingest_context_references, 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 messages that belong to a given conversation. - # `messages` are ordered by `create_time` in descending order. To fetch - # updates without duplication, send request with filter - # `create_time_epoch_microseconds > - # [first item's create_time of previous request]` and empty page_token. - # - # @overload list_messages(request, options = nil) - # Pass arguments to `list_messages` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListMessagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListMessagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_messages(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_messages` via keyword arguments. Note that at - # least one keyword argument is 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 name of the conversation to list messages for. - # Format: `projects//locations//conversations/` - # @param filter [::String] - # Optional. Filter on message fields. Currently predicates on `create_time` - # and `create_time_epoch_microseconds` are supported. `create_time` only - # support milliseconds accuracy. E.g., - # `create_time_epoch_microseconds > 1551790877964485` or - # `create_time > 2017-01-15T01:30:15.01Z`. - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new - # - # # Call the list_messages method. - # result = client.list_messages 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::Dialogflow::V2::Message. - # p item - # end - # - def list_messages request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListMessagesRequest - - # Converts hash and nil to 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_messages.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_messages.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_messages.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.call_rpc :list_messages, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @conversations_stub, :list_messages, 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 - - ## - # Suggests summary for a conversation based on specific historical messages. - # The range of the messages to be used for summary can be specified in the - # request. - # - # @overload suggest_conversation_summary(request, options = nil) - # Pass arguments to `suggest_conversation_summary` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload suggest_conversation_summary(conversation: nil, latest_message: nil, context_size: nil, assist_query_params: nil) - # Pass arguments to `suggest_conversation_summary` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The conversation to fetch suggestion for. - # Format: `projects//locations//conversations/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message used as context for - # compiling suggestion. If empty, the latest message of the conversation will - # be used. - # - # Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Optional. Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 500 and at most 1000. - # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] - # Optional. Parameters for a human assist query. Only used for POC/demo - # purpose. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new - # - # # Call the suggest_conversation_summary method. - # result = client.suggest_conversation_summary request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse. - # p result - # - def suggest_conversation_summary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.suggest_conversation_summary.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - header_params["conversation"] = request.conversation - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.suggest_conversation_summary.timeout, - metadata: metadata, - retry_policy: @config.rpcs.suggest_conversation_summary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.call_rpc :suggest_conversation_summary, 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 and returns a summary for a conversation that does not have a - # resource created for it. - # - # @overload generate_stateless_summary(request, options = nil) - # Pass arguments to `generate_stateless_summary` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stateless_summary(stateless_conversation: nil, conversation_profile: nil, latest_message: nil, max_context_size: nil) - # Pass arguments to `generate_stateless_summary` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param stateless_conversation [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest::MinimalConversation, ::Hash] - # Required. The conversation to suggest a summary for. - # @param conversation_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] - # Required. A ConversationProfile containing information required for Summary - # generation. - # Required fields: \\{language_code, security_settings} - # Optional fields: \\{agent_assistant_config} - # @param latest_message [::String] - # Optional. The name of the latest conversation message used as context for - # generating a Summary. If empty, the latest message of the conversation will - # be used. The format is specific to the user and the names of the messages - # provided. - # @param max_context_size [::Integer] - # Optional. Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 500 and at most 1000. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new - # - # # Call the generate_stateless_summary method. - # result = client.generate_stateless_summary request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse. - # p result - # - def generate_stateless_summary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest - - # Converts hash and nil to 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_stateless_summary.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.stateless_conversation&.parent - header_params["stateless_conversation.parent"] = request.stateless_conversation.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.generate_stateless_summary.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_stateless_summary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.call_rpc :generate_stateless_summary, 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 and returns a suggestion for a conversation that does not have a - # resource created for it. - # - # @overload generate_stateless_suggestion(request, options = nil) - # Pass arguments to `generate_stateless_suggestion` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stateless_suggestion(parent: nil, generator: nil, generator_name: nil, context_references: nil, conversation_context: nil, trigger_events: nil, security_settings: nil) - # Pass arguments to `generate_stateless_suggestion` via keyword arguments. Note that at - # least one keyword argument is 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 to charge for the Suggestion's generation. - # Format: `projects//locations/`. - # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] - # Uncreated generator. It should be a complete generator that includes all - # information about the generator. - # - # Note: The following parameters are mutually exclusive: `generator`, `generator_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 generator_name [::String] - # The resource name of the existing created generator. Format: - # `projects//locations//generators/` - # - # Note: The following parameters are mutually exclusive: `generator_name`, `generator`. 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 context_references [::Hash{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference, ::Hash}] - # Optional. A section of ingested context information. The key is the name of - # the context reference and the value contains the contents of the context - # reference. The key is used to incorporate ingested context references to - # enhance the generator. - # @param conversation_context [::Google::Cloud::Dialogflow::V2::ConversationContext, ::Hash] - # Optional. Context of the conversation, including transcripts. - # @param trigger_events [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] - # Optional. A list of trigger events. Generator will be triggered only if - # it's trigger event is included here. - # @param security_settings [::String] - # Optional. Name of the CX SecuritySettings which is used to redact generated - # response. If this field is empty, try to fetch v2 security_settings, which - # is a project level setting. If this field is empty and no v2 - # security_settings set up in this project, no redaction will be done. - # - # Format: - # `projects//locations//securitySettings/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new - # - # # Call the generate_stateless_suggestion method. - # result = client.generate_stateless_suggestion request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse. - # p result - # - def generate_stateless_suggestion request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest - - # Converts hash and nil to 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_stateless_suggestion.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.generate_stateless_suggestion.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_stateless_suggestion.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.call_rpc :generate_stateless_suggestion, 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 - - ## - # Get answers for the given query based on knowledge documents. - # - # @overload search_knowledge(request, options = nil) - # Pass arguments to `search_knowledge` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge(parent: nil, query: nil, conversation_profile: nil, session_id: nil, conversation: nil, latest_message: nil, query_source: nil, end_user_metadata: nil, search_config: nil, exact_search: nil) - # Pass arguments to `search_knowledge` via keyword arguments. Note that at - # least one keyword argument is 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 contains the conversation profile - # Format: 'projects/' or `projects//locations/`. - # @param query [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] - # Required. The natural language text query for knowledge search. - # @param conversation_profile [::String] - # Required. The conversation profile used to configure the search. - # Format: `projects//locations//conversationProfiles/`. - # @param session_id [::String] - # Required. The ID of the search session. - # The session_id can be combined with Dialogflow V3 Agent ID retrieved from - # conversation profile or on its own to identify a search session. The search - # history of the same session will impact the search result. It's up to the - # API caller to choose an appropriate `Session ID`. It can be a random number - # or some type of session identifiers (preferably hashed). The length must - # not exceed 36 characters. - # @param conversation [::String] - # Optional. The conversation (between human agent and end user) where the - # search request is triggered. Format: `projects//locations//conversations/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message when the request is - # triggered. - # Format: `projects//locations//conversations//messages/`. - # @param query_source [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::QuerySource] - # Optional. The source of the query in the request. - # @param end_user_metadata [::Google::Protobuf::Struct, ::Hash] - # Optional. Information about the end-user to improve the relevance and - # accuracy of generative answers. - # - # This will be interpreted and used by a language model, so, for good - # results, the data should be self-descriptive, and in a simple structure. - # - # Example: - # - # ```json - # { - # "subscription plan": "Business Premium Plus", - # "devices owned": [ - # \\{"model": "Google Pixel 7"}, - # \\{"model": "Google Pixel Tablet"} - # ] - # } - # ``` - # @param search_config [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig, ::Hash] - # Optional. Configuration specific to search queries with data stores. - # @param exact_search [::Boolean] - # Optional. Whether to search the query exactly without query rewrite. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new - # - # # Call the search_knowledge method. - # result = client.search_knowledge request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse. - # p result - # - def search_knowledge request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest - - # Converts hash and nil to 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_knowledge.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.search_knowledge.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_knowledge.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.call_rpc :search_knowledge, 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 all the suggestions using generators configured in the - # conversation profile. A generator is used only if its trigger event is - # matched. - # - # @overload generate_suggestions(request, options = nil) - # Pass arguments to `generate_suggestions` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_suggestions(conversation: nil, latest_message: nil, trigger_events: nil) - # Pass arguments to `generate_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 conversation [::String] - # Required. The conversation for which the suggestions are generated. Format: - # `projects//locations//conversations/`. - # - # The conversation must be created with a conversation profile which has - # generators configured in it to be able to get suggestions. - # @param latest_message [::String] - # Optional. The name of the latest conversation message for which the request - # is triggered. Format: `projects//locations//conversations//messages/`. - # @param trigger_events [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] - # Optional. A list of trigger events. Only generators configured in the - # conversation_profile whose trigger_event is listed here will be triggered. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new - # - # # Call the generate_suggestions method. - # result = client.generate_suggestions request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse. - # p result - # - def generate_suggestions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest - - # Converts hash and nil to 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_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - header_params["conversation"] = request.conversation - end - - request_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_suggestions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_suggestions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.call_rpc :generate_suggestions, 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 Conversations API. - # - # This class represents the configuration for Conversations, - # 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::Dialogflow::V2::Conversations::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_conversation to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Conversations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_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::Dialogflow::V2::Conversations::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Conversations 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation - ## - # RPC-specific configuration for `list_conversations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversations - ## - # RPC-specific configuration for `get_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation - ## - # RPC-specific configuration for `complete_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_conversation - ## - # RPC-specific configuration for `ingest_context_references` - # @return [::Gapic::Config::Method] - # - attr_reader :ingest_context_references - ## - # RPC-specific configuration for `list_messages` - # @return [::Gapic::Config::Method] - # - attr_reader :list_messages - ## - # RPC-specific configuration for `suggest_conversation_summary` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_conversation_summary - ## - # RPC-specific configuration for `generate_stateless_summary` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_stateless_summary - ## - # RPC-specific configuration for `generate_stateless_suggestion` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_stateless_suggestion - ## - # RPC-specific configuration for `search_knowledge` - # @return [::Gapic::Config::Method] - # - attr_reader :search_knowledge - ## - # RPC-specific configuration for `generate_suggestions` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_suggestions - - # @private - def initialize parent_rpcs = nil - create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation - @create_conversation = ::Gapic::Config::Method.new create_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 - get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation - @get_conversation = ::Gapic::Config::Method.new get_conversation_config - complete_conversation_config = parent_rpcs.complete_conversation if parent_rpcs.respond_to? :complete_conversation - @complete_conversation = ::Gapic::Config::Method.new complete_conversation_config - ingest_context_references_config = parent_rpcs.ingest_context_references if parent_rpcs.respond_to? :ingest_context_references - @ingest_context_references = ::Gapic::Config::Method.new ingest_context_references_config - list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages - @list_messages = ::Gapic::Config::Method.new list_messages_config - suggest_conversation_summary_config = parent_rpcs.suggest_conversation_summary if parent_rpcs.respond_to? :suggest_conversation_summary - @suggest_conversation_summary = ::Gapic::Config::Method.new suggest_conversation_summary_config - generate_stateless_summary_config = parent_rpcs.generate_stateless_summary if parent_rpcs.respond_to? :generate_stateless_summary - @generate_stateless_summary = ::Gapic::Config::Method.new generate_stateless_summary_config - generate_stateless_suggestion_config = parent_rpcs.generate_stateless_suggestion if parent_rpcs.respond_to? :generate_stateless_suggestion - @generate_stateless_suggestion = ::Gapic::Config::Method.new generate_stateless_suggestion_config - search_knowledge_config = parent_rpcs.search_knowledge if parent_rpcs.respond_to? :search_knowledge - @search_knowledge = ::Gapic::Config::Method.new search_knowledge_config - generate_suggestions_config = parent_rpcs.generate_suggestions if parent_rpcs.respond_to? :generate_suggestions - @generate_suggestions = ::Gapic::Config::Method.new generate_suggestions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/credentials.rb deleted file mode 100644 index ad828ce5e5ce..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Conversations - # Credentials for the Conversations API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/paths.rb deleted file mode 100644 index 746a3a8fd459..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/paths.rb +++ /dev/null @@ -1,541 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module Conversations - # Path helper methods for the Conversations API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # @overload agent_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/agent` - # - # @param project [String] - # - # @overload agent_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def agent_path **args - resources = { - "project" => (proc do |project:| - "projects/#{project}/agent" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent" - 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 App resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # - # @return [::String] - def app_path project:, location:, app: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}" - end - - ## - # Create a fully-qualified CXSecuritySettings resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/securitySettings/{security_settings}` - # - # @param project [String] - # @param location [String] - # @param security_settings [String] - # - # @return [::String] - def cx_security_settings_path project:, location:, security_settings: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/securitySettings/#{security_settings}" - end - - ## - # Create a fully-qualified Conversation resource string. - # - # @overload conversation_path(project:, conversation:) - # The resource will be in the following format: - # - # `projects/{project}/conversations/{conversation}` - # - # @param project [String] - # @param conversation [String] - # - # @overload conversation_path(project:, location:, conversation:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversations/{conversation}` - # - # @param project [String] - # @param location [String] - # @param conversation [String] - # - # @return [::String] - def conversation_path **args - resources = { - "conversation:project" => (proc do |project:, conversation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/conversations/#{conversation}" - end), - "conversation:location:project" => (proc do |project:, location:, conversation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/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 ConversationModel resource string. - # - # @overload conversation_model_path(project:, location:, conversation_model:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversationModels/{conversation_model}` - # - # @param project [String] - # @param location [String] - # @param conversation_model [String] - # - # @overload conversation_model_path(project:, conversation_model:) - # The resource will be in the following format: - # - # `projects/{project}/conversationModels/{conversation_model}` - # - # @param project [String] - # @param conversation_model [String] - # - # @return [::String] - def conversation_model_path **args - resources = { - "conversation_model:location:project" => (proc do |project:, location:, conversation_model:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}" - end), - "conversation_model:project" => (proc do |project:, conversation_model:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/conversationModels/#{conversation_model}" - 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 ConversationProfile resource string. - # - # @overload conversation_profile_path(project:, conversation_profile:) - # The resource will be in the following format: - # - # `projects/{project}/conversationProfiles/{conversation_profile}` - # - # @param project [String] - # @param conversation_profile [String] - # - # @overload conversation_profile_path(project:, location:, conversation_profile:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}` - # - # @param project [String] - # @param location [String] - # @param conversation_profile [String] - # - # @return [::String] - def conversation_profile_path **args - resources = { - "conversation_profile:project" => (proc do |project:, conversation_profile:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/conversationProfiles/#{conversation_profile}" - end), - "conversation_profile:location:project" => (proc do |project:, location:, conversation_profile:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversationProfiles/#{conversation_profile}" - 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:, 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] - # - # @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] - # - # @return [::String] - def data_store_path **args - resources = { - "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), - "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) - } - - 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:, knowledge_base:, document:) - # The resource will be in the following format: - # - # `projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}` - # - # @param project [String] - # @param knowledge_base [String] - # @param document [String] - # - # @overload document_path(project:, location:, knowledge_base:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param knowledge_base [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" - - "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}" - end), - "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" - - "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/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 Generator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/generators/{generator}` - # - # @param project [String] - # @param location [String] - # @param generator [String] - # - # @return [::String] - def generator_path project:, location:, generator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/generators/#{generator}" - end - - ## - # Create a fully-qualified KnowledgeBase resource string. - # - # @overload knowledge_base_path(project:, knowledge_base:) - # The resource will be in the following format: - # - # `projects/{project}/knowledgeBases/{knowledge_base}` - # - # @param project [String] - # @param knowledge_base [String] - # - # @overload knowledge_base_path(project:, location:, knowledge_base:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}` - # - # @param project [String] - # @param location [String] - # @param knowledge_base [String] - # - # @return [::String] - def knowledge_base_path **args - resources = { - "knowledge_base:project" => (proc do |project:, knowledge_base:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/knowledgeBases/#{knowledge_base}" - end), - "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}" - 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 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 Message resource string. - # - # @overload message_path(project:, conversation:, message:) - # The resource will be in the following format: - # - # `projects/{project}/conversations/{conversation}/messages/{message}` - # - # @param project [String] - # @param conversation [String] - # @param message [String] - # - # @overload message_path(project:, location:, conversation:, message:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}` - # - # @param project [String] - # @param location [String] - # @param conversation [String] - # @param message [String] - # - # @return [::String] - def message_path **args - resources = { - "conversation:message:project" => (proc do |project:, conversation:, message:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" - - "projects/#{project}/conversations/#{conversation}/messages/#{message}" - end), - "conversation:location:message:project" => (proc do |project:, location:, conversation:, message:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversations/#{conversation}/messages/#{message}" - 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 PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - ## - # 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 - - ## - # Create a fully-qualified Tool resource string. - # - # @overload tool_path(project:, location:, tool:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param tool [String] - # - # @overload tool_path(project:, location:, app:, tool:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # @param tool [String] - # - # @return [::String] - def tool_path **args - resources = { - "location:project:tool" => (proc do |project:, location:, tool:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/tools/#{tool}" - end), - "app:location:project:tool" => (proc do |project:, location:, app:, tool:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}" - 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 Toolset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # @param toolset [String] - # - # @return [::String] - def toolset_path project:, location:, app:, toolset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest.rb deleted file mode 100644 index 2f0d86acb368..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/conversations/credentials" -require "google/cloud/dialogflow/v2/conversations/paths" -require "google/cloud/dialogflow/v2/conversations/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::Conversation Conversations}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/conversations/rest" - # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - module Conversations - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/conversations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb deleted file mode 100644 index 9cfe7bac8cf8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +++ /dev/null @@ -1,1527 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_pb" -require "google/cloud/dialogflow/v2/conversations/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Conversations - module Rest - ## - # REST client for the Conversations service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::Conversation Conversations}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :conversations_stub - - ## - # Configure the Conversations Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Conversations clients - # ::Google::Cloud::Dialogflow::V2::Conversations::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Conversations 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::Dialogflow::V2::Conversations::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 - @conversations_stub.universe_domain - end - - ## - # Create a new Conversations REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Conversations 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 - - @conversations_stub = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @conversations_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 = @conversations_stub.endpoint - config.universe_domain = @conversations_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @conversations_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 - @conversations_stub.logger - end - - # Service calls - - ## - # Creates a new conversation. Conversations are auto-completed after 24 - # hours. - # - # Conversation Lifecycle: - # There are two stages during a conversation: Automated Agent Stage and - # Assist Stage. - # - # For Automated Agent Stage, there will be a dialogflow agent responding to - # user queries. - # - # For Assist Stage, there's no dialogflow agent responding to user queries. - # But we will provide suggestions which are generated from conversation. - # - # If - # {::Google::Cloud::Dialogflow::V2::Conversation#conversation_profile Conversation.conversation_profile} - # is configured for a dialogflow agent, conversation will start from - # `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And - # during `Automated Agent Stage`, once an - # {::Google::Cloud::Dialogflow::V2::Intent Intent} with - # {::Google::Cloud::Dialogflow::V2::Intent#live_agent_handoff Intent.live_agent_handoff} - # is triggered, conversation will transfer to Assist Stage. - # - # @overload create_conversation(request, options = nil) - # Pass arguments to `create_conversation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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, conversation_id: 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. Resource identifier of the project creating the conversation. - # Format: `projects//locations/`. - # @param conversation [::Google::Cloud::Dialogflow::V2::Conversation, ::Hash] - # Required. The conversation to create. - # @param conversation_id [::String] - # Optional. Identifier of the conversation. Generally it's auto generated by - # Google. Only set it if you cannot wait for the response to return a - # auto-generated one to you. - # - # The conversation ID must be compliant with the regression formula - # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - # If the field is provided, the caller is responsible for - # 1. the uniqueness of the ID, otherwise the request will be rejected. - # 2. the consistency for whether to use custom ID or not under a project to - # better ensure uniqueness. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Conversation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new - # - # # Call the create_conversation method. - # result = client.create_conversation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - @conversations_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 - - ## - # Returns the list of all conversations in the specified project. - # - # @overload list_conversations(request, options = nil) - # Pass arguments to `list_conversations` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListConversationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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) - # 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 project from which to list all conversation. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @param filter [::String] - # Optional. A filter expression that filters conversations listed in the - # response. Only `lifecycle_state` can be filtered on in this way. For - # example, the following expression only returns `COMPLETED` conversations: - # - # `lifecycle_state = "COMPLETED"` - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - @conversations_stub.list_conversations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @conversations_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 - - ## - # Retrieves the specific conversation. - # - # @overload get_conversation(request, options = nil) - # Pass arguments to `get_conversation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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 name of the conversation. Format: - # `projects//locations//conversations/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Conversation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new - # - # # Call the get_conversation method. - # result = client.get_conversation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - @conversations_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 - - ## - # Completes the specified conversation. Finished conversations are purged - # from the database after 30 days. - # - # @overload complete_conversation(request, options = nil) - # Pass arguments to `complete_conversation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CompleteConversationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CompleteConversationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_conversation(name: nil) - # Pass arguments to `complete_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. Resource identifier of the conversation to close. - # Format: `projects//locations//conversations/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Conversation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new - # - # # Call the complete_conversation method. - # result = client.complete_conversation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. - # p result - # - def complete_conversation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest - - # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_conversation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.complete_conversation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.complete_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 - - ## - # Data ingestion API. - # Ingests context references for an existing conversation. - # - # @overload ingest_context_references(request, options = nil) - # Pass arguments to `ingest_context_references` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload ingest_context_references(conversation: nil, context_references: nil) - # Pass arguments to `ingest_context_references` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. Resource identifier of the conversation to ingest context - # information for. Format: `projects//locations//conversations/`. - # @param context_references [::Hash{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference, ::Hash}] - # Required. The context references to ingest. The key is the name of the - # context reference and the value contains the contents of the context - # reference. The key is used to incorporate ingested context references to - # enhance the generator. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new - # - # # Call the ingest_context_references method. - # result = client.ingest_context_references request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse. - # p result - # - def ingest_context_references request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.ingest_context_references.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.ingest_context_references.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.ingest_context_references.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.ingest_context_references 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 messages that belong to a given conversation. - # `messages` are ordered by `create_time` in descending order. To fetch - # updates without duplication, send request with filter - # `create_time_epoch_microseconds > - # [first item's create_time of previous request]` and empty page_token. - # - # @overload list_messages(request, options = nil) - # Pass arguments to `list_messages` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListMessagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListMessagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_messages(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_messages` via keyword arguments. Note that at - # least one keyword argument is 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 name of the conversation to list messages for. - # Format: `projects//locations//conversations/` - # @param filter [::String] - # Optional. Filter on message fields. Currently predicates on `create_time` - # and `create_time_epoch_microseconds` are supported. `create_time` only - # support milliseconds accuracy. E.g., - # `create_time_epoch_microseconds > 1551790877964485` or - # `create_time > 2017-01-15T01:30:15.01Z`. - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new - # - # # Call the list_messages method. - # result = client.list_messages 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::Dialogflow::V2::Message. - # p item - # end - # - def list_messages request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListMessagesRequest - - # Converts hash and nil to an 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_messages.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_messages.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_messages.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.list_messages request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @conversations_stub, :list_messages, "messages", 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 - - ## - # Suggests summary for a conversation based on specific historical messages. - # The range of the messages to be used for summary can be specified in the - # request. - # - # @overload suggest_conversation_summary(request, options = nil) - # Pass arguments to `suggest_conversation_summary` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload suggest_conversation_summary(conversation: nil, latest_message: nil, context_size: nil, assist_query_params: nil) - # Pass arguments to `suggest_conversation_summary` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The conversation to fetch suggestion for. - # Format: `projects//locations//conversations/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message used as context for - # compiling suggestion. If empty, the latest message of the conversation will - # be used. - # - # Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Optional. Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 500 and at most 1000. - # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] - # Optional. Parameters for a human assist query. Only used for POC/demo - # purpose. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new - # - # # Call the suggest_conversation_summary method. - # result = client.suggest_conversation_summary request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse. - # p result - # - def suggest_conversation_summary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.suggest_conversation_summary.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.suggest_conversation_summary.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.suggest_conversation_summary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.suggest_conversation_summary 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 - - ## - # Generates and returns a summary for a conversation that does not have a - # resource created for it. - # - # @overload generate_stateless_summary(request, options = nil) - # Pass arguments to `generate_stateless_summary` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stateless_summary(stateless_conversation: nil, conversation_profile: nil, latest_message: nil, max_context_size: nil) - # Pass arguments to `generate_stateless_summary` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param stateless_conversation [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest::MinimalConversation, ::Hash] - # Required. The conversation to suggest a summary for. - # @param conversation_profile [::Google::Cloud::Dialogflow::V2::ConversationProfile, ::Hash] - # Required. A ConversationProfile containing information required for Summary - # generation. - # Required fields: \\{language_code, security_settings} - # Optional fields: \\{agent_assistant_config} - # @param latest_message [::String] - # Optional. The name of the latest conversation message used as context for - # generating a Summary. If empty, the latest message of the conversation will - # be used. The format is specific to the user and the names of the messages - # provided. - # @param max_context_size [::Integer] - # Optional. Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 500 and at most 1000. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new - # - # # Call the generate_stateless_summary method. - # result = client.generate_stateless_summary request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse. - # p result - # - def generate_stateless_summary request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest - - # Converts hash and nil to an 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_stateless_summary.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_stateless_summary.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_stateless_summary.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.generate_stateless_summary 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 - - ## - # Generates and returns a suggestion for a conversation that does not have a - # resource created for it. - # - # @overload generate_stateless_suggestion(request, options = nil) - # Pass arguments to `generate_stateless_suggestion` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stateless_suggestion(parent: nil, generator: nil, generator_name: nil, context_references: nil, conversation_context: nil, trigger_events: nil, security_settings: nil) - # Pass arguments to `generate_stateless_suggestion` via keyword arguments. Note that at - # least one keyword argument is 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 to charge for the Suggestion's generation. - # Format: `projects//locations/`. - # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] - # Uncreated generator. It should be a complete generator that includes all - # information about the generator. - # - # Note: The following parameters are mutually exclusive: `generator`, `generator_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 generator_name [::String] - # The resource name of the existing created generator. Format: - # `projects//locations//generators/` - # - # Note: The following parameters are mutually exclusive: `generator_name`, `generator`. 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 context_references [::Hash{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference, ::Hash}] - # Optional. A section of ingested context information. The key is the name of - # the context reference and the value contains the contents of the context - # reference. The key is used to incorporate ingested context references to - # enhance the generator. - # @param conversation_context [::Google::Cloud::Dialogflow::V2::ConversationContext, ::Hash] - # Optional. Context of the conversation, including transcripts. - # @param trigger_events [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] - # Optional. A list of trigger events. Generator will be triggered only if - # it's trigger event is included here. - # @param security_settings [::String] - # Optional. Name of the CX SecuritySettings which is used to redact generated - # response. If this field is empty, try to fetch v2 security_settings, which - # is a project level setting. If this field is empty and no v2 - # security_settings set up in this project, no redaction will be done. - # - # Format: - # `projects//locations//securitySettings/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new - # - # # Call the generate_stateless_suggestion method. - # result = client.generate_stateless_suggestion request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse. - # p result - # - def generate_stateless_suggestion request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest - - # Converts hash and nil to an 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_stateless_suggestion.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_stateless_suggestion.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_stateless_suggestion.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.generate_stateless_suggestion 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 - - ## - # Get answers for the given query based on knowledge documents. - # - # @overload search_knowledge(request, options = nil) - # Pass arguments to `search_knowledge` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge(parent: nil, query: nil, conversation_profile: nil, session_id: nil, conversation: nil, latest_message: nil, query_source: nil, end_user_metadata: nil, search_config: nil, exact_search: nil) - # Pass arguments to `search_knowledge` via keyword arguments. Note that at - # least one keyword argument is 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 contains the conversation profile - # Format: 'projects/' or `projects//locations/`. - # @param query [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] - # Required. The natural language text query for knowledge search. - # @param conversation_profile [::String] - # Required. The conversation profile used to configure the search. - # Format: `projects//locations//conversationProfiles/`. - # @param session_id [::String] - # Required. The ID of the search session. - # The session_id can be combined with Dialogflow V3 Agent ID retrieved from - # conversation profile or on its own to identify a search session. The search - # history of the same session will impact the search result. It's up to the - # API caller to choose an appropriate `Session ID`. It can be a random number - # or some type of session identifiers (preferably hashed). The length must - # not exceed 36 characters. - # @param conversation [::String] - # Optional. The conversation (between human agent and end user) where the - # search request is triggered. Format: `projects//locations//conversations/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message when the request is - # triggered. - # Format: `projects//locations//conversations//messages/`. - # @param query_source [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::QuerySource] - # Optional. The source of the query in the request. - # @param end_user_metadata [::Google::Protobuf::Struct, ::Hash] - # Optional. Information about the end-user to improve the relevance and - # accuracy of generative answers. - # - # This will be interpreted and used by a language model, so, for good - # results, the data should be self-descriptive, and in a simple structure. - # - # Example: - # - # ```json - # { - # "subscription plan": "Business Premium Plus", - # "devices owned": [ - # \\{"model": "Google Pixel 7"}, - # \\{"model": "Google Pixel Tablet"} - # ] - # } - # ``` - # @param search_config [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig, ::Hash] - # Optional. Configuration specific to search queries with data stores. - # @param exact_search [::Boolean] - # Optional. Whether to search the query exactly without query rewrite. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new - # - # # Call the search_knowledge method. - # result = client.search_knowledge request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse. - # p result - # - def search_knowledge request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest - - # Converts hash and nil to an 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_knowledge.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_knowledge.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_knowledge.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.search_knowledge 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 - - ## - # Generates all the suggestions using generators configured in the - # conversation profile. A generator is used only if its trigger event is - # matched. - # - # @overload generate_suggestions(request, options = nil) - # Pass arguments to `generate_suggestions` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_suggestions(conversation: nil, latest_message: nil, trigger_events: nil) - # Pass arguments to `generate_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 conversation [::String] - # Required. The conversation for which the suggestions are generated. Format: - # `projects//locations//conversations/`. - # - # The conversation must be created with a conversation profile which has - # generators configured in it to be able to get suggestions. - # @param latest_message [::String] - # Optional. The name of the latest conversation message for which the request - # is triggered. Format: `projects//locations//conversations//messages/`. - # @param trigger_events [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] - # Optional. A list of trigger events. Only generators configured in the - # conversation_profile whose trigger_event is listed here will be triggered. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new - # - # # Call the generate_suggestions method. - # result = client.generate_suggestions request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse. - # p result - # - def generate_suggestions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest - - # Converts hash and nil to an 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_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_suggestions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_suggestions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @conversations_stub.generate_suggestions 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 Conversations REST API. - # - # This class represents the configuration for Conversations 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::Dialogflow::V2::Conversations::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_conversation to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_conversation.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Conversations 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_conversation - ## - # RPC-specific configuration for `list_conversations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_conversations - ## - # RPC-specific configuration for `get_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_conversation - ## - # RPC-specific configuration for `complete_conversation` - # @return [::Gapic::Config::Method] - # - attr_reader :complete_conversation - ## - # RPC-specific configuration for `ingest_context_references` - # @return [::Gapic::Config::Method] - # - attr_reader :ingest_context_references - ## - # RPC-specific configuration for `list_messages` - # @return [::Gapic::Config::Method] - # - attr_reader :list_messages - ## - # RPC-specific configuration for `suggest_conversation_summary` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_conversation_summary - ## - # RPC-specific configuration for `generate_stateless_summary` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_stateless_summary - ## - # RPC-specific configuration for `generate_stateless_suggestion` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_stateless_suggestion - ## - # RPC-specific configuration for `search_knowledge` - # @return [::Gapic::Config::Method] - # - attr_reader :search_knowledge - ## - # RPC-specific configuration for `generate_suggestions` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_suggestions - - # @private - def initialize parent_rpcs = nil - create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation - @create_conversation = ::Gapic::Config::Method.new create_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 - get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation - @get_conversation = ::Gapic::Config::Method.new get_conversation_config - complete_conversation_config = parent_rpcs.complete_conversation if parent_rpcs.respond_to? :complete_conversation - @complete_conversation = ::Gapic::Config::Method.new complete_conversation_config - ingest_context_references_config = parent_rpcs.ingest_context_references if parent_rpcs.respond_to? :ingest_context_references - @ingest_context_references = ::Gapic::Config::Method.new ingest_context_references_config - list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages - @list_messages = ::Gapic::Config::Method.new list_messages_config - suggest_conversation_summary_config = parent_rpcs.suggest_conversation_summary if parent_rpcs.respond_to? :suggest_conversation_summary - @suggest_conversation_summary = ::Gapic::Config::Method.new suggest_conversation_summary_config - generate_stateless_summary_config = parent_rpcs.generate_stateless_summary if parent_rpcs.respond_to? :generate_stateless_summary - @generate_stateless_summary = ::Gapic::Config::Method.new generate_stateless_summary_config - generate_stateless_suggestion_config = parent_rpcs.generate_stateless_suggestion if parent_rpcs.respond_to? :generate_stateless_suggestion - @generate_stateless_suggestion = ::Gapic::Config::Method.new generate_stateless_suggestion_config - search_knowledge_config = parent_rpcs.search_knowledge if parent_rpcs.respond_to? :search_knowledge - @search_knowledge = ::Gapic::Config::Method.new search_knowledge_config - generate_suggestions_config = parent_rpcs.generate_suggestions if parent_rpcs.respond_to? :generate_suggestions - @generate_suggestions = ::Gapic::Config::Method.new generate_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-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb deleted file mode 100644 index 30b869a01b77..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +++ /dev/null @@ -1,845 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Conversations - module Rest - ## - # REST service stub for the Conversations 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_conversation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::ListConversationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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 get_conversation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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 complete_conversation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CompleteConversationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Conversation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Conversation] - # A result object deserialized from the server's reply - def complete_conversation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_complete_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: "complete_conversation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::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 ingest_context_references REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::IngestContextReferencesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse] - # A result object deserialized from the server's reply - def ingest_context_references request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_ingest_context_references_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "ingest_context_references", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse.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_messages REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListMessagesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListMessagesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListMessagesResponse] - # A result object deserialized from the server's reply - def list_messages request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_messages_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_messages", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListMessagesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the suggest_conversation_summary REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SuggestConversationSummaryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse] - # A result object deserialized from the server's reply - def suggest_conversation_summary request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_suggest_conversation_summary_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "suggest_conversation_summary", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the generate_stateless_summary REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::GenerateStatelessSummaryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse] - # A result object deserialized from the server's reply - def generate_stateless_summary request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_stateless_summary_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_stateless_summary", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the generate_stateless_suggestion REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::GenerateStatelessSuggestionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse] - # A result object deserialized from the server's reply - def generate_stateless_suggestion request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_stateless_suggestion_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_stateless_suggestion", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse.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_knowledge REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SearchKnowledgeResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse] - # A result object deserialized from the server's reply - def search_knowledge request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_knowledge_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_knowledge", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the generate_suggestions REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::GenerateSuggestionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] - # A result object deserialized from the server's reply - def generate_suggestions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_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: "generate_suggestions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse.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_conversation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/conversations", - body: "conversation", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/conversations", - body: "conversation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_conversations REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/conversations", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/conversations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_conversation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the complete_conversation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CompleteConversationRequest] - # 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_conversation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:complete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:complete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the ingest_context_references REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_ingest_context_references_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation}:ingestContextReferences", - body: "*", - matches: [ - ["conversation", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_messages REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListMessagesRequest] - # 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_messages_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/messages", - matches: [ - ["parent", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/messages", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the suggest_conversation_summary REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_suggest_conversation_summary_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation}/suggestions:suggestConversationSummary", - body: "*", - matches: [ - ["conversation", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation}/suggestions:suggestConversationSummary", - body: "*", - matches: [ - ["conversation", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_stateless_summary REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest] - # 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_stateless_summary_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{stateless_conversation.parent}/suggestions:generateStatelessSummary", - body: "*", - matches: [ - ["stateless_conversation.parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{stateless_conversation.parent}/suggestions:generateStatelessSummary", - body: "*", - matches: [ - ["stateless_conversation.parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_stateless_suggestion REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest] - # 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_stateless_suggestion_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/statelessSuggestion:generate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_knowledge REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest] - # 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_knowledge_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:searchKnowledge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:searchKnowledge", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation}/suggestions:searchKnowledge", - body: "*", - matches: [ - ["conversation", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation}/suggestions:searchKnowledge", - body: "*", - matches: [ - ["conversation", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_suggestions REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest] - # 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_suggestions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation}/suggestions:generate", - body: "*", - matches: [ - ["conversation", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{conversation}/suggestions:generate", - body: "*", - matches: [ - ["conversation", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_pb.rb deleted file mode 100644 index 3bfefeef2beb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/document.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/dialogflow/v2/gcs_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n)google/cloud/dialogflow/v2/document.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a$google/cloud/dialogflow/v2/gcs.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xa6\x08\n\x08\x44ocument\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tmime_type\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12P\n\x0fknowledge_types\x18\x04 \x03(\x0e\x32\x32.google.cloud.dialogflow.v2.Document.KnowledgeTypeB\x03\xe0\x41\x02\x12\x15\n\x0b\x63ontent_uri\x18\x05 \x01(\tH\x00\x12\x15\n\x0braw_content\x18\t \x01(\x0cH\x00\x12\x1f\n\x12\x65nable_auto_reload\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12T\n\x14latest_reload_status\x18\x0c \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.Document.ReloadStatusB\x03\xe0\x41\x03\x12I\n\x08metadata\x18\x07 \x03(\x0b\x32\x32.google.cloud.dialogflow.v2.Document.MetadataEntryB\x03\xe0\x41\x01\x12>\n\x05state\x18\r \x01(\x0e\x32*.google.cloud.dialogflow.v2.Document.StateB\x03\xe0\x41\x03\x1a\\\n\x0cReloadStatus\x12(\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x81\x01\n\rKnowledgeType\x12\x1e\n\x1aKNOWLEDGE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x46\x41Q\x10\x01\x12\x11\n\rEXTRACTIVE_QA\x10\x02\x12\x16\n\x12\x41RTICLE_SUGGESTION\x10\x03\x12\x1c\n\x18\x41GENT_FACING_SMART_REPLY\x10\x04\"c\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\x0c\n\x08UPDATING\x10\x03\x12\r\n\tRELOADING\x10\x04\x12\x0c\n\x08\x44\x45LETING\x10\x05:\xcf\x01\xea\x41\xcb\x01\n\"dialogflow.googleapis.com/Document\x12Gprojects/{project}/knowledgeBases/{knowledge_base}/documents/{document}\x12\\projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}B\x08\n\x06source\"N\n\x12GetDocumentRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\"\x89\x01\n\x14ListDocumentsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/Document\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\"i\n\x15ListDocumentsResponse\x12\x37\n\tdocuments\x18\x01 \x03(\x0b\x32$.google.cloud.dialogflow.v2.Document\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x90\x01\n\x15\x43reateDocumentRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/Document\x12;\n\x08\x64ocument\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.v2.DocumentB\x03\xe0\x41\x02\"\x99\x02\n\x16ImportDocumentsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/Document\x12\x41\n\ngcs_source\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.v2.GcsSourcesB\x03\xe0\x41\x01H\x00\x12R\n\x11\x64ocument_template\x18\x03 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.ImportDocumentTemplateB\x03\xe0\x41\x02\x12\"\n\x1aimport_gcs_custom_metadata\x18\x04 \x01(\x08\x42\x08\n\x06source\"\x87\x02\n\x16ImportDocumentTemplate\x12\x16\n\tmime_type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12P\n\x0fknowledge_types\x18\x02 \x03(\x0e\x32\x32.google.cloud.dialogflow.v2.Document.KnowledgeTypeB\x03\xe0\x41\x02\x12R\n\x08metadata\x18\x03 \x03(\x0b\x32@.google.cloud.dialogflow.v2.ImportDocumentTemplate.MetadataEntry\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"?\n\x17ImportDocumentsResponse\x12$\n\x08warnings\x18\x01 \x03(\x0b\x32\x12.google.rpc.Status\"Q\n\x15\x44\x65leteDocumentRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\"\x8a\x01\n\x15UpdateDocumentRequest\x12;\n\x08\x64ocument\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.v2.DocumentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xcd\x01\n\x15ReloadDocumentRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\x12\x1a\n\x0b\x63ontent_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x12\'\n\x1aimport_gcs_custom_metadata\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12+\n\x1esmart_messaging_partial_update\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x42\x08\n\x06source\"\xec\x01\n\x15\x45xportDocumentRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/Document\x12\x45\n\x0fgcs_destination\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.v2.GcsDestinationH\x00\x12\x1b\n\x13\x65xport_full_content\x18\x03 \x01(\x08\x12&\n\x1esmart_messaging_partial_update\x18\x05 \x01(\x08\x42\r\n\x0b\x64\x65stination\"g\n\x17\x45xportOperationMetadata\x12L\n\x18\x65xported_gcs_destination\x18\x01 \x01(\x0b\x32*.google.cloud.dialogflow.v2.GcsDestination\"\xe9\x02\n\x1aKnowledgeOperationMetadata\x12P\n\x05state\x18\x01 \x01(\x0e\x32<.google.cloud.dialogflow.v2.KnowledgeOperationMetadata.StateB\x03\xe0\x41\x03\x12\x16\n\x0eknowledge_base\x18\x03 \x01(\t\x12X\n\x19\x65xport_operation_metadata\x18\x04 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.ExportOperationMetadataH\x00\x12-\n\tdone_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"B\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x42\x14\n\x12operation_metadata2\xac\x16\n\tDocuments\x12\xb9\x02\n\rListDocuments\x12\x30.google.cloud.dialogflow.v2.ListDocumentsRequest\x1a\x31.google.cloud.dialogflow.v2.ListDocumentsResponse\"\xc2\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb2\x01\x12\x32/v2/{parent=projects/*/knowledgeBases/*}/documentsZ@\x12>/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documentsZ:\x12\x38/v2/{parent=projects/*/agent/knowledgeBases/*}/documents\x12\xa6\x02\n\x0bGetDocument\x12..google.cloud.dialogflow.v2.GetDocumentRequest\x1a$.google.cloud.dialogflow.v2.Document\"\xc0\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb2\x01\x12\x32/v2/{name=projects/*/knowledgeBases/*/documents/*}Z@\x12>/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}Z:\x12\x38/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}\x12\xf7\x02\n\x0e\x43reateDocument\x12\x31.google.cloud.dialogflow.v2.CreateDocumentRequest\x1a\x1d.google.longrunning.Operation\"\x92\x02\xca\x41&\n\x08\x44ocument\x12\x1aKnowledgeOperationMetadata\xda\x41\x0fparent,document\x82\xd3\xe4\x93\x02\xd0\x01\"2/v2/{parent=projects/*/knowledgeBases/*}/documents:\x08\x64ocumentZJ\">/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:\x08\x64ocumentZD\"8/v2/{parent=projects/*/agent/knowledgeBases/*}/documents:\x08\x64ocument\x12\xb0\x02\n\x0fImportDocuments\x12\x32.google.cloud.dialogflow.v2.ImportDocumentsRequest\x1a\x1d.google.longrunning.Operation\"\xc9\x01\xca\x41\x35\n\x17ImportDocumentsResponse\x12\x1aKnowledgeOperationMetadata\x82\xd3\xe4\x93\x02\x8a\x01\"9/v2/{parent=projects/*/knowledgeBases/*}/documents:import:\x01*ZJ\"E/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import:\x01*\x12\xdb\x02\n\x0e\x44\x65leteDocument\x12\x31.google.cloud.dialogflow.v2.DeleteDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xf6\x01\xca\x41\x33\n\x15google.protobuf.Empty\x12\x1aKnowledgeOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb2\x01*2/v2/{name=projects/*/knowledgeBases/*/documents/*}Z@*>/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}Z:*8/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}\x12\x97\x03\n\x0eUpdateDocument\x12\x31.google.cloud.dialogflow.v2.UpdateDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x02\xca\x41&\n\x08\x44ocument\x12\x1aKnowledgeOperationMetadata\xda\x41\x14\x64ocument,update_mask\x82\xd3\xe4\x93\x02\xeb\x01\x32;/v2/{document.name=projects/*/knowledgeBases/*/documents/*}:\x08\x64ocumentZS2G/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}:\x08\x64ocumentZM2A/v2/{document.name=projects/*/agent/knowledgeBases/*/documents/*}:\x08\x64ocument\x12\xf8\x02\n\x0eReloadDocument\x12\x31.google.cloud.dialogflow.v2.ReloadDocumentRequest\x1a\x1d.google.longrunning.Operation\"\x93\x02\xca\x41&\n\x08\x44ocument\x12\x1aKnowledgeOperationMetadata\xda\x41\x10name,content_uri\x82\xd3\xe4\x93\x02\xd0\x01\"9/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload:\x01*ZJ\"E/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload:\x01*ZD\"?/v2/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload:\x01*\x12\x9f\x02\n\x0e\x45xportDocument\x12\x31.google.cloud.dialogflow.v2.ExportDocumentRequest\x1a\x1d.google.longrunning.Operation\"\xba\x01\xca\x41&\n\x08\x44ocument\x12\x1aKnowledgeOperationMetadata\x82\xd3\xe4\x93\x02\x8a\x01\"9/v2/{name=projects/*/knowledgeBases/*/documents/*}:export:\x01*ZJ\"E/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:export:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x93\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\rDocumentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - Document = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Document").msgclass - Document::ReloadStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Document.ReloadStatus").msgclass - Document::KnowledgeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Document.KnowledgeType").enummodule - Document::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Document.State").enummodule - GetDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetDocumentRequest").msgclass - ListDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListDocumentsRequest").msgclass - ListDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListDocumentsResponse").msgclass - CreateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateDocumentRequest").msgclass - ImportDocumentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportDocumentsRequest").msgclass - ImportDocumentTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportDocumentTemplate").msgclass - ImportDocumentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ImportDocumentsResponse").msgclass - DeleteDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteDocumentRequest").msgclass - UpdateDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateDocumentRequest").msgclass - ReloadDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ReloadDocumentRequest").msgclass - ExportDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ExportDocumentRequest").msgclass - ExportOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ExportOperationMetadata").msgclass - KnowledgeOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeOperationMetadata").msgclass - KnowledgeOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_services_pb.rb deleted file mode 100644 index d5f293a0501f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/document_services_pb.rb +++ /dev/null @@ -1,119 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/document.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/document_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Documents - # Service for managing knowledge - # [Documents][google.cloud.dialogflow.v2.Document]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Documents' - - # Returns the list of all documents of the knowledge base. - rpc :ListDocuments, ::Google::Cloud::Dialogflow::V2::ListDocumentsRequest, ::Google::Cloud::Dialogflow::V2::ListDocumentsResponse - # Retrieves the specified document. - rpc :GetDocument, ::Google::Cloud::Dialogflow::V2::GetDocumentRequest, ::Google::Cloud::Dialogflow::V2::Document - # Creates a new document. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - # - `response`: [Document][google.cloud.dialogflow.v2.Document] - rpc :CreateDocument, ::Google::Cloud::Dialogflow::V2::CreateDocumentRequest, ::Google::Longrunning::Operation - # Creates documents by importing data from external sources. - # Dialogflow supports up to 350 documents in each request. If you try to - # import more, Dialogflow will return an error. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - # - `response`: - # [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] - rpc :ImportDocuments, ::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest, ::Google::Longrunning::Operation - # Deletes the specified document. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - rpc :DeleteDocument, ::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest, ::Google::Longrunning::Operation - # Updates the specified document. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - # - `response`: [Document][google.cloud.dialogflow.v2.Document] - rpc :UpdateDocument, ::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest, ::Google::Longrunning::Operation - # Reloads the specified document from its specified source, content_uri or - # content. The previously loaded content of the document will be deleted. - # Note: Even when the content of the document has not changed, there still - # may be side effects because of internal implementation changes. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - # - `response`: [Document][google.cloud.dialogflow.v2.Document] - # - # Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - # only use `projects.knowledgeBases.documents`. - rpc :ReloadDocument, ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest, ::Google::Longrunning::Operation - # Exports a smart messaging candidate document into the specified - # destination. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] - # - `response`: [Document][google.cloud.dialogflow.v2.Document] - rpc :ExportDocument, ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents.rb deleted file mode 100644 index a483b0d9f8b5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/documents/credentials" -require "google/cloud/dialogflow/v2/documents/paths" -require "google/cloud/dialogflow/v2/documents/operations" -require "google/cloud/dialogflow/v2/documents/client" -require "google/cloud/dialogflow/v2/documents/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing knowledge - # {::Google::Cloud::Dialogflow::V2::Document Documents}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/documents" - # client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/documents/rest" - # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - module Documents - end - end - end - end -end - -helper_path = ::File.join __dir__, "documents", "helpers.rb" -require "google/cloud/dialogflow/v2/documents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb deleted file mode 100644 index 4c487f772e30..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/client.rb +++ /dev/null @@ -1,1354 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/document_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Documents - ## - # Client for the Documents service. - # - # Service for managing knowledge - # {::Google::Cloud::Dialogflow::V2::Document Documents}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :documents_stub - - ## - # Configure the Documents Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Documents::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Documents clients - # ::Google::Cloud::Dialogflow::V2::Documents::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Documents 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::Dialogflow::V2::Documents::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 - @documents_stub.universe_domain - end - - ## - # Create a new Documents client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Documents 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/dialogflow/v2/document_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 - - @documents_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Documents::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 - ) - - @documents_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 = @documents_stub.endpoint - config.universe_domain = @documents_stub.universe_domain - config.logger = @documents_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::Documents::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 - @documents_stub.logger - end - - # Service calls - - ## - # Returns the list of all documents of the knowledge base. - # - # @overload list_documents(request, options = nil) - # Pass arguments to `list_documents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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, filter: 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 knowledge base to list all documents for. - # Format: `projects//locations//knowledgeBases/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By - # default 10 and at most 100. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # @param filter [::String] - # The filter expression used to filter documents returned by the list method. - # The expression has the following syntax: - # - # [AND ] ... - # - # The following fields and operators are supported: - # - # * knowledge_types with has(:) operator - # * display_name with has(:) operator - # * state with equals(=) operator - # - # Examples: - # - # * "knowledge_types:FAQ" matches documents with FAQ knowledge type. - # * "display_name:customer" matches documents whose display name contains - # "customer". - # * "state=ACTIVE" matches documents with ACTIVE state. - # * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - - @documents_stub.call_rpc :list_documents, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @documents_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 - - ## - # Retrieves the specified document. - # - # @overload get_document(request, options = nil) - # Pass arguments to `get_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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. The name of the document to retrieve. - # Format `projects//locations//knowledgeBases//documents/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Document] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Document] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new - # - # # Call the get_document method. - # result = client.get_document request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - - @documents_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 - - ## - # Creates a new document. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} - # - # @overload create_document(request, options = nil) - # Pass arguments to `create_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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) - # 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 knowledge base to create a document for. - # Format: `projects//locations//knowledgeBases/`. - # @param document [::Google::Cloud::Dialogflow::V2::Document, ::Hash] - # Required. The document 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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new - # - # # Call the create_document method. - # result = client.create_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - - @documents_stub.call_rpc :create_document, 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 documents by importing data from external sources. - # Dialogflow supports up to 350 documents in each request. If you try to - # import more, Dialogflow will return an error. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ImportDocumentsResponse ImportDocumentsResponse} - # - # @overload import_documents(request, options = nil) - # Pass arguments to `import_documents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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(parent: nil, gcs_source: nil, document_template: nil, import_gcs_custom_metadata: 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 parent [::String] - # Required. The knowledge base to import documents into. - # Format: `projects//locations//knowledgeBases/`. - # @param gcs_source [::Google::Cloud::Dialogflow::V2::GcsSources, ::Hash] - # Optional. The Google Cloud Storage location for the documents. - # The path can include a wildcard. - # - # These URIs may have the forms - # `gs:///`. - # `gs:////*.`. - # @param document_template [::Google::Cloud::Dialogflow::V2::ImportDocumentTemplate, ::Hash] - # Required. Document template used for importing all the documents. - # @param import_gcs_custom_metadata [::Boolean] - # Whether to import custom metadata from Google Cloud Storage. - # Only valid when the document source is Google Cloud Storage URI. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - - @documents_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 - - ## - # Deletes the specified document. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload delete_document(request, options = nil) - # Pass arguments to `delete_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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. The name of the document to delete. - # Format: `projects//locations//knowledgeBases//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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new - # - # # Call the delete_document method. - # result = client.delete_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - - @documents_stub.call_rpc :delete_document, 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 the specified document. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} - # - # @overload update_document(request, options = nil) - # Pass arguments to `update_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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, 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::Dialogflow::V2::Document, ::Hash] - # Required. The document to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Not specified means `update all`. - # Currently, only `display_name` can be updated, an InvalidArgument will be - # returned for attempting to update other fields. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new - # - # # Call the update_document method. - # result = client.update_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - - @documents_stub.call_rpc :update_document, 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 - - ## - # Reloads the specified document from its specified source, content_uri or - # content. The previously loaded content of the document will be deleted. - # Note: Even when the content of the document has not changed, there still - # may be side effects because of internal implementation changes. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} - # - # Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - # only use `projects.knowledgeBases.documents`. - # - # @overload reload_document(request, options = nil) - # Pass arguments to `reload_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reload_document(name: nil, content_uri: nil, import_gcs_custom_metadata: nil, smart_messaging_partial_update: nil) - # Pass arguments to `reload_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. The name of the document to reload. - # Format: `projects//locations//knowledgeBases//documents/` - # @param content_uri [::String] - # Optional. The path of gcs source file for reloading document content. For - # now, only gcs uri is supported. - # - # For documents stored in Google Cloud Storage, these URIs must have - # the form `gs:///`. - # @param import_gcs_custom_metadata [::Boolean] - # Optional. Whether to import custom metadata from Google Cloud Storage. - # Only valid when the document source is Google Cloud Storage URI. - # @param smart_messaging_partial_update [::Boolean] - # Optional. When enabled, the reload request is to apply partial update to - # the smart messaging allowlist. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new - # - # # Call the reload_document method. - # result = client.reload_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 reload_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.reload_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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.reload_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reload_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @documents_stub.call_rpc :reload_document, 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 - - ## - # Exports a smart messaging candidate document into the specified - # destination. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} - # - # @overload export_document(request, options = nil) - # Pass arguments to `export_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ExportDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ExportDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload export_document(name: nil, gcs_destination: nil, export_full_content: nil, smart_messaging_partial_update: nil) - # Pass arguments to `export_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. The name of the document to export. - # Format: `projects//locations//knowledgeBases//documents/`. - # @param gcs_destination [::Google::Cloud::Dialogflow::V2::GcsDestination, ::Hash] - # Cloud Storage file path to export the document. - # @param export_full_content [::Boolean] - # When enabled, export the full content of the document including empirical - # probability. - # @param smart_messaging_partial_update [::Boolean] - # When enabled, export the smart messaging allowlist document for partial - # update. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new - # - # # Call the export_document method. - # result = client.export_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 export_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.export_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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.export_document.timeout, - metadata: metadata, - retry_policy: @config.rpcs.export_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @documents_stub.call_rpc :export_document, 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 Documents API. - # - # This class represents the configuration for Documents, - # 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::Dialogflow::V2::Documents::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_documents to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Documents::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_documents.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_documents.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::Dialogflow::V2::Documents::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Documents 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_documents - ## - # RPC-specific configuration for `get_document` - # @return [::Gapic::Config::Method] - # - attr_reader :get_document - ## - # RPC-specific configuration for `create_document` - # @return [::Gapic::Config::Method] - # - attr_reader :create_document - ## - # RPC-specific configuration for `import_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_documents - ## - # RPC-specific configuration for `delete_document` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_document - ## - # RPC-specific configuration for `update_document` - # @return [::Gapic::Config::Method] - # - attr_reader :update_document - ## - # RPC-specific configuration for `reload_document` - # @return [::Gapic::Config::Method] - # - attr_reader :reload_document - ## - # RPC-specific configuration for `export_document` - # @return [::Gapic::Config::Method] - # - attr_reader :export_document - - # @private - def initialize parent_rpcs = nil - list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents - @list_documents = ::Gapic::Config::Method.new list_documents_config - get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document - @get_document = ::Gapic::Config::Method.new get_document_config - create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document - @create_document = ::Gapic::Config::Method.new create_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 - delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document - @delete_document = ::Gapic::Config::Method.new delete_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 - reload_document_config = parent_rpcs.reload_document if parent_rpcs.respond_to? :reload_document - @reload_document = ::Gapic::Config::Method.new reload_document_config - export_document_config = parent_rpcs.export_document if parent_rpcs.respond_to? :export_document - @export_document = ::Gapic::Config::Method.new export_document_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/credentials.rb deleted file mode 100644 index 85a7f2b9db14..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Documents - # Credentials for the Documents API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb deleted file mode 100644 index 5c59147e0efc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module Documents - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Documents 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 Documents 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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/paths.rb deleted file mode 100644 index 422e7cfc8ecf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/paths.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 Dialogflow - module V2 - module Documents - # Path helper methods for the Documents API. - module Paths - ## - # Create a fully-qualified Document resource string. - # - # @overload document_path(project:, knowledge_base:, document:) - # The resource will be in the following format: - # - # `projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}` - # - # @param project [String] - # @param knowledge_base [String] - # @param document [String] - # - # @overload document_path(project:, location:, knowledge_base:, document:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}` - # - # @param project [String] - # @param location [String] - # @param knowledge_base [String] - # @param document [String] - # - # @return [::String] - def document_path **args - resources = { - "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" - - "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}" - end), - "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/" - - "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/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 KnowledgeBase resource string. - # - # @overload knowledge_base_path(project:, knowledge_base:) - # The resource will be in the following format: - # - # `projects/{project}/knowledgeBases/{knowledge_base}` - # - # @param project [String] - # @param knowledge_base [String] - # - # @overload knowledge_base_path(project:, location:, knowledge_base:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}` - # - # @param project [String] - # @param location [String] - # @param knowledge_base [String] - # - # @return [::String] - def knowledge_base_path **args - resources = { - "knowledge_base:project" => (proc do |project:, knowledge_base:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/knowledgeBases/#{knowledge_base}" - end), - "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest.rb deleted file mode 100644 index c04a2b4e8c03..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/documents/credentials" -require "google/cloud/dialogflow/v2/documents/paths" -require "google/cloud/dialogflow/v2/documents/rest/operations" -require "google/cloud/dialogflow/v2/documents/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing knowledge - # {::Google::Cloud::Dialogflow::V2::Document Documents}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/documents/rest" - # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - module Documents - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/documents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb deleted file mode 100644 index 8cdca1dc7396..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +++ /dev/null @@ -1,1263 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/document_pb" -require "google/cloud/dialogflow/v2/documents/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Documents - module Rest - ## - # REST client for the Documents service. - # - # Service for managing knowledge - # {::Google::Cloud::Dialogflow::V2::Document Documents}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :documents_stub - - ## - # Configure the Documents Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Documents::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Documents clients - # ::Google::Cloud::Dialogflow::V2::Documents::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Documents 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::Dialogflow::V2::Documents::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 - @documents_stub.universe_domain - end - - ## - # Create a new Documents REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Documents 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::Dialogflow::V2::Documents::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 - - @documents_stub = ::Google::Cloud::Dialogflow::V2::Documents::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @documents_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 = @documents_stub.endpoint - config.universe_domain = @documents_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @documents_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::Documents::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 - @documents_stub.logger - end - - # Service calls - - ## - # Returns the list of all documents of the knowledge base. - # - # @overload list_documents(request, options = nil) - # Pass arguments to `list_documents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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, filter: 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 knowledge base to list all documents for. - # Format: `projects//locations//knowledgeBases/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By - # default 10 and at most 100. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # @param filter [::String] - # The filter expression used to filter documents returned by the list method. - # The expression has the following syntax: - # - # [AND ] ... - # - # The following fields and operators are supported: - # - # * knowledge_types with has(:) operator - # * display_name with has(:) operator - # * state with equals(=) operator - # - # Examples: - # - # * "knowledge_types:FAQ" matches documents with FAQ knowledge type. - # * "display_name:customer" matches documents whose display name contains - # "customer". - # * "state=ACTIVE" matches documents with ACTIVE state. - # * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - @documents_stub.list_documents request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @documents_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 - - ## - # Retrieves the specified document. - # - # @overload get_document(request, options = nil) - # Pass arguments to `get_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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. The name of the document to retrieve. - # Format `projects//locations//knowledgeBases//documents/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Document] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new - # - # # Call the get_document method. - # result = client.get_document request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - @documents_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 - - ## - # Creates a new document. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} - # - # @overload create_document(request, options = nil) - # Pass arguments to `create_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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) - # 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 knowledge base to create a document for. - # Format: `projects//locations//knowledgeBases/`. - # @param document [::Google::Cloud::Dialogflow::V2::Document, ::Hash] - # Required. The document 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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new - # - # # Call the create_document method. - # result = client.create_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - @documents_stub.create_document 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 documents by importing data from external sources. - # Dialogflow supports up to 350 documents in each request. If you try to - # import more, Dialogflow will return an error. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: - # {::Google::Cloud::Dialogflow::V2::ImportDocumentsResponse ImportDocumentsResponse} - # - # @overload import_documents(request, options = nil) - # Pass arguments to `import_documents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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(parent: nil, gcs_source: nil, document_template: nil, import_gcs_custom_metadata: 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 parent [::String] - # Required. The knowledge base to import documents into. - # Format: `projects//locations//knowledgeBases/`. - # @param gcs_source [::Google::Cloud::Dialogflow::V2::GcsSources, ::Hash] - # Optional. The Google Cloud Storage location for the documents. - # The path can include a wildcard. - # - # These URIs may have the forms - # `gs:///`. - # `gs:////*.`. - # @param document_template [::Google::Cloud::Dialogflow::V2::ImportDocumentTemplate, ::Hash] - # Required. Document template used for importing all the documents. - # @param import_gcs_custom_metadata [::Boolean] - # Whether to import custom metadata from Google Cloud Storage. - # Only valid when the document source is Google Cloud Storage URI. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - @documents_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 - - ## - # Deletes the specified document. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # @overload delete_document(request, options = nil) - # Pass arguments to `delete_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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. The name of the document to delete. - # Format: `projects//locations//knowledgeBases//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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new - # - # # Call the delete_document method. - # result = client.delete_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - @documents_stub.delete_document 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 the specified document. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} - # - # @overload update_document(request, options = nil) - # Pass arguments to `update_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::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, 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::Dialogflow::V2::Document, ::Hash] - # Required. The document to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Not specified means `update all`. - # Currently, only `display_name` can be updated, an InvalidArgument will be - # returned for attempting to update other fields. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new - # - # # Call the update_document method. - # result = client.update_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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 - - @documents_stub.update_document 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 - - ## - # Reloads the specified document from its specified source, content_uri or - # content. The previously loaded content of the document will be deleted. - # Note: Even when the content of the document has not changed, there still - # may be side effects because of internal implementation changes. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} - # - # Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - # only use `projects.knowledgeBases.documents`. - # - # @overload reload_document(request, options = nil) - # Pass arguments to `reload_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reload_document(name: nil, content_uri: nil, import_gcs_custom_metadata: nil, smart_messaging_partial_update: nil) - # Pass arguments to `reload_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. The name of the document to reload. - # Format: `projects//locations//knowledgeBases//documents/` - # @param content_uri [::String] - # Optional. The path of gcs source file for reloading document content. For - # now, only gcs uri is supported. - # - # For documents stored in Google Cloud Storage, these URIs must have - # the form `gs:///`. - # @param import_gcs_custom_metadata [::Boolean] - # Optional. Whether to import custom metadata from Google Cloud Storage. - # Only valid when the document source is Google Cloud Storage URI. - # @param smart_messaging_partial_update [::Boolean] - # Optional. When enabled, the reload request is to apply partial update to - # the smart messaging allowlist. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new - # - # # Call the reload_document method. - # result = client.reload_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 reload_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.reload_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.reload_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reload_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @documents_stub.reload_document 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 - - ## - # Exports a smart messaging candidate document into the specified - # destination. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: - # {::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata KnowledgeOperationMetadata} - # - `response`: {::Google::Cloud::Dialogflow::V2::Document Document} - # - # @overload export_document(request, options = nil) - # Pass arguments to `export_document` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ExportDocumentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ExportDocumentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload export_document(name: nil, gcs_destination: nil, export_full_content: nil, smart_messaging_partial_update: nil) - # Pass arguments to `export_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. The name of the document to export. - # Format: `projects//locations//knowledgeBases//documents/`. - # @param gcs_destination [::Google::Cloud::Dialogflow::V2::GcsDestination, ::Hash] - # Cloud Storage file path to export the document. - # @param export_full_content [::Boolean] - # When enabled, export the full content of the document including empirical - # probability. - # @param smart_messaging_partial_update [::Boolean] - # When enabled, export the smart messaging allowlist document for partial - # update. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new - # - # # Call the export_document method. - # result = client.export_document request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 export_document request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.export_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.export_document.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.export_document.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @documents_stub.export_document 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 Documents REST API. - # - # This class represents the configuration for Documents 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::Dialogflow::V2::Documents::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_documents to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_documents.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_documents.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Documents 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_documents - ## - # RPC-specific configuration for `get_document` - # @return [::Gapic::Config::Method] - # - attr_reader :get_document - ## - # RPC-specific configuration for `create_document` - # @return [::Gapic::Config::Method] - # - attr_reader :create_document - ## - # RPC-specific configuration for `import_documents` - # @return [::Gapic::Config::Method] - # - attr_reader :import_documents - ## - # RPC-specific configuration for `delete_document` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_document - ## - # RPC-specific configuration for `update_document` - # @return [::Gapic::Config::Method] - # - attr_reader :update_document - ## - # RPC-specific configuration for `reload_document` - # @return [::Gapic::Config::Method] - # - attr_reader :reload_document - ## - # RPC-specific configuration for `export_document` - # @return [::Gapic::Config::Method] - # - attr_reader :export_document - - # @private - def initialize parent_rpcs = nil - list_documents_config = parent_rpcs.list_documents if parent_rpcs.respond_to? :list_documents - @list_documents = ::Gapic::Config::Method.new list_documents_config - get_document_config = parent_rpcs.get_document if parent_rpcs.respond_to? :get_document - @get_document = ::Gapic::Config::Method.new get_document_config - create_document_config = parent_rpcs.create_document if parent_rpcs.respond_to? :create_document - @create_document = ::Gapic::Config::Method.new create_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 - delete_document_config = parent_rpcs.delete_document if parent_rpcs.respond_to? :delete_document - @delete_document = ::Gapic::Config::Method.new delete_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 - reload_document_config = parent_rpcs.reload_document if parent_rpcs.respond_to? :reload_document - @reload_document = ::Gapic::Config::Method.new reload_document_config - export_document_config = parent_rpcs.export_document if parent_rpcs.respond_to? :export_document - @export_document = ::Gapic::Config::Method.new export_document_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb deleted file mode 100644 index 9f381a7a3752..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb +++ /dev/null @@ -1,947 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module Documents - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Documents 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 Documents 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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb deleted file mode 100644 index 122413f47a76..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb +++ /dev/null @@ -1,680 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/document_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Documents - module Rest - ## - # REST service stub for the Documents 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_documents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::ListDocumentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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 get_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Document] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::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 create_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # 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::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_documents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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 delete_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # 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::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_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # 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::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 reload_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 reload_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reload_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: "reload_document", - 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 export_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ExportDocumentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 export_document request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_export_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: "export_document", - 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_documents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/documents", - matches: [ - ["parent", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/documents", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/documents", - matches: [ - ["parent", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/documents", - body: "document", - matches: [ - ["parent", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/documents", - body: "document", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/documents", - body: "document", - matches: [ - ["parent", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_documents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{parent}/documents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/documents:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::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: "/v2/{document.name}", - body: "document", - matches: [ - ["document.name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{document.name}", - body: "document", - matches: [ - ["document.name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{document.name}", - body: "document", - matches: [ - ["document.name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reload_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reload_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:reload", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:reload", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:reload", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the export_document REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ExportDocumentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_export_document_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:export", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/documents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_pb.rb deleted file mode 100644 index 6062410d91a7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_pb.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/encryption_spec.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' - - -descriptor_data = "\n0google/cloud/dialogflow/v2/encryption_spec.proto\x12\x1agoogle.cloud.dialogflow.v2\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\"Z\n\x18GetEncryptionSpecRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(dialogflow.googleapis.com/EncryptionSpec\"\xc3\x01\n\x0e\x45ncryptionSpec\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x14\n\x07kms_key\x18\x02 \x01(\tB\x03\xe0\x41\x02:\x87\x01\xea\x41\x83\x01\n(dialogflow.googleapis.com/EncryptionSpec\x12\x36projects/{project}/locations/{location}/encryptionSpec*\x0f\x65ncryptionSpecs2\x0e\x65ncryptionSpec\"k\n\x1fInitializeEncryptionSpecRequest\x12H\n\x0f\x65ncryption_spec\x18\x01 \x01(\x0b\x32*.google.cloud.dialogflow.v2.EncryptionSpecB\x03\xe0\x41\x02\"\"\n InitializeEncryptionSpecResponse\"u\n InitializeEncryptionSpecMetadata\x12Q\n\x07request\x18\x04 \x01(\x0b\x32;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequestB\x03\xe0\x41\x03\x32\xf5\x04\n\x15\x45ncryptionSpecService\x12\xb6\x01\n\x11GetEncryptionSpec\x12\x34.google.cloud.dialogflow.v2.GetEncryptionSpecRequest\x1a*.google.cloud.dialogflow.v2.EncryptionSpec\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v2/{name=projects/*/locations/*/encryptionSpec}\x12\xa8\x02\n\x18InitializeEncryptionSpec\x12;.google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest\x1a\x1d.google.longrunning.Operation\"\xaf\x01\xca\x41\x44\n InitializeEncryptionSpecResponse\x12 InitializeEncryptionSpecMetadata\xda\x41\x0f\x65ncryption_spec\x82\xd3\xe4\x93\x02P\"K/v2/{encryption_spec.name=projects/*/locations/*/encryptionSpec}:initialize:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x99\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x13\x45ncryptionSpecProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - GetEncryptionSpecRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEncryptionSpecRequest").msgclass - EncryptionSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EncryptionSpec").msgclass - InitializeEncryptionSpecRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InitializeEncryptionSpecRequest").msgclass - InitializeEncryptionSpecResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InitializeEncryptionSpecResponse").msgclass - InitializeEncryptionSpecMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InitializeEncryptionSpecMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service.rb deleted file mode 100644 index 048efc512b53..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/encryption_spec_service/credentials" -require "google/cloud/dialogflow/v2/encryption_spec_service/paths" -require "google/cloud/dialogflow/v2/encryption_spec_service/operations" -require "google/cloud/dialogflow/v2/encryption_spec_service/client" -require "google/cloud/dialogflow/v2/encryption_spec_service/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Manages encryption spec settings for Dialogflow and Agent Assist. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/encryption_spec_service" - # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/encryption_spec_service/rest" - # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new - # - module EncryptionSpecService - end - end - end - end -end - -helper_path = ::File.join __dir__, "encryption_spec_service", "helpers.rb" -require "google/cloud/dialogflow/v2/encryption_spec_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/client.rb deleted file mode 100644 index 2fe652189650..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/client.rb +++ /dev/null @@ -1,619 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/encryption_spec_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module EncryptionSpecService - ## - # Client for the EncryptionSpecService service. - # - # Manages encryption spec settings for Dialogflow and Agent Assist. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :encryption_spec_service_stub - - ## - # Configure the EncryptionSpecService Client class. - # - # See {::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EncryptionSpecService clients - # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::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 - @encryption_spec_service_stub.universe_domain - end - - ## - # Create a new EncryptionSpecService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EncryptionSpecService 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/dialogflow/v2/encryption_spec_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 - - @encryption_spec_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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 - ) - - @encryption_spec_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 = @encryption_spec_service_stub.endpoint - config.universe_domain = @encryption_spec_service_stub.universe_domain - config.logger = @encryption_spec_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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 - @encryption_spec_service_stub.logger - end - - # Service calls - - ## - # Gets location-level encryption key specification. - # - # @overload get_encryption_spec(request, options = nil) - # Pass arguments to `get_encryption_spec` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_encryption_spec(name: nil) - # Pass arguments to `get_encryption_spec` via keyword arguments. Note that at - # least one keyword argument is required. To 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 encryption spec resource to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::EncryptionSpec] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpec] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new - # - # # Call the get_encryption_spec method. - # result = client.get_encryption_spec request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::EncryptionSpec. - # p result - # - def get_encryption_spec request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest - - # Converts hash and nil to 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_encryption_spec.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_encryption_spec.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_encryption_spec.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @encryption_spec_service_stub.call_rpc :get_encryption_spec, 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 - - ## - # Initializes a location-level encryption key specification. An error will - # be thrown if the location has resources already created before the - # initialization. Once the encryption specification is initialized at a - # location, it is immutable and all newly created resources under the - # location will be encrypted with the existing specification. - # - # @overload initialize_encryption_spec(request, options = nil) - # Pass arguments to `initialize_encryption_spec` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload initialize_encryption_spec(encryption_spec: nil) - # Pass arguments to `initialize_encryption_spec` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param encryption_spec [::Google::Cloud::Dialogflow::V2::EncryptionSpec, ::Hash] - # Required. The encryption spec used for CMEK encryption. It is required that - # the kms key is in the same region as the endpoint. The same key will be - # used for all provisioned resources, if encryption is available. If the - # kms_key_name is left empty, no encryption will be enforced. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new - # - # # Call the initialize_encryption_spec method. - # result = client.initialize_encryption_spec request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 initialize_encryption_spec request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.initialize_encryption_spec.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.encryption_spec&.name - header_params["encryption_spec.name"] = request.encryption_spec.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.initialize_encryption_spec.timeout, - metadata: metadata, - retry_policy: @config.rpcs.initialize_encryption_spec.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @encryption_spec_service_stub.call_rpc :initialize_encryption_spec, 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 EncryptionSpecService API. - # - # This class represents the configuration for EncryptionSpecService, - # 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::Dialogflow::V2::EncryptionSpecService::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_encryption_spec to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_encryption_spec.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_encryption_spec.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::Dialogflow::V2::EncryptionSpecService::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 EncryptionSpecService 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_encryption_spec` - # @return [::Gapic::Config::Method] - # - attr_reader :get_encryption_spec - ## - # RPC-specific configuration for `initialize_encryption_spec` - # @return [::Gapic::Config::Method] - # - attr_reader :initialize_encryption_spec - - # @private - def initialize parent_rpcs = nil - get_encryption_spec_config = parent_rpcs.get_encryption_spec if parent_rpcs.respond_to? :get_encryption_spec - @get_encryption_spec = ::Gapic::Config::Method.new get_encryption_spec_config - initialize_encryption_spec_config = parent_rpcs.initialize_encryption_spec if parent_rpcs.respond_to? :initialize_encryption_spec - @initialize_encryption_spec = ::Gapic::Config::Method.new initialize_encryption_spec_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/credentials.rb deleted file mode 100644 index 87ea83d090ba..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module EncryptionSpecService - # Credentials for the EncryptionSpecService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/operations.rb deleted file mode 100644 index ee38ffdecbbc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module EncryptionSpecService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the EncryptionSpecService 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 EncryptionSpecService 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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/paths.rb deleted file mode 100644 index 9312f50d4940..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/paths.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! - - -module Google - module Cloud - module Dialogflow - module V2 - module EncryptionSpecService - # Path helper methods for the EncryptionSpecService API. - module Paths - ## - # Create a fully-qualified EncryptionSpec resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/encryptionSpec` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def encryption_spec_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/encryptionSpec" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest.rb deleted file mode 100644 index 07f9f47f31c2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/encryption_spec_service/credentials" -require "google/cloud/dialogflow/v2/encryption_spec_service/paths" -require "google/cloud/dialogflow/v2/encryption_spec_service/rest/operations" -require "google/cloud/dialogflow/v2/encryption_spec_service/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Manages encryption spec settings for Dialogflow and Agent Assist. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/encryption_spec_service/rest" - # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new - # - module EncryptionSpecService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/encryption_spec_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/client.rb deleted file mode 100644 index 185030bca83f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/client.rb +++ /dev/null @@ -1,570 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/encryption_spec_pb" -require "google/cloud/dialogflow/v2/encryption_spec_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module EncryptionSpecService - module Rest - ## - # REST client for the EncryptionSpecService service. - # - # Manages encryption spec settings for Dialogflow and Agent Assist. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :encryption_spec_service_stub - - ## - # Configure the EncryptionSpecService Client class. - # - # See {::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EncryptionSpecService clients - # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::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 - @encryption_spec_service_stub.universe_domain - end - - ## - # Create a new EncryptionSpecService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::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 - - @encryption_spec_service_stub = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @encryption_spec_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 = @encryption_spec_service_stub.endpoint - config.universe_domain = @encryption_spec_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @encryption_spec_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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 - @encryption_spec_service_stub.logger - end - - # Service calls - - ## - # Gets location-level encryption key specification. - # - # @overload get_encryption_spec(request, options = nil) - # Pass arguments to `get_encryption_spec` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_encryption_spec(name: nil) - # Pass arguments to `get_encryption_spec` via keyword arguments. Note that at - # least one keyword argument is required. To 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 encryption spec resource to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::EncryptionSpec] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpec] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new - # - # # Call the get_encryption_spec method. - # result = client.get_encryption_spec request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::EncryptionSpec. - # p result - # - def get_encryption_spec request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest - - # Converts hash and nil to an 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_encryption_spec.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_encryption_spec.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_encryption_spec.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @encryption_spec_service_stub.get_encryption_spec 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 - - ## - # Initializes a location-level encryption key specification. An error will - # be thrown if the location has resources already created before the - # initialization. Once the encryption specification is initialized at a - # location, it is immutable and all newly created resources under the - # location will be encrypted with the existing specification. - # - # @overload initialize_encryption_spec(request, options = nil) - # Pass arguments to `initialize_encryption_spec` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload initialize_encryption_spec(encryption_spec: nil) - # Pass arguments to `initialize_encryption_spec` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param encryption_spec [::Google::Cloud::Dialogflow::V2::EncryptionSpec, ::Hash] - # Required. The encryption spec used for CMEK encryption. It is required that - # the kms key is in the same region as the endpoint. The same key will be - # used for all provisioned resources, if encryption is available. If the - # kms_key_name is left empty, no encryption will be enforced. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new - # - # # Call the initialize_encryption_spec method. - # result = client.initialize_encryption_spec request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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 initialize_encryption_spec request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.initialize_encryption_spec.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.initialize_encryption_spec.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.initialize_encryption_spec.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @encryption_spec_service_stub.initialize_encryption_spec 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 EncryptionSpecService REST API. - # - # This class represents the configuration for EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::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_encryption_spec to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_encryption_spec.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_encryption_spec.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 EncryptionSpecService 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_encryption_spec` - # @return [::Gapic::Config::Method] - # - attr_reader :get_encryption_spec - ## - # RPC-specific configuration for `initialize_encryption_spec` - # @return [::Gapic::Config::Method] - # - attr_reader :initialize_encryption_spec - - # @private - def initialize parent_rpcs = nil - get_encryption_spec_config = parent_rpcs.get_encryption_spec if parent_rpcs.respond_to? :get_encryption_spec - @get_encryption_spec = ::Gapic::Config::Method.new get_encryption_spec_config - initialize_encryption_spec_config = parent_rpcs.initialize_encryption_spec if parent_rpcs.respond_to? :initialize_encryption_spec - @initialize_encryption_spec = ::Gapic::Config::Method.new initialize_encryption_spec_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/operations.rb deleted file mode 100644 index c98366afb3a3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/operations.rb +++ /dev/null @@ -1,947 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module EncryptionSpecService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the EncryptionSpecService 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 EncryptionSpecService 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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_service/rest/service_stub.rb deleted file mode 100644 index 67a69af2e0f2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/encryption_spec_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module EncryptionSpecService - module Rest - ## - # REST service stub for the EncryptionSpecService 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_encryption_spec REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::EncryptionSpec] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpec] - # A result object deserialized from the server's reply - def get_encryption_spec request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_encryption_spec_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_encryption_spec", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::EncryptionSpec.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the initialize_encryption_spec REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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 initialize_encryption_spec request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_initialize_encryption_spec_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "initialize_encryption_spec", - 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_encryption_spec REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest] - # 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_encryption_spec_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/encryptionSpec/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the initialize_encryption_spec REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_initialize_encryption_spec_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{encryption_spec.name}:initialize", - body: "*", - matches: [ - ["encryption_spec.name", %r{^projects/[^/]+/locations/[^/]+/encryptionSpec/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_services_pb.rb deleted file mode 100644 index 9b1cc6ee4edc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/encryption_spec_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/encryption_spec.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/encryption_spec_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module EncryptionSpecService - # Manages encryption spec settings for Dialogflow and Agent Assist. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.EncryptionSpecService' - - # Gets location-level encryption key specification. - rpc :GetEncryptionSpec, ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest, ::Google::Cloud::Dialogflow::V2::EncryptionSpec - # Initializes a location-level encryption key specification. An error will - # be thrown if the location has resources already created before the - # initialization. Once the encryption specification is initialized at a - # location, it is immutable and all newly created resources under the - # location will be encrypted with the existing specification. - rpc :InitializeEncryptionSpec, ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_pb.rb deleted file mode 100644 index 447ed3f86939..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/entity_type.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/field_mask_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n,google/cloud/dialogflow/v2/entity_type.proto\x12\x1agoogle.cloud.dialogflow.v2\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 google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xc3\x05\n\nEntityType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12>\n\x04kind\x18\x03 \x01(\x0e\x32+.google.cloud.dialogflow.v2.EntityType.KindB\x03\xe0\x41\x02\x12Z\n\x13\x61uto_expansion_mode\x18\x04 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.EntityType.AutoExpansionModeB\x03\xe0\x41\x01\x12\x44\n\x08\x65ntities\x18\x06 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xe0\x41\x01\x12$\n\x17\x65nable_fuzzy_extraction\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x33\n\x06\x45ntity\x12\x12\n\x05value\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08synonyms\x18\x02 \x03(\tB\x03\xe0\x41\x02\"J\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x0c\n\x08KIND_MAP\x10\x01\x12\r\n\tKIND_LIST\x10\x02\x12\x0f\n\x0bKIND_REGEXP\x10\x03\"Y\n\x11\x41utoExpansionMode\x12#\n\x1f\x41UTO_EXPANSION_MODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x41UTO_EXPANSION_MODE_DEFAULT\x10\x01:\xa7\x01\xea\x41\xa3\x01\n$dialogflow.googleapis.com/EntityType\x12\x32projects/{project}/agent/entityTypes/{entity_type}\x12Gprojects/{project}/locations/{location}/agent/entityTypes/{entity_type}\"\xa3\x01\n\x16ListEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"p\n\x17ListEntityTypesResponse\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.v2.EntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"n\n\x14GetEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb5\x01\n\x17\x43reateEntityTypeRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12@\n\x0b\x65ntity_type\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EntityTypeB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n\x17UpdateEntityTypeRequest\x12@\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EntityTypeB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"U\n\x17\x44\x65leteEntityTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\"\xb6\x02\n\x1d\x42\x61tchUpdateEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x1f\n\x15\x65ntity_type_batch_uri\x18\x02 \x01(\tH\x00\x12O\n\x18\x65ntity_type_batch_inline\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.v2.EntityTypeBatchH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x42\x13\n\x11\x65ntity_type_batch\"^\n\x1e\x42\x61tchUpdateEntityTypesResponse\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.v2.EntityType\"}\n\x1d\x42\x61tchDeleteEntityTypesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$dialogflow.googleapis.com/EntityType\x12\x1e\n\x11\x65ntity_type_names\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\xbc\x01\n\x1a\x42\x61tchCreateEntitiesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x44\n\x08\x65ntities\x18\x02 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xf2\x01\n\x1a\x42\x61tchUpdateEntitiesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x44\n\x08\x65ntities\x18\x02 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x92\x01\n\x1a\x42\x61tchDeleteEntitiesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$dialogflow.googleapis.com/EntityType\x12\x1a\n\rentity_values\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\"O\n\x0f\x45ntityTypeBatch\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.v2.EntityType2\xd6\x19\n\x0b\x45ntityTypes\x12\x87\x02\n\x0fListEntityTypes\x12\x32.google.cloud.dialogflow.v2.ListEntityTypesRequest\x1a\x33.google.cloud.dialogflow.v2.ListEntityTypesResponse\"\x8a\x01\xda\x41\x06parent\xda\x41\x14parent,language_code\x82\xd3\xe4\x93\x02\x64\x12)/v2/{parent=projects/*/agent}/entityTypesZ7\x12\x35/v2/{parent=projects/*/locations/*/agent}/entityTypes\x12\xf2\x01\n\rGetEntityType\x12\x30.google.cloud.dialogflow.v2.GetEntityTypeRequest\x1a&.google.cloud.dialogflow.v2.EntityType\"\x86\x01\xda\x41\x04name\xda\x41\x12name,language_code\x82\xd3\xe4\x93\x02\x64\x12)/v2/{name=projects/*/agent/entityTypes/*}Z7\x12\x35/v2/{name=projects/*/locations/*/agent/entityTypes/*}\x12\xae\x02\n\x10\x43reateEntityType\x12\x33.google.cloud.dialogflow.v2.CreateEntityTypeRequest\x1a&.google.cloud.dialogflow.v2.EntityType\"\xbc\x01\xda\x41\x12parent,entity_type\xda\x41 parent,entity_type,language_code\x82\xd3\xe4\x93\x02~\")/v2/{parent=projects/*/agent}/entityTypes:\x0b\x65ntity_typeZD\"5/v2/{parent=projects/*/locations/*/agent}/entityTypes:\x0b\x65ntity_type\x12\xb9\x02\n\x10UpdateEntityType\x12\x33.google.cloud.dialogflow.v2.UpdateEntityTypeRequest\x1a&.google.cloud.dialogflow.v2.EntityType\"\xc7\x01\xda\x41\x0b\x65ntity_type\xda\x41\x19\x65ntity_type,language_code\x82\xd3\xe4\x93\x02\x96\x01\x32\x35/v2/{entity_type.name=projects/*/agent/entityTypes/*}:\x0b\x65ntity_typeZP2A/v2/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}:\x0b\x65ntity_type\x12\xd2\x01\n\x10\x44\x65leteEntityType\x12\x33.google.cloud.dialogflow.v2.DeleteEntityTypeRequest\x1a\x16.google.protobuf.Empty\"q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x64*)/v2/{name=projects/*/agent/entityTypes/*}Z7*5/v2/{name=projects/*/locations/*/agent/entityTypes/*}\x12\xd4\x02\n\x16\x42\x61tchUpdateEntityTypes\x12\x39.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"\xdf\x01\xca\x41S\n9google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse\x12\x16google.protobuf.Struct\x82\xd3\xe4\x93\x02\x82\x01\"5/v2/{parent=projects/*/agent}/entityTypes:batchUpdate:\x01*ZF\"A/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate:\x01*\x12\xcb\x02\n\x16\x42\x61tchDeleteEntityTypes\x12\x39.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"\xd6\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x18parent,entity_type_names\x82\xd3\xe4\x93\x02\x82\x01\"5/v2/{parent=projects/*/agent}/entityTypes:batchDelete:\x01*ZF\"A/v2/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete:\x01*\x12\xf2\x02\n\x13\x42\x61tchCreateEntities\x12\x36.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x02\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x0fparent,entities\xda\x41\x1dparent,entities,language_code\x82\xd3\xe4\x93\x02\x98\x01\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate:\x01*ZQ\"L/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate:\x01*\x12\xf2\x02\n\x13\x42\x61tchUpdateEntities\x12\x36.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest\x1a\x1d.google.longrunning.Operation\"\x83\x02\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x0fparent,entities\xda\x41\x1dparent,entities,language_code\x82\xd3\xe4\x93\x02\x98\x01\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate:\x01*ZQ\"L/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate:\x01*\x12\xfc\x02\n\x13\x42\x61tchDeleteEntities\x12\x36.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x02\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x14parent,entity_values\xda\x41\"parent,entity_values,language_code\x82\xd3\xe4\x93\x02\x98\x01\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete:\x01*ZQ\"L/v2/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x95\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0f\x45ntityTypeProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType").msgclass - EntityType::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.Entity").msgclass - EntityType::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.Kind").enummodule - EntityType::AutoExpansionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.AutoExpansionMode").enummodule - ListEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEntityTypesRequest").msgclass - ListEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEntityTypesResponse").msgclass - GetEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEntityTypeRequest").msgclass - CreateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateEntityTypeRequest").msgclass - UpdateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateEntityTypeRequest").msgclass - DeleteEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteEntityTypeRequest").msgclass - BatchUpdateEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest").msgclass - BatchUpdateEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse").msgclass - BatchDeleteEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest").msgclass - BatchCreateEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchCreateEntitiesRequest").msgclass - BatchUpdateEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest").msgclass - BatchDeleteEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest").msgclass - EntityTypeBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityTypeBatch").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb deleted file mode 100644 index c04f16523e7f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +++ /dev/null @@ -1,143 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/entity_type.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/entity_type_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module EntityTypes - # Service for managing [EntityTypes][google.cloud.dialogflow.v2.EntityType]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.EntityTypes' - - # Returns the list of all entity types in the specified agent. - rpc :ListEntityTypes, ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, ::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse - # Retrieves the specified entity type. - rpc :GetEntityType, ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::EntityType - # Creates an entity type in the specified agent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :CreateEntityType, ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::EntityType - # Updates the specified entity type. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :UpdateEntityType, ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::EntityType - # Deletes the specified entity type. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :DeleteEntityType, ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, ::Google::Protobuf::Empty - # Updates/Creates multiple entity types in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse] - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :BatchUpdateEntityTypes, ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, ::Google::Longrunning::Operation - # Deletes entity types in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :BatchDeleteEntityTypes, ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, ::Google::Longrunning::Operation - # Creates multiple new entities in the specified entity type. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :BatchCreateEntities, ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, ::Google::Longrunning::Operation - # Updates or creates multiple entities in the specified entity type. This - # method does not affect entities in the entity type that aren't explicitly - # specified in the request. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - rpc :BatchUpdateEntities, ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, ::Google::Longrunning::Operation - # Deletes entities in the specified entity type. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :BatchDeleteEntities, ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types.rb deleted file mode 100644 index 1814288b807b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/entity_types/credentials" -require "google/cloud/dialogflow/v2/entity_types/paths" -require "google/cloud/dialogflow/v2/entity_types/operations" -require "google/cloud/dialogflow/v2/entity_types/client" -require "google/cloud/dialogflow/v2/entity_types/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/entity_types" - # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/entity_types/rest" - # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - module EntityTypes - end - end - end - end -end - -helper_path = ::File.join __dir__, "entity_types", "helpers.rb" -require "google/cloud/dialogflow/v2/entity_types/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb deleted file mode 100644 index 909e6fc7024f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/client.rb +++ /dev/null @@ -1,1561 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/entity_type_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module EntityTypes - ## - # Client for the EntityTypes service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :entity_types_stub - - ## - # Configure the EntityTypes Client class. - # - # See {::Google::Cloud::Dialogflow::V2::EntityTypes::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EntityTypes clients - # ::Google::Cloud::Dialogflow::V2::EntityTypes::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EntityTypes 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::Dialogflow::V2::EntityTypes::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 - @entity_types_stub.universe_domain - end - - ## - # Create a new EntityTypes client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EntityTypes 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/dialogflow/v2/entity_type_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 - - @entity_types_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::EntityTypes::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 - ) - - @entity_types_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 = @entity_types_stub.endpoint - config.universe_domain = @entity_types_stub.universe_domain - config.logger = @entity_types_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::EntityTypes::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 - @entity_types_stub.logger - end - - # Service calls - - ## - # Returns the list of all entity types in the specified agent. - # - # @overload list_entity_types(request, options = nil) - # Pass arguments to `list_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_entity_types` via keyword arguments. Note that at - # least one keyword argument is 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 agent to list all entity types from. - # Format: `projects//agent`. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new - # - # # Call the list_entity_types method. - # result = client.list_entity_types 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::Dialogflow::V2::EntityType. - # p item - # end - # - def list_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest - - # Converts hash and nil to 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_entity_types.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entity_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :list_entity_types, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @entity_types_stub, :list_entity_types, 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 - - ## - # Retrieves the specified entity type. - # - # @overload get_entity_type(request, options = nil) - # Pass arguments to `get_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(name: nil, language_code: nil) - # Pass arguments to `get_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To 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 entity type. - # Format: `projects//agent/entityTypes/`. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::EntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new - # - # # Call the get_entity_type method. - # result = client.get_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. - # p result - # - def get_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest - - # Converts hash and nil to 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entity_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :get_entity_type, 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 an entity type in the specified agent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload create_entity_type(request, options = nil) - # Pass arguments to `create_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(parent: nil, entity_type: nil, language_code: nil) - # Pass arguments to `create_entity_type` via keyword arguments. Note that at - # least one keyword argument is 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 agent to create a entity type for. - # Format: `projects//agent`. - # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash] - # Required. The entity type to create. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::EntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new - # - # # Call the create_entity_type method. - # result = client.create_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. - # p result - # - def create_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest - - # Converts hash and nil to 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entity_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :create_entity_type, 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 the specified entity type. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload update_entity_type(request, options = nil) - # Pass arguments to `update_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(entity_type: nil, language_code: nil, update_mask: nil) - # Pass arguments to `update_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash] - # Required. The entity type to update. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::EntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new - # - # # Call the update_entity_type method. - # result = client.update_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. - # p result - # - def update_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest - - # Converts hash and nil to 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.entity_type&.name - header_params["entity_type.name"] = request.entity_type.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_entity_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :update_entity_type, 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 specified entity type. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload delete_entity_type(request, options = nil) - # Pass arguments to `delete_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(name: nil) - # Pass arguments to `delete_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To 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 entity type to delete. - # Format: `projects//agent/entityTypes/`. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new - # - # # Call the delete_entity_type method. - # result = client.delete_entity_type request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest - - # Converts hash and nil to 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entity_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :delete_entity_type, 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/Creates multiple entity types in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse} - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_update_entity_types(request, options = nil) - # Pass arguments to `batch_update_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_type_batch_uri: nil, entity_type_batch_inline: nil, language_code: nil, update_mask: nil) - # Pass arguments to `batch_update_entity_types` via keyword arguments. Note that at - # least one keyword argument is 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 name of the agent to update or create entity types in. - # Format: `projects//agent`. - # @param entity_type_batch_uri [::String] - # The URI to a Google Cloud Storage file containing entity types to update - # or create. The file format can either be a serialized proto (of - # EntityBatch type) or a JSON object. Note: The URI must start with - # "gs://". - # - # Note: The following parameters are mutually exclusive: `entity_type_batch_uri`, `entity_type_batch_inline`. 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 entity_type_batch_inline [::Google::Cloud::Dialogflow::V2::EntityTypeBatch, ::Hash] - # The collection of entity types to update or create. - # - # Note: The following parameters are mutually exclusive: `entity_type_batch_inline`, `entity_type_batch_uri`. 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 language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new - # - # # Call the batch_update_entity_types method. - # result = client.batch_update_entity_types request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest - - # Converts hash and nil to 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_entity_types.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entity_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_update_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :batch_update_entity_types, 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 entity types in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_delete_entity_types(request, options = nil) - # Pass arguments to `batch_delete_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_delete_entity_types(parent: nil, entity_type_names: nil) - # Pass arguments to `batch_delete_entity_types` via keyword arguments. Note that at - # least one keyword argument is 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 name of the agent to delete all entities types for. Format: - # `projects//agent`. - # @param entity_type_names [::Array<::String>] - # Required. The names entity types to delete. All names must point to the - # same agent as `parent`. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new - # - # # Call the batch_delete_entity_types method. - # result = client.batch_delete_entity_types request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_delete_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest - - # Converts hash and nil to 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_delete_entity_types.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_delete_entity_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_delete_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :batch_delete_entity_types, 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 multiple new entities in the specified entity type. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_create_entities(request, options = nil) - # Pass arguments to `batch_create_entities` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entities(parent: nil, entities: nil, language_code: nil) - # Pass arguments to `batch_create_entities` via keyword arguments. Note that at - # least one keyword argument is 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 name of the entity type to create entities in. Format: - # `projects//agent/entityTypes/`. - # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>] - # Required. The entities to create. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new - # - # # Call the batch_create_entities method. - # result = client.batch_create_entities request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_entities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest - - # Converts hash and nil to 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_entities.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entities.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_create_entities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :batch_create_entities, 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 or creates multiple entities in the specified entity type. This - # method does not affect entities in the entity type that aren't explicitly - # specified in the request. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_update_entities(request, options = nil) - # Pass arguments to `batch_update_entities` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entities(parent: nil, entities: nil, language_code: nil, update_mask: nil) - # Pass arguments to `batch_update_entities` via keyword arguments. Note that at - # least one keyword argument is 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 name of the entity type to update or create entities in. - # Format: `projects//agent/entityTypes/`. - # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>] - # Required. The entities to update or create. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new - # - # # Call the batch_update_entities method. - # result = client.batch_update_entities request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_entities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest - - # Converts hash and nil to 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_entities.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entities.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_update_entities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :batch_update_entities, 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 entities in the specified entity type. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_delete_entities(request, options = nil) - # Pass arguments to `batch_delete_entities` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_delete_entities(parent: nil, entity_values: nil, language_code: nil) - # Pass arguments to `batch_delete_entities` via keyword arguments. Note that at - # least one keyword argument is 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 name of the entity type to delete entries for. Format: - # `projects//agent/entityTypes/`. - # @param entity_values [::Array<::String>] - # Required. The reference `values` of the entities to delete. Note that - # these are not fully-qualified names, i.e. they don't start with - # `projects/`. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new - # - # # Call the batch_delete_entities method. - # result = client.batch_delete_entities request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_delete_entities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest - - # Converts hash and nil to 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_delete_entities.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_delete_entities.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_delete_entities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.call_rpc :batch_delete_entities, 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 EntityTypes API. - # - # This class represents the configuration for EntityTypes, - # 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::Dialogflow::V2::EntityTypes::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_entity_types to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_entity_types.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_entity_types.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::Dialogflow::V2::EntityTypes::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 EntityTypes 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_entity_types - ## - # RPC-specific configuration for `get_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :get_entity_type - ## - # RPC-specific configuration for `create_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :create_entity_type - ## - # RPC-specific configuration for `update_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :update_entity_type - ## - # RPC-specific configuration for `delete_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_entity_type - ## - # RPC-specific configuration for `batch_update_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_entity_types - ## - # RPC-specific configuration for `batch_delete_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_entity_types - ## - # RPC-specific configuration for `batch_create_entities` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_entities - ## - # RPC-specific configuration for `batch_update_entities` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_entities - ## - # RPC-specific configuration for `batch_delete_entities` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_entities - - # @private - def initialize parent_rpcs = nil - list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types - @list_entity_types = ::Gapic::Config::Method.new list_entity_types_config - get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type - @get_entity_type = ::Gapic::Config::Method.new get_entity_type_config - create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type - @create_entity_type = ::Gapic::Config::Method.new create_entity_type_config - update_entity_type_config = parent_rpcs.update_entity_type if parent_rpcs.respond_to? :update_entity_type - @update_entity_type = ::Gapic::Config::Method.new update_entity_type_config - delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type - @delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config - batch_update_entity_types_config = parent_rpcs.batch_update_entity_types if parent_rpcs.respond_to? :batch_update_entity_types - @batch_update_entity_types = ::Gapic::Config::Method.new batch_update_entity_types_config - batch_delete_entity_types_config = parent_rpcs.batch_delete_entity_types if parent_rpcs.respond_to? :batch_delete_entity_types - @batch_delete_entity_types = ::Gapic::Config::Method.new batch_delete_entity_types_config - batch_create_entities_config = parent_rpcs.batch_create_entities if parent_rpcs.respond_to? :batch_create_entities - @batch_create_entities = ::Gapic::Config::Method.new batch_create_entities_config - batch_update_entities_config = parent_rpcs.batch_update_entities if parent_rpcs.respond_to? :batch_update_entities - @batch_update_entities = ::Gapic::Config::Method.new batch_update_entities_config - batch_delete_entities_config = parent_rpcs.batch_delete_entities if parent_rpcs.respond_to? :batch_delete_entities - @batch_delete_entities = ::Gapic::Config::Method.new batch_delete_entities_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/credentials.rb deleted file mode 100644 index 34cbbc55eef2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module EntityTypes - # Credentials for the EntityTypes API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb deleted file mode 100644 index 0b17a8443b03..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module EntityTypes - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the EntityTypes 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 EntityTypes 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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/paths.rb deleted file mode 100644 index c41806b6b9a8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +++ /dev/null @@ -1,110 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module EntityTypes - # Path helper methods for the EntityTypes API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # @overload agent_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/agent` - # - # @param project [String] - # - # @overload agent_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def agent_path **args - resources = { - "project" => (proc do |project:| - "projects/#{project}/agent" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent" - 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 EntityType resource string. - # - # @overload entity_type_path(project:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/agent/entityTypes/{entity_type}` - # - # @param project [String] - # @param entity_type [String] - # - # @overload entity_type_path(project:, location:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param entity_type [String] - # - # @return [::String] - def entity_type_path **args - resources = { - "entity_type:project" => (proc do |project:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/agent/entityTypes/#{entity_type}" - end), - "entity_type:location:project" => (proc do |project:, location:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/entityTypes/#{entity_type}" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest.rb deleted file mode 100644 index f408342e66c0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/entity_types/credentials" -require "google/cloud/dialogflow/v2/entity_types/paths" -require "google/cloud/dialogflow/v2/entity_types/rest/operations" -require "google/cloud/dialogflow/v2/entity_types/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/entity_types/rest" - # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - module EntityTypes - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/entity_types/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb deleted file mode 100644 index 0e6e900b528c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +++ /dev/null @@ -1,1456 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/entity_type_pb" -require "google/cloud/dialogflow/v2/entity_types/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module EntityTypes - module Rest - ## - # REST client for the EntityTypes service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :entity_types_stub - - ## - # Configure the EntityTypes Client class. - # - # See {::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all EntityTypes clients - # ::Google::Cloud::Dialogflow::V2::EntityTypes::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the EntityTypes 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::Dialogflow::V2::EntityTypes::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 - @entity_types_stub.universe_domain - end - - ## - # Create a new EntityTypes REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the EntityTypes 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::Dialogflow::V2::EntityTypes::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 - - @entity_types_stub = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @entity_types_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 = @entity_types_stub.endpoint - config.universe_domain = @entity_types_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @entity_types_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::EntityTypes::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 - @entity_types_stub.logger - end - - # Service calls - - ## - # Returns the list of all entity types in the specified agent. - # - # @overload list_entity_types(request, options = nil) - # Pass arguments to `list_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_entity_types` via keyword arguments. Note that at - # least one keyword argument is 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 agent to list all entity types from. - # Format: `projects//agent`. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new - # - # # Call the list_entity_types method. - # result = client.list_entity_types 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::Dialogflow::V2::EntityType. - # p item - # end - # - def list_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest - - # Converts hash and nil to an 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_entity_types.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_types.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.list_entity_types request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @entity_types_stub, :list_entity_types, "entity_types", 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 - - ## - # Retrieves the specified entity type. - # - # @overload get_entity_type(request, options = nil) - # Pass arguments to `get_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(name: nil, language_code: nil) - # Pass arguments to `get_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To 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 entity type. - # Format: `projects//agent/entityTypes/`. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new - # - # # Call the get_entity_type method. - # result = client.get_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. - # p result - # - def get_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest - - # Converts hash and nil to an 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.get_entity_type 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 an entity type in the specified agent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload create_entity_type(request, options = nil) - # Pass arguments to `create_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(parent: nil, entity_type: nil, language_code: nil) - # Pass arguments to `create_entity_type` via keyword arguments. Note that at - # least one keyword argument is 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 agent to create a entity type for. - # Format: `projects//agent`. - # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash] - # Required. The entity type to create. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new - # - # # Call the create_entity_type method. - # result = client.create_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. - # p result - # - def create_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest - - # Converts hash and nil to an 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.create_entity_type 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 the specified entity type. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload update_entity_type(request, options = nil) - # Pass arguments to `update_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(entity_type: nil, language_code: nil, update_mask: nil) - # Pass arguments to `update_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash] - # Required. The entity type to update. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new - # - # # Call the update_entity_type method. - # result = client.update_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. - # p result - # - def update_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest - - # Converts hash and nil to an 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.update_entity_type 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 specified entity type. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload delete_entity_type(request, options = nil) - # Pass arguments to `delete_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(name: nil) - # Pass arguments to `delete_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To 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 entity type to delete. - # Format: `projects//agent/entityTypes/`. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new - # - # # Call the delete_entity_type method. - # result = client.delete_entity_type request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest - - # Converts hash and nil to an 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.delete_entity_type 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/Creates multiple entity types in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse} - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_update_entity_types(request, options = nil) - # Pass arguments to `batch_update_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_types(parent: nil, entity_type_batch_uri: nil, entity_type_batch_inline: nil, language_code: nil, update_mask: nil) - # Pass arguments to `batch_update_entity_types` via keyword arguments. Note that at - # least one keyword argument is 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 name of the agent to update or create entity types in. - # Format: `projects//agent`. - # @param entity_type_batch_uri [::String] - # The URI to a Google Cloud Storage file containing entity types to update - # or create. The file format can either be a serialized proto (of - # EntityBatch type) or a JSON object. Note: The URI must start with - # "gs://". - # - # Note: The following parameters are mutually exclusive: `entity_type_batch_uri`, `entity_type_batch_inline`. 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 entity_type_batch_inline [::Google::Cloud::Dialogflow::V2::EntityTypeBatch, ::Hash] - # The collection of entity types to update or create. - # - # Note: The following parameters are mutually exclusive: `entity_type_batch_inline`, `entity_type_batch_uri`. 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 language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new - # - # # Call the batch_update_entity_types method. - # result = client.batch_update_entity_types request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest - - # Converts hash and nil to an 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_entity_types.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_types.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_update_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.batch_update_entity_types 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 entity types in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_delete_entity_types(request, options = nil) - # Pass arguments to `batch_delete_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_delete_entity_types(parent: nil, entity_type_names: nil) - # Pass arguments to `batch_delete_entity_types` via keyword arguments. Note that at - # least one keyword argument is 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 name of the agent to delete all entities types for. Format: - # `projects//agent`. - # @param entity_type_names [::Array<::String>] - # Required. The names entity types to delete. All names must point to the - # same agent as `parent`. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new - # - # # Call the batch_delete_entity_types method. - # result = client.batch_delete_entity_types request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_delete_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest - - # Converts hash and nil to an 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_delete_entity_types.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_delete_entity_types.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_delete_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.batch_delete_entity_types 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 multiple new entities in the specified entity type. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_create_entities(request, options = nil) - # Pass arguments to `batch_create_entities` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entities(parent: nil, entities: nil, language_code: nil) - # Pass arguments to `batch_create_entities` via keyword arguments. Note that at - # least one keyword argument is 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 name of the entity type to create entities in. Format: - # `projects//agent/entityTypes/`. - # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>] - # Required. The entities to create. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new - # - # # Call the batch_create_entities method. - # result = client.batch_create_entities request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_entities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest - - # Converts hash and nil to an 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_entities.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entities.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_create_entities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.batch_create_entities 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 or creates multiple entities in the specified entity type. This - # method does not affect entities in the entity type that aren't explicitly - # specified in the request. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_update_entities(request, options = nil) - # Pass arguments to `batch_update_entities` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entities(parent: nil, entities: nil, language_code: nil, update_mask: nil) - # Pass arguments to `batch_update_entities` via keyword arguments. Note that at - # least one keyword argument is 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 name of the entity type to update or create entities in. - # Format: `projects//agent/entityTypes/`. - # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>] - # Required. The entities to update or create. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new - # - # # Call the batch_update_entities method. - # result = client.batch_update_entities request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_entities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest - - # Converts hash and nil to an 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_entities.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entities.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_update_entities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.batch_update_entities 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 entities in the specified entity type. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_delete_entities(request, options = nil) - # Pass arguments to `batch_delete_entities` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_delete_entities(parent: nil, entity_values: nil, language_code: nil) - # Pass arguments to `batch_delete_entities` via keyword arguments. Note that at - # least one keyword argument is 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 name of the entity type to delete entries for. Format: - # `projects//agent/entityTypes/`. - # @param entity_values [::Array<::String>] - # Required. The reference `values` of the entities to delete. Note that - # these are not fully-qualified names, i.e. they don't start with - # `projects/`. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new - # - # # Call the batch_delete_entities method. - # result = client.batch_delete_entities request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_delete_entities request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest - - # Converts hash and nil to an 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_delete_entities.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_delete_entities.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_delete_entities.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @entity_types_stub.batch_delete_entities 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 EntityTypes REST API. - # - # This class represents the configuration for EntityTypes 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::Dialogflow::V2::EntityTypes::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_entity_types to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_entity_types.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_entity_types.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 EntityTypes 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_entity_types - ## - # RPC-specific configuration for `get_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :get_entity_type - ## - # RPC-specific configuration for `create_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :create_entity_type - ## - # RPC-specific configuration for `update_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :update_entity_type - ## - # RPC-specific configuration for `delete_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_entity_type - ## - # RPC-specific configuration for `batch_update_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_entity_types - ## - # RPC-specific configuration for `batch_delete_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_entity_types - ## - # RPC-specific configuration for `batch_create_entities` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_create_entities - ## - # RPC-specific configuration for `batch_update_entities` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_entities - ## - # RPC-specific configuration for `batch_delete_entities` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_entities - - # @private - def initialize parent_rpcs = nil - list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types - @list_entity_types = ::Gapic::Config::Method.new list_entity_types_config - get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type - @get_entity_type = ::Gapic::Config::Method.new get_entity_type_config - create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type - @create_entity_type = ::Gapic::Config::Method.new create_entity_type_config - update_entity_type_config = parent_rpcs.update_entity_type if parent_rpcs.respond_to? :update_entity_type - @update_entity_type = ::Gapic::Config::Method.new update_entity_type_config - delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type - @delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config - batch_update_entity_types_config = parent_rpcs.batch_update_entity_types if parent_rpcs.respond_to? :batch_update_entity_types - @batch_update_entity_types = ::Gapic::Config::Method.new batch_update_entity_types_config - batch_delete_entity_types_config = parent_rpcs.batch_delete_entity_types if parent_rpcs.respond_to? :batch_delete_entity_types - @batch_delete_entity_types = ::Gapic::Config::Method.new batch_delete_entity_types_config - batch_create_entities_config = parent_rpcs.batch_create_entities if parent_rpcs.respond_to? :batch_create_entities - @batch_create_entities = ::Gapic::Config::Method.new batch_create_entities_config - batch_update_entities_config = parent_rpcs.batch_update_entities if parent_rpcs.respond_to? :batch_update_entities - @batch_update_entities = ::Gapic::Config::Method.new batch_update_entities_config - batch_delete_entities_config = parent_rpcs.batch_delete_entities if parent_rpcs.respond_to? :batch_delete_entities - @batch_delete_entities = ::Gapic::Config::Method.new batch_delete_entities_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb deleted file mode 100644 index 9fc9f446bad6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb +++ /dev/null @@ -1,947 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module EntityTypes - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the EntityTypes 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 EntityTypes 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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb deleted file mode 100644 index 4043c9431a56..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb +++ /dev/null @@ -1,775 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/entity_type_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module EntityTypes - module Rest - ## - # REST service stub for the EntityTypes 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_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListEntityTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse] - # A result object deserialized from the server's reply - def list_entity_types request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_entity_types_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_types", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse.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_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # A result object deserialized from the server's reply - def get_entity_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_entity_type_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_type", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::EntityType.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_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # A result object deserialized from the server's reply - def create_entity_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_entity_type_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_type", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::EntityType.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_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::EntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # A result object deserialized from the server's reply - def update_entity_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_entity_type_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_type", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::EntityType.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_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_entity_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_entity_type_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_type", - 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 batch_update_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_entity_types request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_entity_types_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_types", - 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_delete_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_delete_entity_types request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_entity_types_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_delete_entity_types", - 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_entities REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_entities request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_entities_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entities", - 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_update_entities REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_entities request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_entities_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entities", - 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_delete_entities REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_delete_entities request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_entities_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_delete_entities", - 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_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest] - # 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_entity_types_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/entityTypes", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/entityTypes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest] - # 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_entity_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest] - # 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_entity_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes", - body: "entity_type", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes", - body: "entity_type", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest] - # 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_entity_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{entity_type.name}", - body: "entity_type", - matches: [ - ["entity_type.name", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{entity_type.name}", - body: "entity_type", - matches: [ - ["entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest] - # 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_entity_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_update_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest] - # 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_entity_types_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_delete_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest] - # 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_delete_entity_types_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_create_entities REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest] - # 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_entities_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entities:batchCreate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entities:batchCreate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_update_entities REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest] - # 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_entities_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entities:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entities:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_delete_entities REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest] - # 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_delete_entities_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entities:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entities:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_pb.rb deleted file mode 100644 index 0b3545def5e5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_pb.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/environment.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/dialogflow/v2/audio_config_pb' -require 'google/cloud/dialogflow/v2/fulfillment_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/dialogflow/v2/environment.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a,google/cloud/dialogflow/v2/fulfillment.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x84\x05\n\x0b\x45nvironment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12@\n\ragent_version\x18\x03 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Version\x12\x41\n\x05state\x18\x04 \x01(\x0e\x32-.google.cloud.dialogflow.v2.Environment.StateB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12V\n\x17text_to_speech_settings\x18\x07 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.TextToSpeechSettingsB\x03\xe0\x41\x01\x12\x41\n\x0b\x66ulfillment\x18\x08 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.FulfillmentB\x03\xe0\x41\x01\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07STOPPED\x10\x01\x12\x0b\n\x07LOADING\x10\x02\x12\x0b\n\x07RUNNING\x10\x03:\xaa\x01\xea\x41\xa6\x01\n%dialogflow.googleapis.com/Environment\x12\x33projects/{project}/agent/environments/{environment}\x12Hprojects/{project}/locations/{location}/agent/environments/{environment}\"\x9a\x03\n\x14TextToSpeechSettings\x12\"\n\x15\x65nable_text_to_speech\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12S\n\x15output_audio_encoding\x18\x02 \x01(\x0e\x32/.google.cloud.dialogflow.v2.OutputAudioEncodingB\x03\xe0\x41\x02\x12\x1e\n\x11sample_rate_hertz\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12u\n\x19synthesize_speech_configs\x18\x04 \x03(\x0b\x32M.google.cloud.dialogflow.v2.TextToSpeechSettings.SynthesizeSpeechConfigsEntryB\x03\xe0\x41\x01\x1ar\n\x1cSynthesizeSpeechConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.google.cloud.dialogflow.v2.SynthesizeSpeechConfig:\x02\x38\x01\"\x89\x01\n\x17ListEnvironmentsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Environment\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\"r\n\x18ListEnvironmentsResponse\x12=\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.v2.Environment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x15GetEnvironmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"\xb9\x01\n\x18\x43reateEnvironmentRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Environment\x12\x41\n\x0b\x65nvironment\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.EnvironmentB\x03\xe0\x41\x02\x12\x1b\n\x0e\x65nvironment_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xc9\x01\n\x18UpdateEnvironmentRequest\x12\x41\n\x0b\x65nvironment\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.EnvironmentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x34\n\'allow_load_to_draft_and_discard_changes\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"W\n\x18\x44\x65leteEnvironmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\"\x8e\x01\n\x1cGetEnvironmentHistoryRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Environment\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\"\xf9\x01\n\x12\x45nvironmentHistory\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12J\n\x07\x65ntries\x18\x02 \x03(\x0b\x32\x34.google.cloud.dialogflow.v2.EnvironmentHistory.EntryB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x03 \x01(\tB\x03\xe0\x41\x03\x1a\x64\n\x05\x45ntry\x12\x15\n\ragent_version\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xcb\x0c\n\x0c\x45nvironments\x12\xf4\x01\n\x10ListEnvironments\x12\x33.google.cloud.dialogflow.v2.ListEnvironmentsRequest\x1a\x34.google.cloud.dialogflow.v2.ListEnvironmentsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v2/{parent=projects/*/agent}/environmentsZ8\x12\x36/v2/{parent=projects/*/locations/*/agent}/environments\x12\xda\x01\n\x0eGetEnvironment\x12\x31.google.cloud.dialogflow.v2.GetEnvironmentRequest\x1a\'.google.cloud.dialogflow.v2.Environment\"l\x82\xd3\xe4\x93\x02\x66\x12*/v2/{name=projects/*/agent/environments/*}Z8\x12\x36/v2/{name=projects/*/locations/*/agent/environments/*}\x12\xfc\x01\n\x11\x43reateEnvironment\x12\x34.google.cloud.dialogflow.v2.CreateEnvironmentRequest\x1a\'.google.cloud.dialogflow.v2.Environment\"\x87\x01\x82\xd3\xe4\x93\x02\x80\x01\"*/v2/{parent=projects/*/agent}/environments:\x0b\x65nvironmentZE\"6/v2/{parent=projects/*/locations/*/agent}/environments:\x0b\x65nvironment\x12\x94\x02\n\x11UpdateEnvironment\x12\x34.google.cloud.dialogflow.v2.UpdateEnvironmentRequest\x1a\'.google.cloud.dialogflow.v2.Environment\"\x9f\x01\x82\xd3\xe4\x93\x02\x98\x01\x32\x36/v2/{environment.name=projects/*/agent/environments/*}:\x0b\x65nvironmentZQ2B/v2/{environment.name=projects/*/locations/*/agent/environments/*}:\x0b\x65nvironment\x12\xcf\x01\n\x11\x44\x65leteEnvironment\x12\x34.google.cloud.dialogflow.v2.DeleteEnvironmentRequest\x1a\x16.google.protobuf.Empty\"l\x82\xd3\xe4\x93\x02\x66**/v2/{name=projects/*/agent/environments/*}Z8*6/v2/{name=projects/*/locations/*/agent/environments/*}\x12\x84\x02\n\x15GetEnvironmentHistory\x12\x38.google.cloud.dialogflow.v2.GetEnvironmentHistoryRequest\x1a..google.cloud.dialogflow.v2.EnvironmentHistory\"\x80\x01\x82\xd3\xe4\x93\x02z\x12\x34/v2/{parent=projects/*/agent/environments/*}/historyZB\x12@/v2/{parent=projects/*/locations/*/agent/environments/*}/history\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x10\x45nvironmentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Environment").msgclass - Environment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Environment.State").enummodule - TextToSpeechSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TextToSpeechSettings").msgclass - ListEnvironmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEnvironmentsRequest").msgclass - ListEnvironmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEnvironmentsResponse").msgclass - GetEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEnvironmentRequest").msgclass - CreateEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateEnvironmentRequest").msgclass - UpdateEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateEnvironmentRequest").msgclass - DeleteEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteEnvironmentRequest").msgclass - GetEnvironmentHistoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEnvironmentHistoryRequest").msgclass - EnvironmentHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EnvironmentHistory").msgclass - EnvironmentHistory::Entry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EnvironmentHistory.Entry").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_services_pb.rb deleted file mode 100644 index 3895fb82706e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +++ /dev/null @@ -1,66 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/environment.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/environment_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Environments - # Service for managing [Environments][google.cloud.dialogflow.v2.Environment]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Environments' - - # Returns the list of all non-default environments of the specified agent. - rpc :ListEnvironments, ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse - # Retrieves the specified agent environment. - rpc :GetEnvironment, ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment - # Creates an agent environment. - rpc :CreateEnvironment, ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment - # Updates the specified agent environment. - # - # This method allows you to deploy new agent versions into the environment. - # When an environment is pointed to a new agent version by setting - # `environment.agent_version`, the environment is temporarily set to the - # `LOADING` state. During that time, the environment continues serving the - # previous version of the agent. After the new agent version is done loading, - # the environment is set back to the `RUNNING` state. - # You can use "-" as Environment ID in environment name to update an agent - # version in the default environment. WARNING: this will negate all recent - # changes to the draft agent and can't be undone. You may want to save the - # draft agent to a version before calling this method. - rpc :UpdateEnvironment, ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment - # Deletes the specified agent environment. - rpc :DeleteEnvironment, ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, ::Google::Protobuf::Empty - # Gets the history of the specified environment. - rpc :GetEnvironmentHistory, ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, ::Google::Cloud::Dialogflow::V2::EnvironmentHistory - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments.rb deleted file mode 100644 index 2f0d27fc0206..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/environments/credentials" -require "google/cloud/dialogflow/v2/environments/paths" -require "google/cloud/dialogflow/v2/environments/client" -require "google/cloud/dialogflow/v2/environments/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Environment Environments}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/environments" - # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/environments/rest" - # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new - # - module Environments - end - end - end - end -end - -helper_path = ::File.join __dir__, "environments", "helpers.rb" -require "google/cloud/dialogflow/v2/environments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb deleted file mode 100644 index c8885f83f50e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/client.rb +++ /dev/null @@ -1,1030 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/environment_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Environments - ## - # Client for the Environments service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Environment Environments}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :environments_stub - - ## - # Configure the Environments Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Environments::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Environments clients - # ::Google::Cloud::Dialogflow::V2::Environments::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Environments 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::Dialogflow::V2::Environments::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 - @environments_stub.universe_domain - end - - ## - # Create a new Environments client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Environments 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/dialogflow/v2/environment_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 - - @environments_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Environments::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 - ) - - @environments_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 = @environments_stub.endpoint - config.universe_domain = @environments_stub.universe_domain - config.logger = @environments_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 - @environments_stub.logger - end - - # Service calls - - ## - # Returns the list of all non-default environments of the specified agent. - # - # @overload list_environments(request, options = nil) - # Pass arguments to `list_environments` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_environments` via keyword arguments. Note that at - # least one keyword argument is 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 agent to list all environments from. - # Format: - # - # - `projects//agent` - # - `projects//locations//agent` - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Environment>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Environment>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.new - # - # # Call the list_environments method. - # result = client.list_environments 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::Dialogflow::V2::Environment. - # p item - # end - # - def list_environments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest - - # Converts hash and nil to 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_environments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_environments.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_environments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :list_environments, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @environments_stub, :list_environments, 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 - - ## - # Retrieves the specified agent environment. - # - # @overload get_environment(request, options = nil) - # Pass arguments to `get_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment(name: nil) - # Pass arguments to `get_environment` via keyword arguments. Note that at - # least one keyword argument is required. To 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 environment. - # Supported formats: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new - # - # # Call the get_environment method. - # result = client.get_environment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. - # p result - # - def get_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest - - # Converts hash and nil to 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_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_environment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :get_environment, 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 an agent environment. - # - # @overload create_environment(request, options = nil) - # Pass arguments to `create_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment(parent: nil, environment: nil, environment_id: nil) - # Pass arguments to `create_environment` via keyword arguments. Note that at - # least one keyword argument is 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 agent to create an environment for. - # Supported formats: - # - # - `projects//agent` - # - `projects//locations//agent` - # @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash] - # Required. The environment to create. - # @param environment_id [::String] - # Required. The unique id of the new environment. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new - # - # # Call the create_environment method. - # result = client.create_environment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. - # p result - # - def create_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest - - # Converts hash and nil to 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_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_environment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :create_environment, 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 the specified agent environment. - # - # This method allows you to deploy new agent versions into the environment. - # When an environment is pointed to a new agent version by setting - # `environment.agent_version`, the environment is temporarily set to the - # `LOADING` state. During that time, the environment continues serving the - # previous version of the agent. After the new agent version is done loading, - # the environment is set back to the `RUNNING` state. - # You can use "-" as Environment ID in environment name to update an agent - # version in the default environment. WARNING: this will negate all recent - # changes to the draft agent and can't be undone. You may want to save the - # draft agent to a version before calling this method. - # - # @overload update_environment(request, options = nil) - # Pass arguments to `update_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment(environment: nil, update_mask: nil, allow_load_to_draft_and_discard_changes: nil) - # Pass arguments to `update_environment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash] - # Required. The environment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. - # @param allow_load_to_draft_and_discard_changes [::Boolean] - # Optional. This field is used to prevent accidental overwrite of the default - # environment, which is an operation that cannot be undone. To confirm that - # the caller desires this overwrite, this field must be explicitly set to - # true when updating the default environment (environment ID = `-`). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new - # - # # Call the update_environment method. - # result = client.update_environment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. - # p result - # - def update_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest - - # Converts hash and nil to 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_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.environment&.name - header_params["environment.name"] = request.environment.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_environment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :update_environment, 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 specified agent environment. - # - # @overload delete_environment(request, options = nil) - # Pass arguments to `delete_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment(name: nil) - # Pass arguments to `delete_environment` via keyword arguments. Note that at - # least one keyword argument is required. To 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 environment to delete. - # / Format: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new - # - # # Call the delete_environment method. - # result = client.delete_environment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest - - # Converts hash and nil to 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_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_environment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :delete_environment, 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 history of the specified environment. - # - # @overload get_environment_history(request, options = nil) - # Pass arguments to `get_environment_history` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment_history(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `get_environment_history` via keyword arguments. Note that at - # least one keyword argument is 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 name of the environment to retrieve history for. - # Supported formats: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.new - # - # # Call the get_environment_history method. - # result = client.get_environment_history 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::Dialogflow::V2::EnvironmentHistory::Entry. - # p item - # end - # - def get_environment_history request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest - - # Converts hash and nil to 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_environment_history.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.get_environment_history.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_environment_history.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.call_rpc :get_environment_history, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @environments_stub, :get_environment_history, 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 Environments API. - # - # This class represents the configuration for Environments, - # 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::Dialogflow::V2::Environments::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_environments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Environments::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_environments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_environments.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::Dialogflow::V2::Environments::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Environments 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_environments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_environments - ## - # RPC-specific configuration for `get_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_environment - ## - # RPC-specific configuration for `create_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_environment - ## - # RPC-specific configuration for `update_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_environment - ## - # RPC-specific configuration for `delete_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_environment - ## - # RPC-specific configuration for `get_environment_history` - # @return [::Gapic::Config::Method] - # - attr_reader :get_environment_history - - # @private - def initialize parent_rpcs = nil - list_environments_config = parent_rpcs.list_environments if parent_rpcs.respond_to? :list_environments - @list_environments = ::Gapic::Config::Method.new list_environments_config - get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment - @get_environment = ::Gapic::Config::Method.new get_environment_config - create_environment_config = parent_rpcs.create_environment if parent_rpcs.respond_to? :create_environment - @create_environment = ::Gapic::Config::Method.new create_environment_config - update_environment_config = parent_rpcs.update_environment if parent_rpcs.respond_to? :update_environment - @update_environment = ::Gapic::Config::Method.new update_environment_config - delete_environment_config = parent_rpcs.delete_environment if parent_rpcs.respond_to? :delete_environment - @delete_environment = ::Gapic::Config::Method.new delete_environment_config - get_environment_history_config = parent_rpcs.get_environment_history if parent_rpcs.respond_to? :get_environment_history - @get_environment_history = ::Gapic::Config::Method.new get_environment_history_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/credentials.rb deleted file mode 100644 index 2e833d4db565..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Environments - # Credentials for the Environments API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/paths.rb deleted file mode 100644 index 82076cf3d5ea..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/paths.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! - - -module Google - module Cloud - module Dialogflow - module V2 - module Environments - # Path helper methods for the Environments API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # @overload agent_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/agent` - # - # @param project [String] - # - # @overload agent_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def agent_path **args - resources = { - "project" => (proc do |project:| - "projects/#{project}/agent" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent" - 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 Environment resource string. - # - # @overload environment_path(project:, environment:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}` - # - # @param project [String] - # @param environment [String] - # - # @overload environment_path(project:, location:, environment:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # - # @return [::String] - def environment_path **args - resources = { - "environment:project" => (proc do |project:, environment:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}" - end), - "environment:location:project" => (proc do |project:, location:, environment:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}" - 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 Fulfillment resource string. - # - # @overload fulfillment_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/agent/fulfillment` - # - # @param project [String] - # - # @overload fulfillment_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/fulfillment` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def fulfillment_path **args - resources = { - "project" => (proc do |project:| - "projects/#{project}/agent/fulfillment" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/fulfillment" - 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 Version resource string. - # - # @overload version_path(project:, version:) - # The resource will be in the following format: - # - # `projects/{project}/agent/versions/{version}` - # - # @param project [String] - # @param version [String] - # - # @overload version_path(project:, location:, version:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/versions/{version}` - # - # @param project [String] - # @param location [String] - # @param version [String] - # - # @return [::String] - def version_path **args - resources = { - "project:version" => (proc do |project:, version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/agent/versions/#{version}" - end), - "location:project:version" => (proc do |project:, location:, version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/versions/#{version}" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest.rb deleted file mode 100644 index 59ab86f00835..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/environments/credentials" -require "google/cloud/dialogflow/v2/environments/paths" -require "google/cloud/dialogflow/v2/environments/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Environment Environments}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/environments/rest" - # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new - # - module Environments - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/environments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb deleted file mode 100644 index 33b80aefcd54..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +++ /dev/null @@ -1,953 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/environment_pb" -require "google/cloud/dialogflow/v2/environments/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Environments - module Rest - ## - # REST client for the Environments service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Environment Environments}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :environments_stub - - ## - # Configure the Environments Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Environments::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Environments clients - # ::Google::Cloud::Dialogflow::V2::Environments::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Environments 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::Dialogflow::V2::Environments::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 - @environments_stub.universe_domain - end - - ## - # Create a new Environments REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Environments 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 - - @environments_stub = ::Google::Cloud::Dialogflow::V2::Environments::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @environments_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 = @environments_stub.endpoint - config.universe_domain = @environments_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @environments_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 - @environments_stub.logger - end - - # Service calls - - ## - # Returns the list of all non-default environments of the specified agent. - # - # @overload list_environments(request, options = nil) - # Pass arguments to `list_environments` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environments(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_environments` via keyword arguments. Note that at - # least one keyword argument is 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 agent to list all environments from. - # Format: - # - # - `projects//agent` - # - `projects//locations//agent` - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Environment>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Environment>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.new - # - # # Call the list_environments method. - # result = client.list_environments 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::Dialogflow::V2::Environment. - # p item - # end - # - def list_environments request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest - - # Converts hash and nil to an 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_environments.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_environments.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_environments.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.list_environments request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :list_environments, "environments", 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 - - ## - # Retrieves the specified agent environment. - # - # @overload get_environment(request, options = nil) - # Pass arguments to `get_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment(name: nil) - # Pass arguments to `get_environment` via keyword arguments. Note that at - # least one keyword argument is required. To 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 environment. - # Supported formats: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new - # - # # Call the get_environment method. - # result = client.get_environment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. - # p result - # - def get_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest - - # Converts hash and nil to an 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_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_environment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.get_environment 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 an agent environment. - # - # @overload create_environment(request, options = nil) - # Pass arguments to `create_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment(parent: nil, environment: nil, environment_id: nil) - # Pass arguments to `create_environment` via keyword arguments. Note that at - # least one keyword argument is 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 agent to create an environment for. - # Supported formats: - # - # - `projects//agent` - # - `projects//locations//agent` - # @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash] - # Required. The environment to create. - # @param environment_id [::String] - # Required. The unique id of the new environment. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new - # - # # Call the create_environment method. - # result = client.create_environment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. - # p result - # - def create_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest - - # Converts hash and nil to an 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_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_environment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.create_environment 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 the specified agent environment. - # - # This method allows you to deploy new agent versions into the environment. - # When an environment is pointed to a new agent version by setting - # `environment.agent_version`, the environment is temporarily set to the - # `LOADING` state. During that time, the environment continues serving the - # previous version of the agent. After the new agent version is done loading, - # the environment is set back to the `RUNNING` state. - # You can use "-" as Environment ID in environment name to update an agent - # version in the default environment. WARNING: this will negate all recent - # changes to the draft agent and can't be undone. You may want to save the - # draft agent to a version before calling this method. - # - # @overload update_environment(request, options = nil) - # Pass arguments to `update_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment(environment: nil, update_mask: nil, allow_load_to_draft_and_discard_changes: nil) - # Pass arguments to `update_environment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash] - # Required. The environment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. - # @param allow_load_to_draft_and_discard_changes [::Boolean] - # Optional. This field is used to prevent accidental overwrite of the default - # environment, which is an operation that cannot be undone. To confirm that - # the caller desires this overwrite, this field must be explicitly set to - # true when updating the default environment (environment ID = `-`). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new - # - # # Call the update_environment method. - # result = client.update_environment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. - # p result - # - def update_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest - - # Converts hash and nil to an 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_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_environment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.update_environment 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 specified agent environment. - # - # @overload delete_environment(request, options = nil) - # Pass arguments to `delete_environment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment(name: nil) - # Pass arguments to `delete_environment` via keyword arguments. Note that at - # least one keyword argument is required. To 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 environment to delete. - # / Format: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new - # - # # Call the delete_environment method. - # result = client.delete_environment request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_environment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest - - # Converts hash and nil to an 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_environment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_environment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_environment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.delete_environment 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 history of the specified environment. - # - # @overload get_environment_history(request, options = nil) - # Pass arguments to `get_environment_history` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_environment_history(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `get_environment_history` via keyword arguments. Note that at - # least one keyword argument is 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 name of the environment to retrieve history for. - # Supported formats: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.new - # - # # Call the get_environment_history method. - # result = client.get_environment_history 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::Dialogflow::V2::EnvironmentHistory::Entry. - # p item - # end - # - def get_environment_history request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest - - # Converts hash and nil to an 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_environment_history.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_environment_history.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_environment_history.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @environments_stub.get_environment_history request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @environments_stub, :get_environment_history, "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 - - ## - # Configuration class for the Environments REST API. - # - # This class represents the configuration for Environments 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::Dialogflow::V2::Environments::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_environments to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_environments.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_environments.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Environments 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_environments` - # @return [::Gapic::Config::Method] - # - attr_reader :list_environments - ## - # RPC-specific configuration for `get_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_environment - ## - # RPC-specific configuration for `create_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :create_environment - ## - # RPC-specific configuration for `update_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_environment - ## - # RPC-specific configuration for `delete_environment` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_environment - ## - # RPC-specific configuration for `get_environment_history` - # @return [::Gapic::Config::Method] - # - attr_reader :get_environment_history - - # @private - def initialize parent_rpcs = nil - list_environments_config = parent_rpcs.list_environments if parent_rpcs.respond_to? :list_environments - @list_environments = ::Gapic::Config::Method.new list_environments_config - get_environment_config = parent_rpcs.get_environment if parent_rpcs.respond_to? :get_environment - @get_environment = ::Gapic::Config::Method.new get_environment_config - create_environment_config = parent_rpcs.create_environment if parent_rpcs.respond_to? :create_environment - @create_environment = ::Gapic::Config::Method.new create_environment_config - update_environment_config = parent_rpcs.update_environment if parent_rpcs.respond_to? :update_environment - @update_environment = ::Gapic::Config::Method.new update_environment_config - delete_environment_config = parent_rpcs.delete_environment if parent_rpcs.respond_to? :delete_environment - @delete_environment = ::Gapic::Config::Method.new delete_environment_config - get_environment_history_config = parent_rpcs.get_environment_history if parent_rpcs.respond_to? :get_environment_history - @get_environment_history = ::Gapic::Config::Method.new get_environment_history_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb deleted file mode 100644 index eeb22574d802..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb +++ /dev/null @@ -1,493 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/environment_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Environments - module Rest - ## - # REST service stub for the Environments 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_environments REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListEnvironmentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse] - # A result object deserialized from the server's reply - def list_environments request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_environments_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_environments", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse.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_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # A result object deserialized from the server's reply - def get_environment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_environment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_environment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Environment.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_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # A result object deserialized from the server's reply - def create_environment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_environment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_environment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Environment.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_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Environment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # A result object deserialized from the server's reply - def update_environment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_environment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_environment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Environment.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_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_environment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_environment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_environment", - 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 get_environment_history REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::EnvironmentHistory] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::EnvironmentHistory] - # A result object deserialized from the server's reply - def get_environment_history request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_environment_history_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_environment_history", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::EnvironmentHistory.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_environments REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest] - # 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_environments_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/environments", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/environments", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest] - # 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_environment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest] - # 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_environment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/environments", - body: "environment", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/environments", - body: "environment", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest] - # 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_environment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{environment.name}", - body: "environment", - matches: [ - ["environment.name", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{environment.name}", - body: "environment", - matches: [ - ["environment.name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_environment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest] - # 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_environment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_environment_history REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest] - # 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_environment_history_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/history", - matches: [ - ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/history", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb deleted file mode 100644 index 43fbece088dd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/fulfillment.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/protobuf/field_mask_pb' - - -descriptor_data = "\n,google/cloud/dialogflow/v2/fulfillment.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xa9\x06\n\x0b\x46ulfillment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12X\n\x13generic_web_service\x18\x03 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Fulfillment.GenericWebServiceH\x00\x12\x14\n\x07\x65nabled\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x46\n\x08\x66\x65\x61tures\x18\x05 \x03(\x0b\x32/.google.cloud.dialogflow.v2.Fulfillment.FeatureB\x03\xe0\x41\x01\x1a\x99\x02\n\x11GenericWebService\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08username\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08password\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12k\n\x0frequest_headers\x18\x04 \x03(\x0b\x32M.google.cloud.dialogflow.v2.Fulfillment.GenericWebService.RequestHeadersEntryB\x03\xe0\x41\x01\x12 \n\x11is_cloud_function\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x1a\x35\n\x13RequestHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1az\n\x07\x46\x65\x61ture\x12\x42\n\x04type\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.v2.Fulfillment.Feature.Type\"+\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSMALLTALK\x10\x01:\x8c\x01\xea\x41\x88\x01\n%dialogflow.googleapis.com/Fulfillment\x12$projects/{project}/agent/fulfillment\x12\x39projects/{project}/locations/{location}/agent/fulfillmentB\r\n\x0b\x66ulfillment\"T\n\x15GetFulfillmentRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Fulfillment\"\x93\x01\n\x18UpdateFulfillmentRequest\x12\x41\n\x0b\x66ulfillment\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.FulfillmentB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x32\x91\x05\n\x0c\x46ulfillments\x12\xdb\x01\n\x0eGetFulfillment\x12\x31.google.cloud.dialogflow.v2.GetFulfillmentRequest\x1a\'.google.cloud.dialogflow.v2.Fulfillment\"m\xda\x41\x04name\x82\xd3\xe4\x93\x02`\x12\'/v2/{name=projects/*/agent/fulfillment}Z5\x12\x33/v2/{name=projects/*/locations/*/agent/fulfillment}\x12\xa8\x02\n\x11UpdateFulfillment\x12\x34.google.cloud.dialogflow.v2.UpdateFulfillmentRequest\x1a\'.google.cloud.dialogflow.v2.Fulfillment\"\xb3\x01\xda\x41\x17\x66ulfillment,update_mask\x82\xd3\xe4\x93\x02\x92\x01\x32\x33/v2/{fulfillment.name=projects/*/agent/fulfillment}:\x0b\x66ulfillmentZN2?/v2/{fulfillment.name=projects/*/locations/*/agent/fulfillment}:\x0b\x66ulfillment\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x10\x46ulfillmentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - Fulfillment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Fulfillment").msgclass - Fulfillment::GenericWebService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Fulfillment.GenericWebService").msgclass - Fulfillment::Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Fulfillment.Feature").msgclass - Fulfillment::Feature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Fulfillment.Feature.Type").enummodule - GetFulfillmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetFulfillmentRequest").msgclass - UpdateFulfillmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateFulfillmentRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb deleted file mode 100644 index 478ae0407689..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/fulfillment.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/fulfillment_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Fulfillments - # Service for managing [Fulfillments][google.cloud.dialogflow.v2.Fulfillment]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Fulfillments' - - # Retrieves the fulfillment. - rpc :GetFulfillment, ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest, ::Google::Cloud::Dialogflow::V2::Fulfillment - # Updates the fulfillment. - rpc :UpdateFulfillment, ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest, ::Google::Cloud::Dialogflow::V2::Fulfillment - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments.rb deleted file mode 100644 index 6a596099d8e7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/fulfillments/credentials" -require "google/cloud/dialogflow/v2/fulfillments/paths" -require "google/cloud/dialogflow/v2/fulfillments/client" -require "google/cloud/dialogflow/v2/fulfillments/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Fulfillment Fulfillments}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/fulfillments" - # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/fulfillments/rest" - # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new - # - module Fulfillments - end - end - end - end -end - -helper_path = ::File.join __dir__, "fulfillments", "helpers.rb" -require "google/cloud/dialogflow/v2/fulfillments/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb deleted file mode 100644 index 38826423c123..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +++ /dev/null @@ -1,593 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/fulfillment_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Fulfillments - ## - # Client for the Fulfillments service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Fulfillment Fulfillments}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :fulfillments_stub - - ## - # Configure the Fulfillments Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Fulfillments::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Fulfillments clients - # ::Google::Cloud::Dialogflow::V2::Fulfillments::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Fulfillments 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::Dialogflow::V2::Fulfillments::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 - @fulfillments_stub.universe_domain - end - - ## - # Create a new Fulfillments client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Fulfillments 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/dialogflow/v2/fulfillment_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 - - @fulfillments_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Fulfillments::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 - ) - - @fulfillments_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 = @fulfillments_stub.endpoint - config.universe_domain = @fulfillments_stub.universe_domain - config.logger = @fulfillments_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 - @fulfillments_stub.logger - end - - # Service calls - - ## - # Retrieves the fulfillment. - # - # @overload get_fulfillment(request, options = nil) - # Pass arguments to `get_fulfillment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_fulfillment(name: nil) - # Pass arguments to `get_fulfillment` via keyword arguments. Note that at - # least one keyword argument is required. To 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 fulfillment. - # Format: `projects//agent/fulfillment`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Fulfillment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new - # - # # Call the get_fulfillment method. - # result = client.get_fulfillment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. - # p result - # - def get_fulfillment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest - - # Converts hash and nil to 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_fulfillment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_fulfillment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_fulfillment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @fulfillments_stub.call_rpc :get_fulfillment, 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 the fulfillment. - # - # @overload update_fulfillment(request, options = nil) - # Pass arguments to `update_fulfillment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_fulfillment(fulfillment: nil, update_mask: nil) - # Pass arguments to `update_fulfillment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param fulfillment [::Google::Cloud::Dialogflow::V2::Fulfillment, ::Hash] - # Required. The fulfillment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. If the mask is not - # present, all fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Fulfillment] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new - # - # # Call the update_fulfillment method. - # result = client.update_fulfillment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. - # p result - # - def update_fulfillment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest - - # Converts hash and nil to 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_fulfillment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.fulfillment&.name - header_params["fulfillment.name"] = request.fulfillment.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_fulfillment.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_fulfillment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @fulfillments_stub.call_rpc :update_fulfillment, 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 Fulfillments API. - # - # This class represents the configuration for Fulfillments, - # 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::Dialogflow::V2::Fulfillments::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_fulfillment to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_fulfillment.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_fulfillment.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::Dialogflow::V2::Fulfillments::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Fulfillments 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_fulfillment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_fulfillment - ## - # RPC-specific configuration for `update_fulfillment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_fulfillment - - # @private - def initialize parent_rpcs = nil - get_fulfillment_config = parent_rpcs.get_fulfillment if parent_rpcs.respond_to? :get_fulfillment - @get_fulfillment = ::Gapic::Config::Method.new get_fulfillment_config - update_fulfillment_config = parent_rpcs.update_fulfillment if parent_rpcs.respond_to? :update_fulfillment - @update_fulfillment = ::Gapic::Config::Method.new update_fulfillment_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb deleted file mode 100644 index ec29602e876d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Fulfillments - # Credentials for the Fulfillments API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb deleted file mode 100644 index 3b691fac79cd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module Fulfillments - # Path helper methods for the Fulfillments API. - module Paths - ## - # Create a fully-qualified Fulfillment resource string. - # - # @overload fulfillment_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/agent/fulfillment` - # - # @param project [String] - # - # @overload fulfillment_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/fulfillment` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def fulfillment_path **args - resources = { - "project" => (proc do |project:| - "projects/#{project}/agent/fulfillment" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/fulfillment" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest.rb deleted file mode 100644 index d4aec855ef6f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/fulfillments/credentials" -require "google/cloud/dialogflow/v2/fulfillments/paths" -require "google/cloud/dialogflow/v2/fulfillments/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Fulfillment Fulfillments}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/fulfillments/rest" - # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new - # - module Fulfillments - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/fulfillments/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb deleted file mode 100644 index 9afa329971e3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +++ /dev/null @@ -1,544 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/fulfillment_pb" -require "google/cloud/dialogflow/v2/fulfillments/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Fulfillments - module Rest - ## - # REST client for the Fulfillments service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Fulfillment Fulfillments}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :fulfillments_stub - - ## - # Configure the Fulfillments Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Fulfillments clients - # ::Google::Cloud::Dialogflow::V2::Fulfillments::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Fulfillments 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::Dialogflow::V2::Fulfillments::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 - @fulfillments_stub.universe_domain - end - - ## - # Create a new Fulfillments REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Fulfillments 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 - - @fulfillments_stub = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @fulfillments_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 = @fulfillments_stub.endpoint - config.universe_domain = @fulfillments_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @fulfillments_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 - @fulfillments_stub.logger - end - - # Service calls - - ## - # Retrieves the fulfillment. - # - # @overload get_fulfillment(request, options = nil) - # Pass arguments to `get_fulfillment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_fulfillment(name: nil) - # Pass arguments to `get_fulfillment` via keyword arguments. Note that at - # least one keyword argument is required. To 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 fulfillment. - # Format: `projects//agent/fulfillment`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Fulfillment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new - # - # # Call the get_fulfillment method. - # result = client.get_fulfillment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. - # p result - # - def get_fulfillment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest - - # Converts hash and nil to an 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_fulfillment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_fulfillment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_fulfillment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @fulfillments_stub.get_fulfillment 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 the fulfillment. - # - # @overload update_fulfillment(request, options = nil) - # Pass arguments to `update_fulfillment` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_fulfillment(fulfillment: nil, update_mask: nil) - # Pass arguments to `update_fulfillment` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param fulfillment [::Google::Cloud::Dialogflow::V2::Fulfillment, ::Hash] - # Required. The fulfillment to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. If the mask is not - # present, all fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Fulfillment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new - # - # # Call the update_fulfillment method. - # result = client.update_fulfillment request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. - # p result - # - def update_fulfillment request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest - - # Converts hash and nil to an 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_fulfillment.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_fulfillment.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_fulfillment.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @fulfillments_stub.update_fulfillment 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 Fulfillments REST API. - # - # This class represents the configuration for Fulfillments 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::Dialogflow::V2::Fulfillments::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_fulfillment to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_fulfillment.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_fulfillment.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Fulfillments 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `get_fulfillment` - # @return [::Gapic::Config::Method] - # - attr_reader :get_fulfillment - ## - # RPC-specific configuration for `update_fulfillment` - # @return [::Gapic::Config::Method] - # - attr_reader :update_fulfillment - - # @private - def initialize parent_rpcs = nil - get_fulfillment_config = parent_rpcs.get_fulfillment if parent_rpcs.respond_to? :get_fulfillment - @get_fulfillment = ::Gapic::Config::Method.new get_fulfillment_config - update_fulfillment_config = parent_rpcs.update_fulfillment if parent_rpcs.respond_to? :update_fulfillment - @update_fulfillment = ::Gapic::Config::Method.new update_fulfillment_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb deleted file mode 100644 index fbc24bbbdf5b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb +++ /dev/null @@ -1,219 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/fulfillment_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Fulfillments - module Rest - ## - # REST service stub for the Fulfillments 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_fulfillment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Fulfillment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] - # A result object deserialized from the server's reply - def get_fulfillment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_fulfillment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_fulfillment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Fulfillment.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_fulfillment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Fulfillment] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] - # A result object deserialized from the server's reply - def update_fulfillment request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_fulfillment_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_fulfillment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Fulfillment.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_fulfillment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest] - # 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_fulfillment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/fulfillment/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/fulfillment/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_fulfillment REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest] - # 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_fulfillment_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{fulfillment.name}", - body: "fulfillment", - matches: [ - ["fulfillment.name", %r{^projects/[^/]+/agent/fulfillment/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{fulfillment.name}", - body: "fulfillment", - matches: [ - ["fulfillment.name", %r{^projects/[^/]+/locations/[^/]+/agent/fulfillment/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/gcs_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/gcs_pb.rb deleted file mode 100644 index 84c6f949f401..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/gcs_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/gcs.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n$google/cloud/dialogflow/v2/gcs.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\"\x1f\n\nGcsSources\x12\x11\n\x04uris\x18\x02 \x03(\tB\x03\xe0\x41\x02\"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\tB\x8e\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x08GcsProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - GcsSources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GcsSources").msgclass - GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GcsDestination").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_pb.rb deleted file mode 100644 index 0d91a5f1de81..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/generator_evaluation.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/dialogflow/v2/generator_pb' -require 'google/cloud/dialogflow/v2/operations_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n5google/cloud/dialogflow/v2/generator_evaluation.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a+google/cloud/dialogflow/v2/operations.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xbd\x01\n CreateGeneratorEvaluationRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/GeneratorEvaluation\x12R\n\x14generator_evaluation\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorEvaluationB\x03\xe0\x41\x02\"d\n\x1dGetGeneratorEvaluationRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/GeneratorEvaluation\"\x99\x01\n\x1fListGeneratorEvaluationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-dialogflow.googleapis.com/GeneratorEvaluation\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\"\x8b\x01\n ListGeneratorEvaluationsResponse\x12N\n\x15generator_evaluations\x18\x01 \x03(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorEvaluation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n DeleteGeneratorEvaluationRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-dialogflow.googleapis.com/GeneratorEvaluation\"\xb7\x06\n\x13GeneratorEvaluation\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12_\n\x1bgenerator_evaluation_config\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.GeneratorEvaluationConfigB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\rcomplete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x45\n\x11initial_generator\x18\x05 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorB\x03\xe0\x41\x02\x12`\n\x15summarization_metrics\x18\x06 \x01(\x0b\x32:.google.cloud.dialogflow.v2.SummarizationEvaluationMetricsB\x03\xe0\x41\x03H\x00\x12L\n\x11\x65valuation_status\x18\n \x01(\x0b\x32,.google.cloud.dialogflow.v2.EvaluationStatusB\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzs\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03H\x02\x88\x01\x01:\xb7\x01\xea\x41\xb3\x01\n-dialogflow.googleapis.com/GeneratorEvaluation\x12Wprojects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation}*\x14generatorEvaluations2\x13generatorEvaluationB\t\n\x07metricsB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"\xa2\x17\n\x1eSummarizationEvaluationMetrics\x12\x87\x01\n summarization_evaluation_results\x18\x04 \x03(\x0b\x32X.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SummarizationEvaluationResultB\x03\xe0\x41\x03\x12\x38\n+summarization_evaluation_merged_results_uri\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12n\n\x0foverall_metrics\x18\x06 \x03(\x0b\x32P.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.OverallScoresByMetricB\x03\xe0\x41\x03\x12l\n\x16overall_section_tokens\x18\x07 \x03(\x0b\x32G.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionTokenB\x03\xe0\x41\x03\x12p\n\x14\x63onversation_details\x18\x08 \x03(\x0b\x32M.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetailB\x03\xe0\x41\x03\x1a{\n\x15\x41\x63\x63uracyDecomposition\x12\x12\n\x05point\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12\x61\x63\x63uracy_reasoning\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x0bis_accurate\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0e\n\x0c_is_accurate\x1al\n\x16\x41\x64herenceDecomposition\x12\x12\n\x05point\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12 \n\x13\x61\x64herence_reasoning\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bis_adherent\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03:\x02\x18\x01\x1aq\n\x0f\x41\x64herenceRubric\x12\x15\n\x08question\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\treasoning\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x0cis_addressed\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0f\n\r_is_addressed\x1a\\\n\x12\x43ompletenessRubric\x12\x15\n\x08question\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x0cis_addressed\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0f\n\r_is_addressed\x1a\x8e\x02\n\rDecomposition\x12r\n\x16\x61\x63\x63uracy_decomposition\x18\x01 \x01(\x0b\x32P.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecompositionH\x00\x12t\n\x17\x61\x64herence_decomposition\x18\x02 \x01(\x0b\x32Q.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceDecompositionH\x00:\x02\x18\x01\x42\x0f\n\rdecomposition\x1a\xe6\x02\n\x10\x45valuationResult\x12r\n\x16\x61\x63\x63uracy_decomposition\x18\x01 \x01(\x0b\x32P.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecompositionH\x00\x12\x66\n\x10\x61\x64herence_rubric\x18\x02 \x01(\x0b\x32J.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubricH\x00\x12l\n\x13\x63ompleteness_rubric\x18\x03 \x01(\x0b\x32M.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubricH\x00\x42\x08\n\x06result\x1a\xee\x02\n\x1dSummarizationEvaluationResult\x12\x19\n\nsession_id\x18\x01 \x01(\tB\x05\x18\x01\xe0\x41\x03\x12\x13\n\x06metric\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07section\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x12\n\x05score\x18\x04 \x01(\x02\x42\x03\xe0\x41\x03\x12\x1c\n\x0fsection_summary\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12g\n\x0e\x64\x65\x63ompositions\x18\x07 \x03(\x0b\x32H.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.DecompositionB\x05\x18\x01\xe0\x41\x03\x12l\n\x12\x65valuation_results\x18\x08 \x03(\x0b\x32K.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResultB\x03\xe0\x41\x03\x1a,\n\x15OverallScoresByMetric\x12\x13\n\x06metric\x18\x01 \x01(\tB\x03\xe0\x41\x03\x1aS\n\x0cSectionToken\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x0btoken_count\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0e\n\x0c_token_count\x1a\xc1\x06\n\x12\x43onversationDetail\x12\x46\n\x0fmessage_entries\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.MessageEntryB\x03\xe0\x41\x03\x12[\n\x10summary_sections\x18\x04 \x03(\x0b\x32<.google.cloud.dialogflow.v2.SummarySuggestion.SummarySectionB\x03\xe0\x41\x03\x12w\n\x0emetric_details\x18\x02 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetailB\x03\xe0\x41\x03\x12\x64\n\x0esection_tokens\x18\x03 \x03(\x0b\x32G.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionTokenB\x03\xe0\x41\x03\x1a\xa6\x03\n\x0cMetricDetail\x12\x13\n\x06metric\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\x05score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x86\x01\n\x0fsection_details\x18\x04 \x03(\x0b\x32h.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetailB\x03\xe0\x41\x03\x1a\xd4\x01\n\rSectionDetail\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\x05score\x18\x02 \x01(\x02\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1c\n\x0fsection_summary\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12l\n\x12\x65valuation_results\x18\x05 \x03(\x0b\x32K.google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResultB\x03\xe0\x41\x03\x42\x08\n\x06_scoreB\x08\n\x06_score\"\xbf\r\n\x19GeneratorEvaluationConfig\x12\x65\n\x11input_data_config\x18\x01 \x01(\x0b\x32\x45.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfigB\x03\xe0\x41\x02\x12#\n\x16output_gcs_bucket_path\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12i\n\x14summarization_config\x18\x03 \x01(\x0b\x32I.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.SummarizationConfigH\x00\x1a\x84\x01\n\x1a\x41gentAssistInputDataConfig\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x1a.\n\x16\x44\x61tasetInputDataConfig\x12\x14\n\x07\x64\x61taset\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\xd2\x06\n\x0fInputDataConfig\x12p\n\x16input_data_source_type\x18\x01 \x01(\x0e\x32I.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataSourceTypeB\x05\x18\x01\xe0\x41\x02\x12\x35\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x05\x18\x01\xe0\x41\x01\x12\x33\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x05\x18\x01\xe0\x41\x01\x12\x18\n\x0bsample_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12,\n\x1dis_summary_generation_allowed\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12\x85\x01\n\x19summary_generation_option\x18\x08 \x01(\x0e\x32].google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig.SummaryGenerationOptionB\x03\xe0\x41\x01\x12z\n\x1e\x61gent_assist_input_data_config\x18\x06 \x01(\x0b\x32P.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.AgentAssistInputDataConfigH\x00\x12q\n\x19\x64\x61taset_input_data_config\x18\x07 \x01(\x0b\x32L.google.cloud.dialogflow.v2.GeneratorEvaluationConfig.DatasetInputDataConfigH\x00\"\x87\x01\n\x17SummaryGenerationOption\x12)\n%SUMMARY_GENERATION_OPTION_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x41LWAYS_GENERATE\x10\x01\x12\x17\n\x13GENERATE_IF_MISSING\x10\x02\x12\x13\n\x0f\x44O_NOT_GENERATE\x10\x03\x42\x18\n\x16source_specific_config\x1a\x86\x02\n\x13SummarizationConfig\x12)\n\x1a\x65nable_accuracy_evaluation\x18\x01 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12*\n\x1b\x61\x63\x63uracy_evaluation_version\x18\x02 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12-\n\x1e\x65nable_completeness_evaluation\x18\x03 \x01(\x08\x42\x05\x18\x01\xe0\x41\x01\x12.\n\x1f\x63ompleteness_evaluation_version\x18\x04 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12#\n\x11\x65valuator_version\x18\x05 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x14\n\x12_evaluator_version\"y\n\x13InputDataSourceType\x12&\n\"INPUT_DATA_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x1e\n\x1a\x41GENT_ASSIST_CONVERSATIONS\x10\x01\x12\x1a\n\x16INSIGHTS_CONVERSATIONS\x10\x02\x42\x1b\n\x19\x65valuation_feature_config\"e\n\x10\x45valuationStatus\x12\x16\n\x04\x64one\x18\x01 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x30\n\x0fpipeline_status\x18\x02 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x42\x07\n\x05_done2\xdb\x08\n\x14GeneratorEvaluations\x12\xcc\x02\n\x19\x43reateGeneratorEvaluation\x12<.google.cloud.dialogflow.v2.CreateGeneratorEvaluationRequest\x1a\x1d.google.longrunning.Operation\"\xd1\x01\xca\x41V\n\x13GeneratorEvaluation\x12?google.cloud.dialogflow.v2.GeneratorEvaluationOperationMetadata\xda\x41\x1bparent,generator_evaluation\x82\xd3\xe4\x93\x02T\"\x12\x12*cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - CreateGeneratorEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateGeneratorEvaluationRequest").msgclass - GetGeneratorEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetGeneratorEvaluationRequest").msgclass - ListGeneratorEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListGeneratorEvaluationsRequest").msgclass - ListGeneratorEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListGeneratorEvaluationsResponse").msgclass - DeleteGeneratorEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteGeneratorEvaluationRequest").msgclass - GeneratorEvaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluation").msgclass - SummarizationEvaluationMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics").msgclass - SummarizationEvaluationMetrics::AccuracyDecomposition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AccuracyDecomposition").msgclass - SummarizationEvaluationMetrics::AdherenceDecomposition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceDecomposition").msgclass - SummarizationEvaluationMetrics::AdherenceRubric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.AdherenceRubric").msgclass - SummarizationEvaluationMetrics::CompletenessRubric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.CompletenessRubric").msgclass - SummarizationEvaluationMetrics::Decomposition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.Decomposition").msgclass - SummarizationEvaluationMetrics::EvaluationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.EvaluationResult").msgclass - SummarizationEvaluationMetrics::SummarizationEvaluationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SummarizationEvaluationResult").msgclass - SummarizationEvaluationMetrics::OverallScoresByMetric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.OverallScoresByMetric").msgclass - SummarizationEvaluationMetrics::SectionToken = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.SectionToken").msgclass - SummarizationEvaluationMetrics::ConversationDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail").msgclass - SummarizationEvaluationMetrics::ConversationDetail::MetricDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail").msgclass - SummarizationEvaluationMetrics::ConversationDetail::MetricDetail::SectionDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationEvaluationMetrics.ConversationDetail.MetricDetail.SectionDetail").msgclass - GeneratorEvaluationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig").msgclass - GeneratorEvaluationConfig::AgentAssistInputDataConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.AgentAssistInputDataConfig").msgclass - GeneratorEvaluationConfig::DatasetInputDataConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.DatasetInputDataConfig").msgclass - GeneratorEvaluationConfig::InputDataConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig").msgclass - GeneratorEvaluationConfig::InputDataConfig::SummaryGenerationOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataConfig.SummaryGenerationOption").enummodule - GeneratorEvaluationConfig::SummarizationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.SummarizationConfig").msgclass - GeneratorEvaluationConfig::InputDataSourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationConfig.InputDataSourceType").enummodule - EvaluationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EvaluationStatus").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_services_pb.rb deleted file mode 100644 index ace1ee743f8b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluation_services_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/generator_evaluation.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/generator_evaluation_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module GeneratorEvaluations - # Service for managing generator evaluations. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.GeneratorEvaluations' - - # Creates evaluation of a generator. - rpc :CreateGeneratorEvaluation, ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest, ::Google::Longrunning::Operation - # Gets an evaluation of generator. - rpc :GetGeneratorEvaluation, ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest, ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation - # Lists evaluations of generator. - rpc :ListGeneratorEvaluations, ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest, ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse - # Deletes an evaluation of generator. - rpc :DeleteGeneratorEvaluation, ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations.rb deleted file mode 100644 index 82927e0f1cc5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/generator_evaluations/credentials" -require "google/cloud/dialogflow/v2/generator_evaluations/paths" -require "google/cloud/dialogflow/v2/generator_evaluations/operations" -require "google/cloud/dialogflow/v2/generator_evaluations/client" -require "google/cloud/dialogflow/v2/generator_evaluations/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing generator evaluations. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/generator_evaluations" - # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/generator_evaluations/rest" - # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new - # - module GeneratorEvaluations - end - end - end - end -end - -helper_path = ::File.join __dir__, "generator_evaluations", "helpers.rb" -require "google/cloud/dialogflow/v2/generator_evaluations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/client.rb deleted file mode 100644 index bc4b0d6a1f44..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/client.rb +++ /dev/null @@ -1,817 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/generator_evaluation_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module GeneratorEvaluations - ## - # Client for the GeneratorEvaluations service. - # - # Service for managing generator evaluations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :generator_evaluations_stub - - ## - # Configure the GeneratorEvaluations Client class. - # - # See {::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all GeneratorEvaluations clients - # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::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 - @generator_evaluations_stub.universe_domain - end - - ## - # Create a new GeneratorEvaluations client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the GeneratorEvaluations 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/dialogflow/v2/generator_evaluation_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 - - @generator_evaluations_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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 - ) - - @generator_evaluations_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 = @generator_evaluations_stub.endpoint - config.universe_domain = @generator_evaluations_stub.universe_domain - config.logger = @generator_evaluations_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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 - @generator_evaluations_stub.logger - end - - # Service calls - - ## - # Creates evaluation of a generator. - # - # @overload create_generator_evaluation(request, options = nil) - # Pass arguments to `create_generator_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator_evaluation(parent: nil, generator_evaluation: nil) - # Pass arguments to `create_generator_evaluation` via keyword arguments. Note that at - # least one keyword argument is 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 generator resource name. Format: - # `projects//locations//generators/` - # @param generator_evaluation [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation, ::Hash] - # Required. The generator evaluation to be created. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new - # - # # Call the create_generator_evaluation method. - # result = client.create_generator_evaluation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_generator_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest - - # Converts hash and nil to 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_generator_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_generator_evaluation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_generator_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generator_evaluations_stub.call_rpc :create_generator_evaluation, 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 an evaluation of generator. - # - # @overload get_generator_evaluation(request, options = nil) - # Pass arguments to `get_generator_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator_evaluation(name: nil) - # Pass arguments to `get_generator_evaluation` via keyword arguments. Note that at - # least one keyword argument is required. To 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 generator evaluation resource name. Format: - # `projects//locations//generators//evaluations/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new - # - # # Call the get_generator_evaluation method. - # result = client.get_generator_evaluation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::GeneratorEvaluation. - # p result - # - def get_generator_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest - - # Converts hash and nil to 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_generator_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_generator_evaluation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_generator_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generator_evaluations_stub.call_rpc :get_generator_evaluation, 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 evaluations of generator. - # - # @overload list_generator_evaluations(request, options = nil) - # Pass arguments to `list_generator_evaluations` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator_evaluations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_generator_evaluations` via keyword arguments. Note that at - # least one keyword argument is 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 generator resource name. Format: - # `projects//locations//generators/` - # Wildcard value `-` is supported on generator_id to list evaluations across - # all generators under same project. - # @param page_size [::Integer] - # Optional. Maximum number of evaluations to return in a - # single page. By default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.new - # - # # Call the list_generator_evaluations method. - # result = client.list_generator_evaluations 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::Dialogflow::V2::GeneratorEvaluation. - # p item - # end - # - def list_generator_evaluations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest - - # Converts hash and nil to 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_generator_evaluations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_generator_evaluations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_generator_evaluations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generator_evaluations_stub.call_rpc :list_generator_evaluations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @generator_evaluations_stub, :list_generator_evaluations, 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 an evaluation of generator. - # - # @overload delete_generator_evaluation(request, options = nil) - # Pass arguments to `delete_generator_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator_evaluation(name: nil) - # Pass arguments to `delete_generator_evaluation` via keyword arguments. Note that at - # least one keyword argument is required. To 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 generator evaluation resource name. Format: - # `projects//locations//generators// - # evaluations/` - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new - # - # # Call the delete_generator_evaluation method. - # result = client.delete_generator_evaluation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_generator_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest - - # Converts hash and nil to 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_generator_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_generator_evaluation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_generator_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generator_evaluations_stub.call_rpc :delete_generator_evaluation, 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 GeneratorEvaluations API. - # - # This class represents the configuration for GeneratorEvaluations, - # 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::Dialogflow::V2::GeneratorEvaluations::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_generator_evaluation to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_generator_evaluation.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_generator_evaluation.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::Dialogflow::V2::GeneratorEvaluations::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 GeneratorEvaluations 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_generator_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_generator_evaluation - ## - # RPC-specific configuration for `get_generator_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generator_evaluation - ## - # RPC-specific configuration for `list_generator_evaluations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_generator_evaluations - ## - # RPC-specific configuration for `delete_generator_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_generator_evaluation - - # @private - def initialize parent_rpcs = nil - create_generator_evaluation_config = parent_rpcs.create_generator_evaluation if parent_rpcs.respond_to? :create_generator_evaluation - @create_generator_evaluation = ::Gapic::Config::Method.new create_generator_evaluation_config - get_generator_evaluation_config = parent_rpcs.get_generator_evaluation if parent_rpcs.respond_to? :get_generator_evaluation - @get_generator_evaluation = ::Gapic::Config::Method.new get_generator_evaluation_config - list_generator_evaluations_config = parent_rpcs.list_generator_evaluations if parent_rpcs.respond_to? :list_generator_evaluations - @list_generator_evaluations = ::Gapic::Config::Method.new list_generator_evaluations_config - delete_generator_evaluation_config = parent_rpcs.delete_generator_evaluation if parent_rpcs.respond_to? :delete_generator_evaluation - @delete_generator_evaluation = ::Gapic::Config::Method.new delete_generator_evaluation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/credentials.rb deleted file mode 100644 index 95e71680bf96..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module GeneratorEvaluations - # Credentials for the GeneratorEvaluations API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/operations.rb deleted file mode 100644 index bd204efd8fd2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module GeneratorEvaluations - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the GeneratorEvaluations 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 GeneratorEvaluations 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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb deleted file mode 100644 index 35ff8fdd4622..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/paths.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! - - -module Google - module Cloud - module Dialogflow - module V2 - module GeneratorEvaluations - # Path helper methods for the GeneratorEvaluations API. - module Paths - ## - # Create a fully-qualified App resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # - # @return [::String] - def app_path project:, location:, app: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}" - end - - ## - # Create a fully-qualified Generator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/generators/{generator}` - # - # @param project [String] - # @param location [String] - # @param generator [String] - # - # @return [::String] - def generator_path project:, location:, generator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/generators/#{generator}" - end - - ## - # Create a fully-qualified GeneratorEvaluation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation}` - # - # @param project [String] - # @param location [String] - # @param generator [String] - # @param evaluation [String] - # - # @return [::String] - def generator_evaluation_path project:, location:, generator:, evaluation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "generator cannot contain /" if generator.to_s.include? "/" - - "projects/#{project}/locations/#{location}/generators/#{generator}/evaluations/#{evaluation}" - end - - ## - # Create a fully-qualified Tool resource string. - # - # @overload tool_path(project:, location:, tool:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param tool [String] - # - # @overload tool_path(project:, location:, app:, tool:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # @param tool [String] - # - # @return [::String] - def tool_path **args - resources = { - "location:project:tool" => (proc do |project:, location:, tool:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/tools/#{tool}" - end), - "app:location:project:tool" => (proc do |project:, location:, app:, tool:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}" - 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 Toolset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # @param toolset [String] - # - # @return [::String] - def toolset_path project:, location:, app:, toolset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest.rb deleted file mode 100644 index 6ab5134a9bff..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/generator_evaluations/credentials" -require "google/cloud/dialogflow/v2/generator_evaluations/paths" -require "google/cloud/dialogflow/v2/generator_evaluations/rest/operations" -require "google/cloud/dialogflow/v2/generator_evaluations/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing generator evaluations. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/generator_evaluations/rest" - # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new - # - module GeneratorEvaluations - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/generator_evaluations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/client.rb deleted file mode 100644 index c4e20ba5da57..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/client.rb +++ /dev/null @@ -1,754 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/generator_evaluation_pb" -require "google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module GeneratorEvaluations - module Rest - ## - # REST client for the GeneratorEvaluations service. - # - # Service for managing generator evaluations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :generator_evaluations_stub - - ## - # Configure the GeneratorEvaluations Client class. - # - # See {::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all GeneratorEvaluations clients - # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::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 - @generator_evaluations_stub.universe_domain - end - - ## - # Create a new GeneratorEvaluations REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::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 - - @generator_evaluations_stub = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @generator_evaluations_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 = @generator_evaluations_stub.endpoint - config.universe_domain = @generator_evaluations_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @generator_evaluations_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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 - @generator_evaluations_stub.logger - end - - # Service calls - - ## - # Creates evaluation of a generator. - # - # @overload create_generator_evaluation(request, options = nil) - # Pass arguments to `create_generator_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator_evaluation(parent: nil, generator_evaluation: nil) - # Pass arguments to `create_generator_evaluation` via keyword arguments. Note that at - # least one keyword argument is 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 generator resource name. Format: - # `projects//locations//generators/` - # @param generator_evaluation [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation, ::Hash] - # Required. The generator evaluation to be created. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new - # - # # Call the create_generator_evaluation method. - # result = client.create_generator_evaluation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_generator_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest - - # Converts hash and nil to an 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_generator_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generator_evaluation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_generator_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generator_evaluations_stub.create_generator_evaluation 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 an evaluation of generator. - # - # @overload get_generator_evaluation(request, options = nil) - # Pass arguments to `get_generator_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator_evaluation(name: nil) - # Pass arguments to `get_generator_evaluation` via keyword arguments. Note that at - # least one keyword argument is required. To 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 generator evaluation resource name. Format: - # `projects//locations//generators//evaluations/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new - # - # # Call the get_generator_evaluation method. - # result = client.get_generator_evaluation request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::GeneratorEvaluation. - # p result - # - def get_generator_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest - - # Converts hash and nil to an 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_generator_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generator_evaluation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_generator_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generator_evaluations_stub.get_generator_evaluation 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 evaluations of generator. - # - # @overload list_generator_evaluations(request, options = nil) - # Pass arguments to `list_generator_evaluations` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator_evaluations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_generator_evaluations` via keyword arguments. Note that at - # least one keyword argument is 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 generator resource name. Format: - # `projects//locations//generators/` - # Wildcard value `-` is supported on generator_id to list evaluations across - # all generators under same project. - # @param page_size [::Integer] - # Optional. Maximum number of evaluations to return in a - # single page. By default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.new - # - # # Call the list_generator_evaluations method. - # result = client.list_generator_evaluations 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::Dialogflow::V2::GeneratorEvaluation. - # p item - # end - # - def list_generator_evaluations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest - - # Converts hash and nil to an 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_generator_evaluations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generator_evaluations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_generator_evaluations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generator_evaluations_stub.list_generator_evaluations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @generator_evaluations_stub, :list_generator_evaluations, "generator_evaluations", 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 an evaluation of generator. - # - # @overload delete_generator_evaluation(request, options = nil) - # Pass arguments to `delete_generator_evaluation` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator_evaluation(name: nil) - # Pass arguments to `delete_generator_evaluation` via keyword arguments. Note that at - # least one keyword argument is required. To 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 generator evaluation resource name. Format: - # `projects//locations//generators// - # evaluations/` - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new - # - # # Call the delete_generator_evaluation method. - # result = client.delete_generator_evaluation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_generator_evaluation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest - - # Converts hash and nil to an 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_generator_evaluation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generator_evaluation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_generator_evaluation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generator_evaluations_stub.delete_generator_evaluation 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 GeneratorEvaluations REST API. - # - # This class represents the configuration for GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::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_generator_evaluation to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_generator_evaluation.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_generator_evaluation.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 GeneratorEvaluations 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_generator_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_generator_evaluation - ## - # RPC-specific configuration for `get_generator_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generator_evaluation - ## - # RPC-specific configuration for `list_generator_evaluations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_generator_evaluations - ## - # RPC-specific configuration for `delete_generator_evaluation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_generator_evaluation - - # @private - def initialize parent_rpcs = nil - create_generator_evaluation_config = parent_rpcs.create_generator_evaluation if parent_rpcs.respond_to? :create_generator_evaluation - @create_generator_evaluation = ::Gapic::Config::Method.new create_generator_evaluation_config - get_generator_evaluation_config = parent_rpcs.get_generator_evaluation if parent_rpcs.respond_to? :get_generator_evaluation - @get_generator_evaluation = ::Gapic::Config::Method.new get_generator_evaluation_config - list_generator_evaluations_config = parent_rpcs.list_generator_evaluations if parent_rpcs.respond_to? :list_generator_evaluations - @list_generator_evaluations = ::Gapic::Config::Method.new list_generator_evaluations_config - delete_generator_evaluation_config = parent_rpcs.delete_generator_evaluation if parent_rpcs.respond_to? :delete_generator_evaluation - @delete_generator_evaluation = ::Gapic::Config::Method.new delete_generator_evaluation_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/operations.rb deleted file mode 100644 index c26d845cca6c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/operations.rb +++ /dev/null @@ -1,947 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module GeneratorEvaluations - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the GeneratorEvaluations 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 GeneratorEvaluations 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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub.rb deleted file mode 100644 index 3e0881667b1d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub.rb +++ /dev/null @@ -1,326 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/generator_evaluation_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module GeneratorEvaluations - module Rest - ## - # REST service stub for the GeneratorEvaluations 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_generator_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_generator_evaluation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_generator_evaluation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generator_evaluation", - 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_generator_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::GeneratorEvaluation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] - # A result object deserialized from the server's reply - def get_generator_evaluation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_generator_evaluation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generator_evaluation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation.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_generator_evaluations REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListGeneratorEvaluationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse] - # A result object deserialized from the server's reply - def list_generator_evaluations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_generator_evaluations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generator_evaluations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse.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_generator_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_generator_evaluation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_generator_evaluation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generator_evaluation", - 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 create_generator_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest] - # 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_generator_evaluation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/evaluations", - body: "generator_evaluation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_generator_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest] - # 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_generator_evaluation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/evaluations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_generator_evaluations REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest] - # 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_generator_evaluations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/evaluations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_generator_evaluation REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest] - # 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_generator_evaluation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/evaluations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_pb.rb deleted file mode 100644 index 7df048b57c5c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_pb.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/generator.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/dialogflow/v2/agent_coaching_instruction_pb' -require 'google/cloud/dialogflow/v2/ces_app_pb' -require 'google/cloud/dialogflow/v2/ces_tool_pb' -require 'google/cloud/dialogflow/v2/tool_call_pb' -require 'google/cloud/dialogflow/v2/toolset_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n*google/cloud/dialogflow/v2/generator.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a;google/cloud/dialogflow/v2/agent_coaching_instruction.proto\x1a(google/cloud/dialogflow/v2/ces_app.proto\x1a)google/cloud/dialogflow/v2/ces_tool.proto\x1a*google/cloud/dialogflow/v2/tool_call.proto\x1a(google/cloud/dialogflow/v2/toolset.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb7\x01\n\x16\x43reateGeneratorRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12=\n\tgenerator\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorB\x03\xe0\x41\x02\x12\x19\n\x0cgenerator_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"P\n\x13GetGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\"\x8d\x01\n\x15ListGeneratorsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\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\"l\n\x16ListGeneratorsResponse\x12\x39\n\ngenerators\x18\x01 \x03(\x0b\x32%.google.cloud.dialogflow.v2.Generator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"S\n\x16\x44\x65leteGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\"\x8d\x01\n\x16UpdateGeneratorRequest\x12=\n\tgenerator\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.v2.GeneratorB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x87\x02\n\x0cMessageEntry\x12@\n\x04role\x18\x01 \x01(\x0e\x32-.google.cloud.dialogflow.v2.MessageEntry.RoleB\x03\xe0\x41\x01\x12\x11\n\x04text\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"P\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHUMAN_AGENT\x10\x01\x12\x13\n\x0f\x41UTOMATED_AGENT\x10\x02\x12\x0c\n\x08\x45ND_USER\x10\x03\"]\n\x13\x43onversationContext\x12\x46\n\x0fmessage_entries\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.v2.MessageEntryB\x03\xe0\x41\x01\"q\n\x18SummarizationSectionList\x12U\n\x16summarization_sections\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.v2.SummarizationSectionB\x03\xe0\x41\x01\"\xa0\x03\n\x0e\x46\x65wShotExample\x12R\n\x14\x63onversation_context\x18\x03 \x01(\x0b\x32/.google.cloud.dialogflow.v2.ConversationContextB\x03\xe0\x41\x01\x12R\n\nextra_info\x18\x04 \x03(\x0b\x32\x39.google.cloud.dialogflow.v2.FewShotExample.ExtraInfoEntryB\x03\xe0\x41\x01\x12Z\n\x1asummarization_section_list\x18\x06 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.SummarizationSectionListH\x00\x12\x44\n\x06output\x18\x07 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestionB\x03\xe0\x41\x02\x1a\x30\n\x0e\x45xtraInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x12\n\x10instruction_list\"\xc4\x01\n\x12InferenceParameter\x12#\n\x11max_output_tokens\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1d\n\x0btemperature\x18\x02 \x01(\x01\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x17\n\x05top_k\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x17\n\x05top_p\x18\x04 \x01(\x01\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x42\x14\n\x12_max_output_tokensB\x0e\n\x0c_temperatureB\x08\n\x06_top_kB\x08\n\x06_top_p\"\xc3\x01\n\x14\x41gentCoachingContext\x12!\n\x14overarching_guidance\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12O\n\x0cinstructions\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.v2.AgentCoachingInstructionB\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14output_language_code\x18\t \x01(\tB\x03\xe0\x41\x01\"\xdc\x02\n\x14SummarizationSection\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\ndefinition\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12H\n\x04type\x18\x03 \x01(\x0e\x32\x35.google.cloud.dialogflow.v2.SummarizationSection.TypeB\x03\xe0\x41\x01\"\xce\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tSITUATION\x10\x01\x12\n\n\x06\x41\x43TION\x10\x02\x12\x0e\n\nRESOLUTION\x10\x03\x12\x1b\n\x17REASON_FOR_CANCELLATION\x10\x04\x12\x19\n\x15\x43USTOMER_SATISFACTION\x10\x05\x12\x0c\n\x08\x45NTITIES\x10\x06\x12\x14\n\x10\x43USTOMER_DEFINED\x10\x07\x12\x15\n\x11SITUATION_CONCISE\x10\t\x12\x12\n\x0e\x41\x43TION_CONCISE\x10\n\"\xf2\x01\n\x14SummarizationContext\x12U\n\x16summarization_sections\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.v2.SummarizationSectionB\x03\xe0\x41\x01\x12J\n\x11\x66\x65w_shot_examples\x18\x02 \x03(\x0b\x32*.google.cloud.dialogflow.v2.FewShotExampleB\x03\xe0\x41\x01\x12\x14\n\x07version\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12!\n\x14output_language_code\x18\x06 \x01(\tB\x03\xe0\x41\x01\"$\n\x0f\x46reeFormContext\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xd5\x08\n\tGenerator\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12H\n\x11\x66ree_form_context\x18\x0b \x01(\x0b\x32+.google.cloud.dialogflow.v2.FreeFormContextH\x00\x12R\n\x16\x61gent_coaching_context\x18\x0c \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.AgentCoachingContextH\x00\x12Q\n\x15summarization_context\x18\r \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.SummarizationContextH\x00\x12P\n\x13inference_parameter\x18\x04 \x01(\x0b\x32..google.cloud.dialogflow.v2.InferenceParameterB\x03\xe0\x41\x01\x12\x44\n\rtrigger_event\x18\x05 \x01(\x0e\x32(.google.cloud.dialogflow.v2.TriggerEventB\x03\xe0\x41\x01\x12\x1e\n\x0fpublished_model\x18\x0f \x01(\tB\x03\xe0\x41\x01H\x01\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\x35\n\x05tools\x18\x0e \x03(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\x12]\n\x1asuggestion_deduping_config\x18\x17 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.SuggestionDedupingConfigB\x03\xe0\x41\x01\x12\x43\n\rtoolset_tools\x18\x1b \x03(\x0b\x32\'.google.cloud.dialogflow.v2.ToolsetToolB\x03\xe0\x41\x01\x12\x44\n\x0e\x63\x65s_tool_specs\x18\x1c \x03(\x0b\x32\'.google.cloud.dialogflow.v2.CesToolSpecB\x03\xe0\x41\x01\x12\x42\n\rces_app_specs\x18\x1d \x03(\x0b\x32&.google.cloud.dialogflow.v2.CesAppSpecB\x03\xe0\x41\x01:\x7f\xea\x41|\n#dialogflow.googleapis.com/Generator\x12>projects/{project}/locations/{location}/generators/{generator}*\ngenerators2\tgeneratorB\t\n\x07\x63ontextB\x12\n\x10\x66oundation_model\"+\n\x12\x46reeFormSuggestion\x12\x15\n\x08response\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xae\x01\n\x11SummarySuggestion\x12[\n\x10summary_sections\x18\x01 \x03(\x0b\x32<.google.cloud.dialogflow.v2.SummarySuggestion.SummarySectionB\x03\xe0\x41\x02\x1a<\n\x0eSummarySection\x12\x14\n\x07section\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07summary\x18\x02 \x01(\tB\x03\xe0\x41\x02\"\xc0\t\n\x17\x41gentCoachingSuggestion\x12Z\n\x17\x61pplicable_instructions\x18\x01 \x03(\x0b\x32\x34.google.cloud.dialogflow.v2.AgentCoachingInstructionB\x03\xe0\x41\x01\x12p\n\x18\x61gent_action_suggestions\x18\x02 \x03(\x0b\x32I.google.cloud.dialogflow.v2.AgentCoachingSuggestion.AgentActionSuggestionB\x03\xe0\x41\x01\x12\x61\n\x10sample_responses\x18\x03 \x03(\x0b\x32\x42.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SampleResponseB\x03\xe0\x41\x01\x1a+\n\x07Sources\x12 \n\x13instruction_indexes\x18\x02 \x03(\x05\x42\x03\xe0\x41\x03\x1a\xde\x02\n\x14\x44uplicateCheckResult\x12\x80\x01\n\x15\x64uplicate_suggestions\x18\x01 \x03(\x0b\x32\\.google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult.DuplicateSuggestionB\x03\xe0\x41\x03\x1a\xc2\x01\n\x13\x44uplicateSuggestion\x12\x1a\n\ranswer_record\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12Q\n\x07sources\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SourcesB\x03\xe0\x41\x03\x12\x1d\n\x10suggestion_index\x18\x03 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1d\n\x10similarity_score\x18\x04 \x01(\x02\x42\x03\xe0\x41\x03\x1a\xf4\x01\n\x15\x41gentActionSuggestion\x12\x19\n\x0c\x61gent_action\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x07sources\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SourcesB\x03\xe0\x41\x03\x12m\n\x16\x64uplicate_check_result\x18\x03 \x01(\x0b\x32H.google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResultB\x03\xe0\x41\x03\x1a\xee\x01\n\x0eSampleResponse\x12\x1a\n\rresponse_text\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12Q\n\x07sources\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.v2.AgentCoachingSuggestion.SourcesB\x03\xe0\x41\x03\x12m\n\x16\x64uplicate_check_result\x18\x03 \x01(\x0b\x32H.google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResultB\x03\xe0\x41\x03\"\x9e\x04\n\x13GeneratorSuggestion\x12S\n\x14\x66ree_form_suggestion\x18\x01 \x01(\x0b\x32..google.cloud.dialogflow.v2.FreeFormSuggestionB\x03\xe0\x41\x01H\x00\x12P\n\x12summary_suggestion\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SummarySuggestionB\x03\xe0\x41\x01H\x00\x12]\n\x19\x61gent_coaching_suggestion\x18\x03 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.AgentCoachingSuggestionB\x03\xe0\x41\x01H\x00\x12Y\n\x0etool_call_info\x18\t \x03(\x0b\x32<.google.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfoB\x03\xe0\x41\x01\x1a\x97\x01\n\x0cToolCallInfo\x12<\n\ttool_call\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.v2.ToolCallB\x03\xe0\x41\x02\x12I\n\x10tool_call_result\x18\x02 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ToolCallResultB\x03\xe0\x41\x02\x42\x0c\n\nsuggestion\"[\n\x18SuggestionDedupingConfig\x12\x1c\n\x0f\x65nable_deduping\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12!\n\x14similarity_threshold\x18\x02 \x01(\x02\x42\x03\xe0\x41\x01\"\xb8\x04\n\x0bRaiSettings\x12W\n\x14rai_category_configs\x18\x01 \x03(\x0b\x32\x39.google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig\x1a\xcf\x03\n\x11RaiCategoryConfig\x12\\\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32\x45.google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategoryB\x03\xe0\x41\x01\x12j\n\x11sensitivity_level\x18\x02 \x01(\x0e\x32J.google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.SensitivityLevelB\x03\xe0\x41\x01\"z\n\x0bRaiCategory\x12\x1c\n\x18RAI_CATEGORY_UNSPECIFIED\x10\x00\x12\x15\n\x11\x44\x41NGEROUS_CONTENT\x10\x01\x12\x15\n\x11SEXUALLY_EXPLICIT\x10\x02\x12\x0e\n\nHARASSMENT\x10\x03\x12\x0f\n\x0bHATE_SPEECH\x10\x04\"t\n\x10SensitivityLevel\x12!\n\x1dSENSITIVITY_LEVEL_UNSPECIFIED\x10\x00\x12\x0e\n\nBLOCK_MOST\x10\x01\x12\x0e\n\nBLOCK_SOME\x10\x02\x12\r\n\tBLOCK_FEW\x10\x03\x12\x0e\n\nBLOCK_NONE\x10\x04*}\n\x0cTriggerEvent\x12\x1d\n\x19TRIGGER_EVENT_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45ND_OF_UTTERANCE\x10\x01\x12\x0f\n\x0bMANUAL_CALL\x10\x02\x12\x14\n\x10\x43USTOMER_MESSAGE\x10\x03\x12\x11\n\rAGENT_MESSAGE\x10\x04\x32\x86\t\n\nGenerators\x12\x81\x02\n\x0f\x43reateGenerator\x12\x32.google.cloud.dialogflow.v2.CreateGeneratorRequest\x1a%.google.cloud.dialogflow.v2.Generator\"\x92\x01\xda\x41\x1dparent,generator,generator_id\x82\xd3\xe4\x93\x02l\"./v2/{parent=projects/*/locations/*}/generators:\tgeneratorZ/\"\"/v2/{parent=projects/*}/generators:\tgenerator\x12\xa5\x01\n\x0cGetGenerator\x12/.google.cloud.dialogflow.v2.GetGeneratorRequest\x1a%.google.cloud.dialogflow.v2.Generator\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v2/{name=projects/*/locations/*/generators/*}\x12\xde\x01\n\x0eListGenerators\x12\x31.google.cloud.dialogflow.v2.ListGeneratorsRequest\x1a\x32.google.cloud.dialogflow.v2.ListGeneratorsResponse\"e\xda\x41\x06parent\x82\xd3\xe4\x93\x02V\x12./v2/{parent=projects/*/locations/*}/generatorsZ$\x12\"/v2/{parent=projects/*}/generators\x12\x9c\x01\n\x0f\x44\x65leteGenerator\x12\x32.google.cloud.dialogflow.v2.DeleteGeneratorRequest\x1a\x16.google.protobuf.Empty\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v2/{name=projects/*/locations/*/generators/*}\x12\xd1\x01\n\x0fUpdateGenerator\x12\x32.google.cloud.dialogflow.v2.UpdateGeneratorRequest\x1a%.google.cloud.dialogflow.v2.Generator\"c\xda\x41\x15generator,update_mask\x82\xd3\xe4\x93\x02\x45\x32\x38/v2/{generator.name=projects/*/locations/*/generators/*}:\tgenerator\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x91\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x0eGeneratorProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41z\n%discoveryengine.googleapis.com/Engine\x12Qprojects/{project}/locations/{location}/collections/{collection}/engines/{engine}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - CreateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateGeneratorRequest").msgclass - GetGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetGeneratorRequest").msgclass - ListGeneratorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListGeneratorsRequest").msgclass - ListGeneratorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListGeneratorsResponse").msgclass - DeleteGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteGeneratorRequest").msgclass - UpdateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateGeneratorRequest").msgclass - MessageEntry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.MessageEntry").msgclass - MessageEntry::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.MessageEntry.Role").enummodule - ConversationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationContext").msgclass - SummarizationSectionList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationSectionList").msgclass - FewShotExample = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FewShotExample").msgclass - InferenceParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InferenceParameter").msgclass - AgentCoachingContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingContext").msgclass - SummarizationSection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationSection").msgclass - SummarizationSection::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationSection.Type").enummodule - SummarizationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarizationContext").msgclass - FreeFormContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FreeFormContext").msgclass - Generator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Generator").msgclass - FreeFormSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FreeFormSuggestion").msgclass - SummarySuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarySuggestion").msgclass - SummarySuggestion::SummarySection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SummarySuggestion.SummarySection").msgclass - AgentCoachingSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion").msgclass - AgentCoachingSuggestion::Sources = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.Sources").msgclass - AgentCoachingSuggestion::DuplicateCheckResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult").msgclass - AgentCoachingSuggestion::DuplicateCheckResult::DuplicateSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.DuplicateCheckResult.DuplicateSuggestion").msgclass - AgentCoachingSuggestion::AgentActionSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.AgentActionSuggestion").msgclass - AgentCoachingSuggestion::SampleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AgentCoachingSuggestion.SampleResponse").msgclass - GeneratorSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorSuggestion").msgclass - GeneratorSuggestion::ToolCallInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorSuggestion.ToolCallInfo").msgclass - SuggestionDedupingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionDedupingConfig").msgclass - RaiSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RaiSettings").msgclass - RaiSettings::RaiCategoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig").msgclass - RaiSettings::RaiCategoryConfig::RaiCategory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategory").enummodule - RaiSettings::RaiCategoryConfig::SensitivityLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.SensitivityLevel").enummodule - TriggerEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TriggerEvent").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_services_pb.rb deleted file mode 100644 index b00d0a5139f3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generator_services_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/generator.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/generator_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Generators - # Generator Service for LLM powered Agent Assist. This service manages the - # configurations of user owned Generators, such as description, context and - # instruction, input/output format, etc. The generator resources will be used - # inside a conversation and will be triggered by TriggerEvent to query LLM for - # answers. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Generators' - - # Creates a generator. - rpc :CreateGenerator, ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest, ::Google::Cloud::Dialogflow::V2::Generator - # Retrieves a generator. - rpc :GetGenerator, ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest, ::Google::Cloud::Dialogflow::V2::Generator - # Lists generators. - rpc :ListGenerators, ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest, ::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse - # Deletes a generator. - rpc :DeleteGenerator, ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest, ::Google::Protobuf::Empty - # Updates a generator. - rpc :UpdateGenerator, ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest, ::Google::Cloud::Dialogflow::V2::Generator - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators.rb deleted file mode 100644 index ed9938455991..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/generators/credentials" -require "google/cloud/dialogflow/v2/generators/paths" -require "google/cloud/dialogflow/v2/generators/client" -require "google/cloud/dialogflow/v2/generators/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Generator Service for LLM powered Agent Assist. This service manages the - # configurations of user owned Generators, such as description, context and - # instruction, input/output format, etc. The generator resources will be used - # inside a conversation and will be triggered by TriggerEvent to query LLM for - # answers. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/generators" - # client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/generators/rest" - # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new - # - module Generators - end - end - end - end -end - -helper_path = ::File.join __dir__, "generators", "helpers.rb" -require "google/cloud/dialogflow/v2/generators/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/client.rb deleted file mode 100644 index 9c0e10b47d47..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/client.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 "google/cloud/errors" -require "google/cloud/dialogflow/v2/generator_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Generators - ## - # Client for the Generators service. - # - # Generator Service for LLM powered Agent Assist. This service manages the - # configurations of user owned Generators, such as description, context and - # instruction, input/output format, etc. The generator resources will be used - # inside a conversation and will be triggered by TriggerEvent to query LLM for - # answers. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :generators_stub - - ## - # Configure the Generators Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Generators::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Generators clients - # ::Google::Cloud::Dialogflow::V2::Generators::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Generators 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::Dialogflow::V2::Generators::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 - @generators_stub.universe_domain - end - - ## - # Create a new Generators client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Generators 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/dialogflow/v2/generator_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 - - @generators_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Generators::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 - ) - - @generators_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 = @generators_stub.endpoint - config.universe_domain = @generators_stub.universe_domain - config.logger = @generators_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 - @generators_stub.logger - end - - # Service calls - - ## - # Creates a generator. - # - # @overload create_generator(request, options = nil) - # Pass arguments to `create_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator(parent: nil, generator: nil, generator_id: nil) - # Pass arguments to `create_generator` via keyword arguments. Note that at - # least one keyword argument is 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 project/location to create generator for. Format: - # `projects//locations/` - # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] - # Required. The generator to create. - # @param generator_id [::String] - # Optional. The ID to use for the generator, which will become the final - # component of the generator's resource name. - # - # The generator ID must be compliant with the regression formula - # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - # If the field is not provided, an Id will be auto-generated. - # If the field is provided, the caller is responsible for - # 1. the uniqueness of the ID, otherwise the request will be rejected. - # 2. the consistency for whether to use custom ID or not under a project to - # better ensure uniqueness. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Generator] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new - # - # # Call the create_generator method. - # result = client.create_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. - # p result - # - def create_generator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest - - # Converts hash and nil to 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_generator.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_generator.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_generator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.call_rpc :create_generator, 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 - - ## - # Retrieves a generator. - # - # @overload get_generator(request, options = nil) - # Pass arguments to `get_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetGeneratorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator(name: nil) - # Pass arguments to `get_generator` via keyword arguments. Note that at - # least one keyword argument is required. To 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 generator resource name to retrieve. Format: - # `projects//locations//generators/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Generator] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new - # - # # Call the get_generator method. - # result = client.get_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. - # p result - # - def get_generator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest - - # Converts hash and nil to 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_generator.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_generator.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_generator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.call_rpc :get_generator, 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 generators. - # - # @overload list_generators(request, options = nil) - # Pass arguments to `list_generators` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generators(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_generators` via keyword arguments. Note that at - # least one keyword argument is 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 project/location to list generators for. Format: - # `projects//locations/` - # @param page_size [::Integer] - # Optional. Maximum number of conversation models to return in a single page. - # Default to 10. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Generator>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Generator>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.new - # - # # Call the list_generators method. - # result = client.list_generators 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::Dialogflow::V2::Generator. - # p item - # end - # - def list_generators request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest - - # Converts hash and nil to 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_generators.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_generators.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_generators.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.call_rpc :list_generators, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @generators_stub, :list_generators, 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 generator. - # - # @overload delete_generator(request, options = nil) - # Pass arguments to `delete_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator(name: nil) - # Pass arguments to `delete_generator` via keyword arguments. Note that at - # least one keyword argument is required. To 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 generator resource name to delete. Format: - # `projects//locations//generators/` - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new - # - # # Call the delete_generator method. - # result = client.delete_generator request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_generator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest - - # Converts hash and nil to 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_generator.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_generator.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_generator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.call_rpc :delete_generator, 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 generator. - # - # @overload update_generator(request, options = nil) - # Pass arguments to `update_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator(generator: nil, update_mask: nil) - # Pass arguments to `update_generator` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] - # Required. The generator to update. - # The name field of generator is to identify the generator to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The list of fields to update. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Generator] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new - # - # # Call the update_generator method. - # result = client.update_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. - # p result - # - def update_generator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest - - # Converts hash and nil to 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_generator.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.generator&.name - header_params["generator.name"] = request.generator.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_generator.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_generator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.call_rpc :update_generator, 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 Generators API. - # - # This class represents the configuration for Generators, - # 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::Dialogflow::V2::Generators::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_generator to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Generators::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_generator.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_generator.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::Dialogflow::V2::Generators::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Generators 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :create_generator - ## - # RPC-specific configuration for `get_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generator - ## - # RPC-specific configuration for `list_generators` - # @return [::Gapic::Config::Method] - # - attr_reader :list_generators - ## - # RPC-specific configuration for `delete_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_generator - ## - # RPC-specific configuration for `update_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generator - - # @private - def initialize parent_rpcs = nil - create_generator_config = parent_rpcs.create_generator if parent_rpcs.respond_to? :create_generator - @create_generator = ::Gapic::Config::Method.new create_generator_config - get_generator_config = parent_rpcs.get_generator if parent_rpcs.respond_to? :get_generator - @get_generator = ::Gapic::Config::Method.new get_generator_config - list_generators_config = parent_rpcs.list_generators if parent_rpcs.respond_to? :list_generators - @list_generators = ::Gapic::Config::Method.new list_generators_config - delete_generator_config = parent_rpcs.delete_generator if parent_rpcs.respond_to? :delete_generator - @delete_generator = ::Gapic::Config::Method.new delete_generator_config - update_generator_config = parent_rpcs.update_generator if parent_rpcs.respond_to? :update_generator - @update_generator = ::Gapic::Config::Method.new update_generator_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/credentials.rb deleted file mode 100644 index 9aa7a8751e1f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Generators - # Credentials for the Generators API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/paths.rb deleted file mode 100644 index 5728fa010b92..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/paths.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! - - -module Google - module Cloud - module Dialogflow - module V2 - module Generators - # Path helper methods for the Generators API. - module Paths - ## - # Create a fully-qualified App resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # - # @return [::String] - def app_path project:, location:, app: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}" - end - - ## - # Create a fully-qualified Generator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/generators/{generator}` - # - # @param project [String] - # @param location [String] - # @param generator [String] - # - # @return [::String] - def generator_path project:, location:, generator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/generators/#{generator}" - end - - ## - # 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 - - ## - # Create a fully-qualified Tool resource string. - # - # @overload tool_path(project:, location:, tool:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param tool [String] - # - # @overload tool_path(project:, location:, app:, tool:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # @param tool [String] - # - # @return [::String] - def tool_path **args - resources = { - "location:project:tool" => (proc do |project:, location:, tool:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/tools/#{tool}" - end), - "app:location:project:tool" => (proc do |project:, location:, app:, tool:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}/tools/#{tool}" - 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 Toolset resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - # - # @param project [String] - # @param location [String] - # @param app [String] - # @param toolset [String] - # - # @return [::String] - def toolset_path project:, location:, app:, toolset: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/" - - "projects/#{project}/locations/#{location}/apps/#{app}/toolsets/#{toolset}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest.rb deleted file mode 100644 index a10b5a88669c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/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 "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/generators/credentials" -require "google/cloud/dialogflow/v2/generators/paths" -require "google/cloud/dialogflow/v2/generators/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Generator Service for LLM powered Agent Assist. This service manages the - # configurations of user owned Generators, such as description, context and - # instruction, input/output format, etc. The generator resources will be used - # inside a conversation and will be triggered by TriggerEvent to query LLM for - # answers. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/generators/rest" - # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new - # - module Generators - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/generators/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/client.rb deleted file mode 100644 index b0c35f150054..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/client.rb +++ /dev/null @@ -1,830 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/generator_pb" -require "google/cloud/dialogflow/v2/generators/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Generators - module Rest - ## - # REST client for the Generators service. - # - # Generator Service for LLM powered Agent Assist. This service manages the - # configurations of user owned Generators, such as description, context and - # instruction, input/output format, etc. The generator resources will be used - # inside a conversation and will be triggered by TriggerEvent to query LLM for - # answers. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :generators_stub - - ## - # Configure the Generators Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Generators::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Generators clients - # ::Google::Cloud::Dialogflow::V2::Generators::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Generators 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::Dialogflow::V2::Generators::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 - @generators_stub.universe_domain - end - - ## - # Create a new Generators REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Generators 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 - - @generators_stub = ::Google::Cloud::Dialogflow::V2::Generators::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @generators_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 = @generators_stub.endpoint - config.universe_domain = @generators_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @generators_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 - @generators_stub.logger - end - - # Service calls - - ## - # Creates a generator. - # - # @overload create_generator(request, options = nil) - # Pass arguments to `create_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator(parent: nil, generator: nil, generator_id: nil) - # Pass arguments to `create_generator` via keyword arguments. Note that at - # least one keyword argument is 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 project/location to create generator for. Format: - # `projects//locations/` - # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] - # Required. The generator to create. - # @param generator_id [::String] - # Optional. The ID to use for the generator, which will become the final - # component of the generator's resource name. - # - # The generator ID must be compliant with the regression formula - # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - # If the field is not provided, an Id will be auto-generated. - # If the field is provided, the caller is responsible for - # 1. the uniqueness of the ID, otherwise the request will be rejected. - # 2. the consistency for whether to use custom ID or not under a project to - # better ensure uniqueness. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new - # - # # Call the create_generator method. - # result = client.create_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. - # p result - # - def create_generator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest - - # Converts hash and nil to an 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_generator.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generator.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_generator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.create_generator 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 - - ## - # Retrieves a generator. - # - # @overload get_generator(request, options = nil) - # Pass arguments to `get_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetGeneratorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator(name: nil) - # Pass arguments to `get_generator` via keyword arguments. Note that at - # least one keyword argument is required. To 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 generator resource name to retrieve. Format: - # `projects//locations//generators/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new - # - # # Call the get_generator method. - # result = client.get_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. - # p result - # - def get_generator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest - - # Converts hash and nil to an 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_generator.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generator.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_generator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.get_generator 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 generators. - # - # @overload list_generators(request, options = nil) - # Pass arguments to `list_generators` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generators(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_generators` via keyword arguments. Note that at - # least one keyword argument is 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 project/location to list generators for. Format: - # `projects//locations/` - # @param page_size [::Integer] - # Optional. Maximum number of conversation models to return in a single page. - # Default to 10. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Generator>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Generator>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.new - # - # # Call the list_generators method. - # result = client.list_generators 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::Dialogflow::V2::Generator. - # p item - # end - # - def list_generators request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest - - # Converts hash and nil to an 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_generators.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generators.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_generators.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.list_generators request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @generators_stub, :list_generators, "generators", 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 generator. - # - # @overload delete_generator(request, options = nil) - # Pass arguments to `delete_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator(name: nil) - # Pass arguments to `delete_generator` via keyword arguments. Note that at - # least one keyword argument is required. To 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 generator resource name to delete. Format: - # `projects//locations//generators/` - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new - # - # # Call the delete_generator method. - # result = client.delete_generator request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_generator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest - - # Converts hash and nil to an 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_generator.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generator.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_generator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.delete_generator 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 generator. - # - # @overload update_generator(request, options = nil) - # Pass arguments to `update_generator` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_generator(generator: nil, update_mask: nil) - # Pass arguments to `update_generator` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param generator [::Google::Cloud::Dialogflow::V2::Generator, ::Hash] - # Required. The generator to update. - # The name field of generator is to identify the generator to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The list of fields to update. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new - # - # # Call the update_generator method. - # result = client.update_generator request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. - # p result - # - def update_generator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest - - # Converts hash and nil to an 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_generator.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_generator.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_generator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @generators_stub.update_generator 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 Generators REST API. - # - # This class represents the configuration for Generators 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::Dialogflow::V2::Generators::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_generator to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_generator.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_generator.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Generators 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :create_generator - ## - # RPC-specific configuration for `get_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :get_generator - ## - # RPC-specific configuration for `list_generators` - # @return [::Gapic::Config::Method] - # - attr_reader :list_generators - ## - # RPC-specific configuration for `delete_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_generator - ## - # RPC-specific configuration for `update_generator` - # @return [::Gapic::Config::Method] - # - attr_reader :update_generator - - # @private - def initialize parent_rpcs = nil - create_generator_config = parent_rpcs.create_generator if parent_rpcs.respond_to? :create_generator - @create_generator = ::Gapic::Config::Method.new create_generator_config - get_generator_config = parent_rpcs.get_generator if parent_rpcs.respond_to? :get_generator - @get_generator = ::Gapic::Config::Method.new get_generator_config - list_generators_config = parent_rpcs.list_generators if parent_rpcs.respond_to? :list_generators - @list_generators = ::Gapic::Config::Method.new list_generators_config - delete_generator_config = parent_rpcs.delete_generator if parent_rpcs.respond_to? :delete_generator - @delete_generator = ::Gapic::Config::Method.new delete_generator_config - update_generator_config = parent_rpcs.update_generator if parent_rpcs.respond_to? :update_generator - @update_generator = ::Gapic::Config::Method.new update_generator_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/service_stub.rb deleted file mode 100644 index 30346afe94d2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/generators/rest/service_stub.rb +++ /dev/null @@ -1,403 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/generator_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Generators - module Rest - ## - # REST service stub for the Generators 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_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # A result object deserialized from the server's reply - def create_generator request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_generator_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generator", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Generator.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_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetGeneratorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # A result object deserialized from the server's reply - def get_generator request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_generator_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generator", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Generator.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_generators REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListGeneratorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse] - # A result object deserialized from the server's reply - def list_generators request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_generators_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generators", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse.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_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_generator request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_generator_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generator", - 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_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Generator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # A result object deserialized from the server's reply - def update_generator request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_generator_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_generator", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Generator.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_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest] - # 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_generator_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/generators", - body: "generator", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/generators", - body: "generator", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetGeneratorRequest] - # 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_generator_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_generators REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest] - # 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_generators_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/generators", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/generators", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest] - # 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_generator_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_generator REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest] - # 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_generator_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{generator.name}", - body: "generator", - matches: [ - ["generator.name", %r{^projects/[^/]+/locations/[^/]+/generators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb deleted file mode 100644 index 76de63cd451f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/human_agent_assistant_event.proto - -require 'google/protobuf' - -require 'google/cloud/dialogflow/v2/participant_pb' - - -descriptor_data = "\ncloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - HumanAgentAssistantEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.HumanAgentAssistantEvent").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_pb.rb deleted file mode 100644 index b65cd336e1cd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_pb.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/intent.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/dialogflow/v2/context_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n\'google/cloud/dialogflow/v2/intent.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/dialogflow/v2/context.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xdc\x38\n\x06Intent\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12K\n\rwebhook_state\x18\x06 \x01(\x0e\x32/.google.cloud.dialogflow.v2.Intent.WebhookStateB\x03\xe0\x41\x01\x12\x15\n\x08priority\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x18\n\x0bis_fallback\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0bml_disabled\x18\x13 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\x12live_agent_handoff\x18\x14 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1c\n\x0f\x65nd_interaction\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12 \n\x13input_context_names\x18\x07 \x03(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x65vents\x18\x08 \x03(\tB\x03\xe0\x41\x01\x12P\n\x10training_phrases\x18\t \x03(\x0b\x32\x31.google.cloud.dialogflow.v2.Intent.TrainingPhraseB\x03\xe0\x41\x01\x12\x13\n\x06\x61\x63tion\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x41\n\x0foutput_contexts\x18\x0b \x03(\x0b\x32#.google.cloud.dialogflow.v2.ContextB\x03\xe0\x41\x01\x12\x1b\n\x0ereset_contexts\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\x45\n\nparameters\x18\r \x03(\x0b\x32,.google.cloud.dialogflow.v2.Intent.ParameterB\x03\xe0\x41\x01\x12\x41\n\x08messages\x18\x0e \x03(\x0b\x32*.google.cloud.dialogflow.v2.Intent.MessageB\x03\xe0\x41\x01\x12\\\n\x1a\x64\x65\x66\x61ult_response_platforms\x18\x0f \x03(\x0e\x32\x33.google.cloud.dialogflow.v2.Intent.Message.PlatformB\x03\xe0\x41\x01\x12&\n\x19root_followup_intent_name\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12#\n\x1bparent_followup_intent_name\x18\x11 \x01(\t\x12X\n\x14\x66ollowup_intent_info\x18\x12 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.Intent.FollowupIntentInfoB\x03\xe0\x41\x03\x1a\xf6\x02\n\x0eTrainingPhrase\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12I\n\x04type\x18\x02 \x01(\x0e\x32\x36.google.cloud.dialogflow.v2.Intent.TrainingPhrase.TypeB\x03\xe0\x41\x02\x12J\n\x05parts\x18\x03 \x03(\x0b\x32\x36.google.cloud.dialogflow.v2.Intent.TrainingPhrase.PartB\x03\xe0\x41\x02\x12\x1e\n\x11times_added_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x1a]\n\x04Part\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x18\n\x0b\x65ntity_type\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x61lias\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cuser_defined\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\";\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45XAMPLE\x10\x01\x12\x10\n\x08TEMPLATE\x10\x02\x1a\x02\x08\x01\x1a\xca\x01\n\tParameter\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x12\n\x05value\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rdefault_value\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18\x65ntity_type_display_name\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tmandatory\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12\x14\n\x07prompts\x18\x07 \x03(\tB\x03\xe0\x41\x01\x12\x14\n\x07is_list\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x96*\n\x07Message\x12?\n\x04text\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.Intent.Message.TextH\x00\x12\x41\n\x05image\x18\x02 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageH\x00\x12P\n\rquick_replies\x18\x03 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.Intent.Message.QuickRepliesH\x00\x12?\n\x04\x63\x61rd\x18\x04 \x01(\x0b\x32/.google.cloud.dialogflow.v2.Intent.Message.CardH\x00\x12*\n\x07payload\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12V\n\x10simple_responses\x18\x07 \x01(\x0b\x32:.google.cloud.dialogflow.v2.Intent.Message.SimpleResponsesH\x00\x12J\n\nbasic_card\x18\x08 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.Intent.Message.BasicCardH\x00\x12M\n\x0bsuggestions\x18\t \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.Intent.Message.SuggestionsH\x00\x12[\n\x13link_out_suggestion\x18\n \x01(\x0b\x32<.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestionH\x00\x12L\n\x0blist_select\x18\x0b \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.Intent.Message.ListSelectH\x00\x12T\n\x0f\x63\x61rousel_select\x18\x0c \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.CarouselSelectH\x00\x12]\n\x14\x62rowse_carousel_card\x18\x16 \x01(\x0b\x32=.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCardH\x00\x12J\n\ntable_card\x18\x17 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.Intent.Message.TableCardH\x00\x12P\n\rmedia_content\x18\x18 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.Intent.Message.MediaContentH\x00\x12J\n\x08platform\x18\x06 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.Intent.Message.PlatformB\x03\xe0\x41\x01\x1a\x19\n\x04Text\x12\x11\n\x04text\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a@\n\x05Image\x12\x16\n\timage_uri\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\x12\x61\x63\x63\x65ssibility_text\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a>\n\x0cQuickReplies\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rquick_replies\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1a\xcb\x01\n\x04\x43\x61rd\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08subtitle\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\timage_uri\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12L\n\x07\x62uttons\x18\x04 \x03(\x0b\x32\x36.google.cloud.dialogflow.v2.Intent.Message.Card.ButtonB\x03\xe0\x41\x01\x1a\x32\n\x06\x42utton\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08postback\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1aQ\n\x0eSimpleResponse\x12\x16\n\x0etext_to_speech\x18\x01 \x01(\t\x12\x0c\n\x04ssml\x18\x02 \x01(\t\x12\x19\n\x0c\x64isplay_text\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1ak\n\x0fSimpleResponses\x12X\n\x10simple_responses\x18\x01 \x03(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.SimpleResponseB\x03\xe0\x41\x02\x1a\x88\x03\n\tBasicCard\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08subtitle\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\x0e\x66ormatted_text\x18\x03 \x01(\t\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x12Q\n\x07\x62uttons\x18\x05 \x03(\x0b\x32;.google.cloud.dialogflow.v2.Intent.Message.BasicCard.ButtonB\x03\xe0\x41\x01\x1a\x9e\x01\n\x06\x42utton\x12\r\n\x05title\x18\x01 \x01(\t\x12g\n\x0fopen_uri_action\x18\x02 \x01(\x0b\x32I.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriActionB\x03\xe0\x41\x02\x1a\x1c\n\rOpenUriAction\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a \n\nSuggestion\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a^\n\x0bSuggestions\x12O\n\x0bsuggestions\x18\x01 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.Intent.Message.SuggestionB\x03\xe0\x41\x02\x1a\x44\n\x11LinkOutSuggestion\x12\x1d\n\x10\x64\x65stination_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a\xd2\x02\n\nListSelect\x12\x12\n\x05title\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12N\n\x05items\x18\x02 \x03(\x0b\x32:.google.cloud.dialogflow.v2.Intent.Message.ListSelect.ItemB\x03\xe0\x41\x02\x12\x15\n\x08subtitle\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1a\xc8\x01\n\x04Item\x12L\n\x04info\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfoB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x1a\xaf\x02\n\x0e\x43\x61rouselSelect\x12R\n\x05items\x18\x01 \x03(\x0b\x32>.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.ItemB\x03\xe0\x41\x02\x1a\xc8\x01\n\x04Item\x12L\n\x04info\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfoB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x1a\x39\n\x0eSelectItemInfo\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08synonyms\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1a\x8e\x04\n\x0cMediaContent\x12\x62\n\nmedia_type\x18\x01 \x01(\x0e\x32I.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaTypeB\x03\xe0\x41\x01\x12\x62\n\rmedia_objects\x18\x02 \x03(\x0b\x32K.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject\x1a\xf0\x01\n\x13ResponseMediaObject\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12L\n\x0blarge_image\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01H\x00\x12\x45\n\x04icon\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01H\x00\x12\x13\n\x0b\x63ontent_url\x18\x05 \x01(\tB\x07\n\x05image\"C\n\x11ResponseMediaType\x12#\n\x1fRESPONSE_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x1a\xff\x06\n\x12\x42rowseCarouselCard\x12\x63\n\x05items\x18\x01 \x03(\x0b\x32T.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem\x12u\n\x15image_display_options\x18\x02 \x01(\x0e\x32Q.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptionsB\x03\xe0\x41\x01\x1a\x94\x04\n\x16\x42rowseCarouselCardItem\x12{\n\x0fopen_uri_action\x18\x01 \x01(\x0b\x32\x62.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction\x12\r\n\x05title\x18\x02 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x12\x13\n\x06\x66ooter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x1a\xf8\x01\n\rOpenUrlAction\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x8a\x01\n\rurl_type_hint\x18\x03 \x01(\x0e\x32n.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHintB\x03\xe0\x41\x01\"M\n\x0bUrlTypeHint\x12\x1d\n\x19URL_TYPE_HINT_UNSPECIFIED\x10\x00\x12\x0e\n\nAMP_ACTION\x10\x01\x12\x0f\n\x0b\x41MP_CONTENT\x10\x02\"v\n\x13ImageDisplayOptions\x12%\n!IMAGE_DISPLAY_OPTIONS_UNSPECIFIED\x10\x00\x12\x08\n\x04GRAY\x10\x01\x12\t\n\x05WHITE\x10\x02\x12\x0b\n\x07\x43ROPPED\x10\x03\x12\x16\n\x12\x42LURRED_BACKGROUND\x10\x04\x1a\xf3\x02\n\tTableCard\x12\r\n\x05title\x18\x01 \x01(\t\x12\x15\n\x08subtitle\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x05image\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageB\x03\xe0\x41\x01\x12[\n\x11\x63olumn_properties\x18\x04 \x03(\x0b\x32;.google.cloud.dialogflow.v2.Intent.Message.ColumnPropertiesB\x03\xe0\x41\x01\x12J\n\x04rows\x18\x05 \x03(\x0b\x32\x37.google.cloud.dialogflow.v2.Intent.Message.TableCardRowB\x03\xe0\x41\x01\x12Q\n\x07\x62uttons\x18\x06 \x03(\x0b\x32;.google.cloud.dialogflow.v2.Intent.Message.BasicCard.ButtonB\x03\xe0\x41\x01\x1a\xfa\x01\n\x10\x43olumnProperties\x12\x0e\n\x06header\x18\x01 \x01(\t\x12r\n\x14horizontal_alignment\x18\x02 \x01(\x0e\x32O.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignmentB\x03\xe0\x41\x01\"b\n\x13HorizontalAlignment\x12$\n HORIZONTAL_ALIGNMENT_UNSPECIFIED\x10\x00\x12\x0b\n\x07LEADING\x10\x01\x12\n\n\x06\x43\x45NTER\x10\x02\x12\x0c\n\x08TRAILING\x10\x03\x1ax\n\x0cTableCardRow\x12L\n\x05\x63\x65lls\x18\x01 \x03(\x0b\x32\x38.google.cloud.dialogflow.v2.Intent.Message.TableCardCellB\x03\xe0\x41\x01\x12\x1a\n\rdivider_after\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x1d\n\rTableCardCell\x12\x0c\n\x04text\x18\x01 \x01(\t\"\xa0\x01\n\x08Platform\x12\x18\n\x14PLATFORM_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x46\x41\x43\x45\x42OOK\x10\x01\x12\t\n\x05SLACK\x10\x02\x12\x0c\n\x08TELEGRAM\x10\x03\x12\x07\n\x03KIK\x10\x04\x12\t\n\x05SKYPE\x10\x05\x12\x08\n\x04LINE\x10\x06\x12\t\n\x05VIBER\x10\x07\x12\x15\n\x11\x41\x43TIONS_ON_GOOGLE\x10\x08\x12\x13\n\x0fGOOGLE_HANGOUTS\x10\x0b\x42\t\n\x07message\x1aW\n\x12\x46ollowupIntentInfo\x12\x1c\n\x14\x66ollowup_intent_name\x18\x01 \x01(\t\x12#\n\x1bparent_followup_intent_name\x18\x02 \x01(\t\"t\n\x0cWebhookState\x12\x1d\n\x19WEBHOOK_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15WEBHOOK_STATE_ENABLED\x10\x01\x12*\n&WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING\x10\x02:\x91\x01\xea\x41\x8d\x01\n dialogflow.googleapis.com/Intent\x12)projects/{project}/agent/intents/{intent}\x12>projects/{project}/locations/{location}/agent/intents/{intent}\"\xdd\x01\n\x12ListIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x03 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x05 \x01(\tB\x03\xe0\x41\x01\"c\n\x13ListIntentsResponse\x12\x33\n\x07intents\x18\x01 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x10GetIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x03 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\"\xe6\x01\n\x13\x43reateIntentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x37\n\x06intent\x18\x02 \x01(\x0b\x32\".google.cloud.dialogflow.v2.IntentB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x04 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\"\xe2\x01\n\x13UpdateIntentRequest\x12\x37\n\x06intent\x18\x01 \x01(\x0b\x32\".google.cloud.dialogflow.v2.IntentB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x04 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\"M\n\x13\x44\x65leteIntentRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n dialogflow.googleapis.com/Intent\"\xdd\x02\n\x19\x42\x61tchUpdateIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x1a\n\x10intent_batch_uri\x18\x02 \x01(\tH\x00\x12\x46\n\x13intent_batch_inline\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.IntentBatchH\x00\x12\x1a\n\rlanguage_code\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12@\n\x0bintent_view\x18\x06 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x03\xe0\x41\x01\x42\x0e\n\x0cintent_batch\"Q\n\x1a\x42\x61tchUpdateIntentsResponse\x12\x33\n\x07intents\x18\x01 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent\"\x8f\x01\n\x19\x42\x61tchDeleteIntentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 dialogflow.googleapis.com/Intent\x12\x38\n\x07intents\x18\x02 \x03(\x0b\x32\".google.cloud.dialogflow.v2.IntentB\x03\xe0\x41\x02\"B\n\x0bIntentBatch\x12\x33\n\x07intents\x18\x01 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent*?\n\nIntentView\x12\x1b\n\x17INTENT_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10INTENT_VIEW_FULL\x10\x01\x32\xf3\x10\n\x07Intents\x12\xf0\x02\n\x0bListIntents\x12..google.cloud.dialogflow.v2.ListIntentsRequest\x1a/.google.cloud.dialogflow.v2.ListIntentsResponse\"\xff\x01\xda\x41\x06parent\xda\x41\x14parent,language_code\x82\xd3\xe4\x93\x02\xd8\x01\x12%/v2/{parent=projects/*/agent}/intentsZ3\x12\x31/v2/{parent=projects/*/locations/*/agent}/intentsZ6\x12\x34/v2/{parent=projects/*/agent/environments/*}/intentsZB\x12@/v2/{parent=projects/*/locations/*/agent/environments/*}/intents\x12\xdd\x01\n\tGetIntent\x12,.google.cloud.dialogflow.v2.GetIntentRequest\x1a\".google.cloud.dialogflow.v2.Intent\"~\xda\x41\x04name\xda\x41\x12name,language_code\x82\xd3\xe4\x93\x02\\\x12%/v2/{name=projects/*/agent/intents/*}Z3\x12\x31/v2/{name=projects/*/locations/*/agent/intents/*}\x12\x86\x02\n\x0c\x43reateIntent\x12/.google.cloud.dialogflow.v2.CreateIntentRequest\x1a\".google.cloud.dialogflow.v2.Intent\"\xa0\x01\xda\x41\rparent,intent\xda\x41\x1bparent,intent,language_code\x82\xd3\xe4\x93\x02l\"%/v2/{parent=projects/*/agent}/intents:\x06intentZ;\"1/v2/{parent=projects/*/locations/*/agent}/intents:\x06intent\x12\xa0\x02\n\x0cUpdateIntent\x12/.google.cloud.dialogflow.v2.UpdateIntentRequest\x1a\".google.cloud.dialogflow.v2.Intent\"\xba\x01\xda\x41\x14intent,language_code\xda\x41 intent,language_code,update_mask\x82\xd3\xe4\x93\x02z2,/v2/{intent.name=projects/*/agent/intents/*}:\x06intentZB28/v2/{intent.name=projects/*/locations/*/agent/intents/*}:\x06intent\x12\xc2\x01\n\x0c\x44\x65leteIntent\x12/.google.cloud.dialogflow.v2.DeleteIntentRequest\x1a\x16.google.protobuf.Empty\"i\xda\x41\x04name\x82\xd3\xe4\x93\x02\\*%/v2/{name=projects/*/agent/intents/*}Z3*1/v2/{name=projects/*/locations/*/agent/intents/*}\x12\xf6\x02\n\x12\x42\x61tchUpdateIntents\x12\x35.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest\x1a\x1d.google.longrunning.Operation\"\x89\x02\xca\x41O\n5google.cloud.dialogflow.v2.BatchUpdateIntentsResponse\x12\x16google.protobuf.Struct\xda\x41\x17parent,intent_batch_uri\xda\x41\x1aparent,intent_batch_inline\x82\xd3\xe4\x93\x02z\"1/v2/{parent=projects/*/agent}/intents:batchUpdate:\x01*ZB\"=/v2/{parent=projects/*/locations/*/agent}/intents:batchUpdate:\x01*\x12\xb0\x02\n\x12\x42\x61tchDeleteIntents\x12\x35.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest\x1a\x1d.google.longrunning.Operation\"\xc3\x01\xca\x41/\n\x15google.protobuf.Empty\x12\x16google.protobuf.Struct\xda\x41\x0eparent,intents\x82\xd3\xe4\x93\x02z\"1/v2/{parent=projects/*/agent}/intents:batchDelete:\x01*ZB\"=/v2/{parent=projects/*/locations/*/agent}/intents:batchDelete:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x91\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0bIntentProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - Intent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent").msgclass - Intent::TrainingPhrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.TrainingPhrase").msgclass - Intent::TrainingPhrase::Part = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part").msgclass - Intent::TrainingPhrase::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type").enummodule - Intent::Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Parameter").msgclass - Intent::Message = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message").msgclass - Intent::Message::Text = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Text").msgclass - Intent::Message::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Image").msgclass - Intent::Message::QuickReplies = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.QuickReplies").msgclass - Intent::Message::Card = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Card").msgclass - Intent::Message::Card::Button = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Card.Button").msgclass - Intent::Message::SimpleResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.SimpleResponse").msgclass - Intent::Message::SimpleResponses = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.SimpleResponses").msgclass - Intent::Message::BasicCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BasicCard").msgclass - Intent::Message::BasicCard::Button = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button").msgclass - Intent::Message::BasicCard::Button::OpenUriAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction").msgclass - Intent::Message::Suggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Suggestion").msgclass - Intent::Message::Suggestions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Suggestions").msgclass - Intent::Message::LinkOutSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion").msgclass - Intent::Message::ListSelect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.ListSelect").msgclass - Intent::Message::ListSelect::Item = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item").msgclass - Intent::Message::CarouselSelect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.CarouselSelect").msgclass - Intent::Message::CarouselSelect::Item = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item").msgclass - Intent::Message::SelectItemInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo").msgclass - Intent::Message::MediaContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.MediaContent").msgclass - Intent::Message::MediaContent::ResponseMediaObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject").msgclass - Intent::Message::MediaContent::ResponseMediaType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType").enummodule - Intent::Message::BrowseCarouselCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard").msgclass - Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem").msgclass - Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem::OpenUrlAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction").msgclass - Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem::OpenUrlAction::UrlTypeHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint").enummodule - Intent::Message::BrowseCarouselCard::ImageDisplayOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions").enummodule - Intent::Message::TableCard = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.TableCard").msgclass - Intent::Message::ColumnProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.ColumnProperties").msgclass - Intent::Message::ColumnProperties::HorizontalAlignment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment").enummodule - Intent::Message::TableCardRow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.TableCardRow").msgclass - Intent::Message::TableCardCell = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.TableCardCell").msgclass - Intent::Message::Platform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.Message.Platform").enummodule - Intent::FollowupIntentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.FollowupIntentInfo").msgclass - Intent::WebhookState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Intent.WebhookState").enummodule - ListIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListIntentsRequest").msgclass - ListIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListIntentsResponse").msgclass - GetIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetIntentRequest").msgclass - CreateIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateIntentRequest").msgclass - UpdateIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateIntentRequest").msgclass - DeleteIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteIntentRequest").msgclass - BatchUpdateIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateIntentsRequest").msgclass - BatchUpdateIntentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateIntentsResponse").msgclass - BatchDeleteIntentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteIntentsRequest").msgclass - IntentBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IntentBatch").msgclass - IntentView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IntentView").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_services_pb.rb deleted file mode 100644 index 04143003bd3a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +++ /dev/null @@ -1,95 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/intent.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/intent_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Intents - # Service for managing [Intents][google.cloud.dialogflow.v2.Intent]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Intents' - - # Returns the list of all intents in the specified agent. - rpc :ListIntents, ::Google::Cloud::Dialogflow::V2::ListIntentsRequest, ::Google::Cloud::Dialogflow::V2::ListIntentsResponse - # Retrieves the specified intent. - rpc :GetIntent, ::Google::Cloud::Dialogflow::V2::GetIntentRequest, ::Google::Cloud::Dialogflow::V2::Intent - # Creates an intent in the specified agent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :CreateIntent, ::Google::Cloud::Dialogflow::V2::CreateIntentRequest, ::Google::Cloud::Dialogflow::V2::Intent - # Updates the specified intent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :UpdateIntent, ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest, ::Google::Cloud::Dialogflow::V2::Intent - # Deletes the specified intent and its direct or indirect followup intents. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :DeleteIntent, ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest, ::Google::Protobuf::Empty - # Updates/Creates multiple intents in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse] - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :BatchUpdateIntents, ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest, ::Google::Longrunning::Operation - # Deletes intents in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - rpc :BatchDeleteIntents, ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents.rb deleted file mode 100644 index b69d2a8c2cb5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/intents/credentials" -require "google/cloud/dialogflow/v2/intents/paths" -require "google/cloud/dialogflow/v2/intents/operations" -require "google/cloud/dialogflow/v2/intents/client" -require "google/cloud/dialogflow/v2/intents/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Intent Intents}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/intents" - # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/intents/rest" - # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - module Intents - end - end - end - end -end - -helper_path = ::File.join __dir__, "intents", "helpers.rb" -require "google/cloud/dialogflow/v2/intents/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb deleted file mode 100644 index 5101b9406785..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/client.rb +++ /dev/null @@ -1,1204 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/intent_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Intents - ## - # Client for the Intents service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Intent Intents}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :intents_stub - - ## - # Configure the Intents Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Intents::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Intents clients - # ::Google::Cloud::Dialogflow::V2::Intents::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Intents 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::Dialogflow::V2::Intents::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 - @intents_stub.universe_domain - end - - ## - # Create a new Intents client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Intents 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/dialogflow/v2/intent_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 - - @intents_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Intents::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 - ) - - @intents_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 = @intents_stub.endpoint - config.universe_domain = @intents_stub.universe_domain - config.logger = @intents_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::Intents::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 - @intents_stub.logger - end - - # Service calls - - ## - # Returns the list of all intents in the specified agent. - # - # @overload list_intents(request, options = nil) - # Pass arguments to `list_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intents(parent: nil, language_code: nil, intent_view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_intents` via keyword arguments. Note that at - # least one keyword argument is 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 agent to list all intents from. - # Format: `projects//agent` or `projects//locations//agent`. - # - # Alternatively, you can specify the environment to list intents for. - # Format: `projects//agent/environments/` - # or `projects//locations//agent/environments/`. - # Note: training phrases of the intents will not be returned for non-draft - # environment. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Intent>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Intent>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new - # - # # Call the list_intents method. - # result = client.list_intents 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::Dialogflow::V2::Intent. - # p item - # end - # - def list_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListIntentsRequest - - # Converts hash and nil to 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_intents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_intents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.call_rpc :list_intents, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @intents_stub, :list_intents, 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 - - ## - # Retrieves the specified intent. - # - # @overload get_intent(request, options = nil) - # Pass arguments to `get_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intent(name: nil, language_code: nil, intent_view: nil) - # Pass arguments to `get_intent` via keyword arguments. Note that at - # least one keyword argument is required. To 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 intent. - # Format: `projects//agent/intents/`. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Intent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new - # - # # Call the get_intent method. - # result = client.get_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. - # p result - # - def get_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetIntentRequest - - # Converts hash and nil to 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_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_intent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.call_rpc :get_intent, 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 an intent in the specified agent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload create_intent(request, options = nil) - # Pass arguments to `create_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intent(parent: nil, intent: nil, language_code: nil, intent_view: nil) - # Pass arguments to `create_intent` via keyword arguments. Note that at - # least one keyword argument is 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 agent to create a intent for. - # Format: `projects//agent`. - # @param intent [::Google::Cloud::Dialogflow::V2::Intent, ::Hash] - # Required. The intent to create. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Intent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new - # - # # Call the create_intent method. - # result = client.create_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. - # p result - # - def create_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateIntentRequest - - # Converts hash and nil to 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_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_intent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.call_rpc :create_intent, 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 the specified intent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload update_intent(request, options = nil) - # Pass arguments to `update_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intent(intent: nil, language_code: nil, update_mask: nil, intent_view: nil) - # Pass arguments to `update_intent` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param intent [::Google::Cloud::Dialogflow::V2::Intent, ::Hash] - # Required. The intent to update. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Intent] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new - # - # # Call the update_intent method. - # result = client.update_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. - # p result - # - def update_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest - - # Converts hash and nil to 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_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.intent&.name - header_params["intent.name"] = request.intent.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_intent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.call_rpc :update_intent, 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 specified intent and its direct or indirect followup intents. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload delete_intent(request, options = nil) - # Pass arguments to `delete_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intent(name: nil) - # Pass arguments to `delete_intent` via keyword arguments. Note that at - # least one keyword argument is required. To 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 intent to delete. If this intent has direct or - # indirect followup intents, we also delete them. - # Format: `projects//agent/intents/`. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new - # - # # Call the delete_intent method. - # result = client.delete_intent request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest - - # Converts hash and nil to 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_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_intent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.call_rpc :delete_intent, 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/Creates multiple intents in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsResponse BatchUpdateIntentsResponse} - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_update_intents(request, options = nil) - # Pass arguments to `batch_update_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intents(parent: nil, intent_batch_uri: nil, intent_batch_inline: nil, language_code: nil, update_mask: nil, intent_view: nil) - # Pass arguments to `batch_update_intents` via keyword arguments. Note that at - # least one keyword argument is 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 name of the agent to update or create intents in. - # Format: `projects//agent`. - # @param intent_batch_uri [::String] - # The URI to a Google Cloud Storage file containing intents to update or - # create. The file format can either be a serialized proto (of IntentBatch - # type) or JSON object. Note: The URI must start with "gs://". - # - # Note: The following parameters are mutually exclusive: `intent_batch_uri`, `intent_batch_inline`. 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 intent_batch_inline [::Google::Cloud::Dialogflow::V2::IntentBatch, ::Hash] - # The collection of intents to update or create. - # - # Note: The following parameters are mutually exclusive: `intent_batch_inline`, `intent_batch_uri`. 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 language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new - # - # # Call the batch_update_intents method. - # result = client.batch_update_intents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest - - # Converts hash and nil to 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_intents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_intents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_update_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.call_rpc :batch_update_intents, 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 intents in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_delete_intents(request, options = nil) - # Pass arguments to `batch_delete_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_delete_intents(parent: nil, intents: nil) - # Pass arguments to `batch_delete_intents` via keyword arguments. Note that at - # least one keyword argument is 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 name of the agent to delete all entities types for. Format: - # `projects//agent`. - # @param intents [::Array<::Google::Cloud::Dialogflow::V2::Intent, ::Hash>] - # Required. The collection of intents to delete. Only intent `name` must be - # filled in. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new - # - # # Call the batch_delete_intents method. - # result = client.batch_delete_intents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_delete_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest - - # Converts hash and nil to 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_delete_intents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_delete_intents.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_delete_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.call_rpc :batch_delete_intents, 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 Intents API. - # - # This class represents the configuration for Intents, - # 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::Dialogflow::V2::Intents::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_intents to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Intents::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_intents.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_intents.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::Dialogflow::V2::Intents::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Intents 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_intents - ## - # RPC-specific configuration for `get_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :get_intent - ## - # RPC-specific configuration for `create_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :create_intent - ## - # RPC-specific configuration for `update_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :update_intent - ## - # RPC-specific configuration for `delete_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_intent - ## - # RPC-specific configuration for `batch_update_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_intents - ## - # RPC-specific configuration for `batch_delete_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_intents - - # @private - def initialize parent_rpcs = nil - list_intents_config = parent_rpcs.list_intents if parent_rpcs.respond_to? :list_intents - @list_intents = ::Gapic::Config::Method.new list_intents_config - get_intent_config = parent_rpcs.get_intent if parent_rpcs.respond_to? :get_intent - @get_intent = ::Gapic::Config::Method.new get_intent_config - create_intent_config = parent_rpcs.create_intent if parent_rpcs.respond_to? :create_intent - @create_intent = ::Gapic::Config::Method.new create_intent_config - update_intent_config = parent_rpcs.update_intent if parent_rpcs.respond_to? :update_intent - @update_intent = ::Gapic::Config::Method.new update_intent_config - delete_intent_config = parent_rpcs.delete_intent if parent_rpcs.respond_to? :delete_intent - @delete_intent = ::Gapic::Config::Method.new delete_intent_config - batch_update_intents_config = parent_rpcs.batch_update_intents if parent_rpcs.respond_to? :batch_update_intents - @batch_update_intents = ::Gapic::Config::Method.new batch_update_intents_config - batch_delete_intents_config = parent_rpcs.batch_delete_intents if parent_rpcs.respond_to? :batch_delete_intents - @batch_delete_intents = ::Gapic::Config::Method.new batch_delete_intents_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/credentials.rb deleted file mode 100644 index a03b95f9dcb8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Intents - # Credentials for the Intents API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb deleted file mode 100644 index 47c984e3fb35..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module Intents - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Intents 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 Intents 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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::VERSION - metadata[:"x-goog-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::Dialogflow::V2::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/paths.rb deleted file mode 100644 index 1ec1908f59fd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/paths.rb +++ /dev/null @@ -1,195 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module Intents - # Path helper methods for the Intents API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # @overload agent_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/agent` - # - # @param project [String] - # - # @overload agent_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def agent_path **args - resources = { - "project" => (proc do |project:| - "projects/#{project}/agent" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent" - 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 Context resource string. - # - # @overload context_path(project:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @return [::String] - def context_path **args - resources = { - "context:project:session" => (proc do |project:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - end), - "context:location:project:session" => (proc do |project:, location:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - 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 Intent resource string. - # - # @overload intent_path(project:, intent:) - # The resource will be in the following format: - # - # `projects/{project}/agent/intents/{intent}` - # - # @param project [String] - # @param intent [String] - # - # @overload intent_path(project:, location:, intent:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/intents/{intent}` - # - # @param project [String] - # @param location [String] - # @param intent [String] - # - # @return [::String] - def intent_path **args - resources = { - "intent:project" => (proc do |project:, intent:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/agent/intents/#{intent}" - end), - "intent:location:project" => (proc do |project:, location:, intent:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/intents/#{intent}" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest.rb deleted file mode 100644 index 5d0467a41f69..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/intents/credentials" -require "google/cloud/dialogflow/v2/intents/paths" -require "google/cloud/dialogflow/v2/intents/rest/operations" -require "google/cloud/dialogflow/v2/intents/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Intent Intents}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/intents/rest" - # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - module Intents - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/intents/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb deleted file mode 100644 index 2afea87d4eb8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +++ /dev/null @@ -1,1120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/intent_pb" -require "google/cloud/dialogflow/v2/intents/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Intents - module Rest - ## - # REST client for the Intents service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Intent Intents}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :intents_stub - - ## - # Configure the Intents Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Intents::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Intents clients - # ::Google::Cloud::Dialogflow::V2::Intents::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Intents 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::Dialogflow::V2::Intents::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 - @intents_stub.universe_domain - end - - ## - # Create a new Intents REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Intents 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::Dialogflow::V2::Intents::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 - - @intents_stub = ::Google::Cloud::Dialogflow::V2::Intents::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @intents_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 = @intents_stub.endpoint - config.universe_domain = @intents_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @intents_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Dialogflow::V2::Intents::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 - @intents_stub.logger - end - - # Service calls - - ## - # Returns the list of all intents in the specified agent. - # - # @overload list_intents(request, options = nil) - # Pass arguments to `list_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intents(parent: nil, language_code: nil, intent_view: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_intents` via keyword arguments. Note that at - # least one keyword argument is 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 agent to list all intents from. - # Format: `projects//agent` or `projects//locations//agent`. - # - # Alternatively, you can specify the environment to list intents for. - # Format: `projects//agent/environments/` - # or `projects//locations//agent/environments/`. - # Note: training phrases of the intents will not be returned for non-draft - # environment. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Intent>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Intent>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new - # - # # Call the list_intents method. - # result = client.list_intents 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::Dialogflow::V2::Intent. - # p item - # end - # - def list_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListIntentsRequest - - # Converts hash and nil to an 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_intents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_intents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.list_intents request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @intents_stub, :list_intents, "intents", 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 - - ## - # Retrieves the specified intent. - # - # @overload get_intent(request, options = nil) - # Pass arguments to `get_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intent(name: nil, language_code: nil, intent_view: nil) - # Pass arguments to `get_intent` via keyword arguments. Note that at - # least one keyword argument is required. To 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 intent. - # Format: `projects//agent/intents/`. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new - # - # # Call the get_intent method. - # result = client.get_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. - # p result - # - def get_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetIntentRequest - - # Converts hash and nil to an 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_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_intent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.get_intent 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 an intent in the specified agent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload create_intent(request, options = nil) - # Pass arguments to `create_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intent(parent: nil, intent: nil, language_code: nil, intent_view: nil) - # Pass arguments to `create_intent` via keyword arguments. Note that at - # least one keyword argument is 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 agent to create a intent for. - # Format: `projects//agent`. - # @param intent [::Google::Cloud::Dialogflow::V2::Intent, ::Hash] - # Required. The intent to create. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new - # - # # Call the create_intent method. - # result = client.create_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. - # p result - # - def create_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateIntentRequest - - # Converts hash and nil to an 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_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_intent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.create_intent 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 the specified intent. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload update_intent(request, options = nil) - # Pass arguments to `update_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intent(intent: nil, language_code: nil, update_mask: nil, intent_view: nil) - # Pass arguments to `update_intent` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param intent [::Google::Cloud::Dialogflow::V2::Intent, ::Hash] - # Required. The intent to update. - # @param language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new - # - # # Call the update_intent method. - # result = client.update_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. - # p result - # - def update_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest - - # Converts hash and nil to an 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_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_intent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.update_intent 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 specified intent and its direct or indirect followup intents. - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload delete_intent(request, options = nil) - # Pass arguments to `delete_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intent(name: nil) - # Pass arguments to `delete_intent` via keyword arguments. Note that at - # least one keyword argument is required. To 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 intent to delete. If this intent has direct or - # indirect followup intents, we also delete them. - # Format: `projects//agent/intents/`. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new - # - # # Call the delete_intent method. - # result = client.delete_intent request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest - - # Converts hash and nil to an 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_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_intent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.delete_intent 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/Creates multiple intents in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: - # {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsResponse BatchUpdateIntentsResponse} - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_update_intents(request, options = nil) - # Pass arguments to `batch_update_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_intents(parent: nil, intent_batch_uri: nil, intent_batch_inline: nil, language_code: nil, update_mask: nil, intent_view: nil) - # Pass arguments to `batch_update_intents` via keyword arguments. Note that at - # least one keyword argument is 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 name of the agent to update or create intents in. - # Format: `projects//agent`. - # @param intent_batch_uri [::String] - # The URI to a Google Cloud Storage file containing intents to update or - # create. The file format can either be a serialized proto (of IntentBatch - # type) or JSON object. Note: The URI must start with "gs://". - # - # Note: The following parameters are mutually exclusive: `intent_batch_uri`, `intent_batch_inline`. 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 intent_batch_inline [::Google::Cloud::Dialogflow::V2::IntentBatch, ::Hash] - # The collection of intents to update or create. - # - # Note: The following parameters are mutually exclusive: `intent_batch_inline`, `intent_batch_uri`. 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 language_code [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @param intent_view [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new - # - # # Call the batch_update_intents method. - # result = client.batch_update_intents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest - - # Converts hash and nil to an 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_intents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_intents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_update_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.batch_update_intents 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 intents in the specified agent. - # - # This method is a [long-running - # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - # The returned `Operation` type has the following method-specific fields: - # - # - `metadata`: An empty [Struct - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - # - `response`: An [Empty - # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - # - # Note: You should always train an agent prior to sending it queries. See the - # [training - # documentation](https://cloud.google.com/dialogflow/es/docs/training). - # - # @overload batch_delete_intents(request, options = nil) - # Pass arguments to `batch_delete_intents` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_delete_intents(parent: nil, intents: nil) - # Pass arguments to `batch_delete_intents` via keyword arguments. Note that at - # least one keyword argument is 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 name of the agent to delete all entities types for. Format: - # `projects//agent`. - # @param intents [::Array<::Google::Cloud::Dialogflow::V2::Intent, ::Hash>] - # Required. The collection of intents to delete. Only intent `name` must be - # filled in. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new - # - # # Call the batch_delete_intents method. - # result = client.batch_delete_intents request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is 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_delete_intents request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest - - # Converts hash and nil to an 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_delete_intents.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_delete_intents.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_delete_intents.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @intents_stub.batch_delete_intents 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 Intents REST API. - # - # This class represents the configuration for Intents 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::Dialogflow::V2::Intents::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_intents to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_intents.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_intents.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Intents 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :list_intents - ## - # RPC-specific configuration for `get_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :get_intent - ## - # RPC-specific configuration for `create_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :create_intent - ## - # RPC-specific configuration for `update_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :update_intent - ## - # RPC-specific configuration for `delete_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_intent - ## - # RPC-specific configuration for `batch_update_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_update_intents - ## - # RPC-specific configuration for `batch_delete_intents` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_delete_intents - - # @private - def initialize parent_rpcs = nil - list_intents_config = parent_rpcs.list_intents if parent_rpcs.respond_to? :list_intents - @list_intents = ::Gapic::Config::Method.new list_intents_config - get_intent_config = parent_rpcs.get_intent if parent_rpcs.respond_to? :get_intent - @get_intent = ::Gapic::Config::Method.new get_intent_config - create_intent_config = parent_rpcs.create_intent if parent_rpcs.respond_to? :create_intent - @create_intent = ::Gapic::Config::Method.new create_intent_config - update_intent_config = parent_rpcs.update_intent if parent_rpcs.respond_to? :update_intent - @update_intent = ::Gapic::Config::Method.new update_intent_config - delete_intent_config = parent_rpcs.delete_intent if parent_rpcs.respond_to? :delete_intent - @delete_intent = ::Gapic::Config::Method.new delete_intent_config - batch_update_intents_config = parent_rpcs.batch_update_intents if parent_rpcs.respond_to? :batch_update_intents - @batch_update_intents = ::Gapic::Config::Method.new batch_update_intents_config - batch_delete_intents_config = parent_rpcs.batch_delete_intents if parent_rpcs.respond_to? :batch_delete_intents - @batch_delete_intents = ::Gapic::Config::Method.new batch_delete_intents_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb deleted file mode 100644 index c341fa77a9ec..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb +++ /dev/null @@ -1,947 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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 Dialogflow - module V2 - module Intents - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Intents 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 Intents 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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/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: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{name}:cancel", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb deleted file mode 100644 index a7257b474942..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb +++ /dev/null @@ -1,579 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/intent_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Intents - module Rest - ## - # REST service stub for the Intents 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_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListIntentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListIntentsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListIntentsResponse] - # A result object deserialized from the server's reply - def list_intents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_intents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_intents", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListIntentsResponse.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_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetIntentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # A result object deserialized from the server's reply - def get_intent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_intent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_intent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Intent.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_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateIntentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # A result object deserialized from the server's reply - def create_intent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_intent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_intent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Intent.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_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateIntentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Intent] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # A result object deserialized from the server's reply - def update_intent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_intent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_intent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Intent.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_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteIntentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_intent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_intent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_intent", - 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 batch_update_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_intents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_update_intents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_intents", - 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_delete_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_delete_intents request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_delete_intents_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_delete_intents", - 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_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListIntentsRequest] - # 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_intents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/intents", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/intents", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/intents", - matches: [ - ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/intents", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetIntentRequest] - # 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_intent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/intents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/intents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateIntentRequest] - # 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_intent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/intents", - body: "intent", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/intents", - body: "intent", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateIntentRequest] - # 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_intent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{intent.name}", - body: "intent", - matches: [ - ["intent.name", %r{^projects/[^/]+/agent/intents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{intent.name}", - body: "intent", - matches: [ - ["intent.name", %r{^projects/[^/]+/locations/[^/]+/agent/intents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteIntentRequest] - # 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_intent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/intents/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/intents/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_update_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest] - # 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_intents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/intents:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/intents:batchUpdate", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_delete_intents REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest] - # 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_delete_intents_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/intents:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/intents:batchDelete", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb deleted file mode 100644 index 1eda21b199e1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/knowledge_base.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/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n/google/cloud/dialogflow/v2/knowledge_base.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xfc\x01\n\rKnowledgeBase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x04 \x01(\t:\xaa\x01\xea\x41\xa6\x01\n\'dialogflow.googleapis.com/KnowledgeBase\x12\x32projects/{project}/knowledgeBases/{knowledge_base}\x12Gprojects/{project}/locations/{location}/knowledgeBases/{knowledge_base}\"\x93\x01\n\x19ListKnowledgeBasesRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'dialogflow.googleapis.com/KnowledgeBase\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\"y\n\x1aListKnowledgeBasesResponse\x12\x42\n\x0fknowledge_bases\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.v2.KnowledgeBase\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"X\n\x17GetKnowledgeBaseRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'dialogflow.googleapis.com/KnowledgeBase\"\xa5\x01\n\x1a\x43reateKnowledgeBaseRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\x12\'dialogflow.googleapis.com/KnowledgeBase\x12\x46\n\x0eknowledge_base\x18\x02 \x01(\x0b\x32).google.cloud.dialogflow.v2.KnowledgeBaseB\x03\xe0\x41\x02\"o\n\x1a\x44\x65leteKnowledgeBaseRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'dialogflow.googleapis.com/KnowledgeBase\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x9a\x01\n\x1aUpdateKnowledgeBaseRequest\x12\x46\n\x0eknowledge_base\x18\x01 \x01(\x0b\x32).google.cloud.dialogflow.v2.KnowledgeBaseB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x32\xb4\r\n\x0eKnowledgeBases\x12\xa4\x02\n\x12ListKnowledgeBases\x12\x35.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest\x1a\x36.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse\"\x9e\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x8e\x01\x12&/v2/{parent=projects/*}/knowledgeBasesZ4\x12\x32/v2/{parent=projects/*/locations/*}/knowledgeBasesZ.\x12,/v2/{parent=projects/*/agent}/knowledgeBases\x12\x91\x02\n\x10GetKnowledgeBase\x12\x33.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest\x1a).google.cloud.dialogflow.v2.KnowledgeBase\"\x9c\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8e\x01\x12&/v2/{name=projects/*/knowledgeBases/*}Z4\x12\x32/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.\x12,/v2/{name=projects/*/agent/knowledgeBases/*}\x12\xd8\x02\n\x13\x43reateKnowledgeBase\x12\x36.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest\x1a).google.cloud.dialogflow.v2.KnowledgeBase\"\xdd\x01\xda\x41\x15parent,knowledge_base\x82\xd3\xe4\x93\x02\xbe\x01\"&/v2/{parent=projects/*}/knowledgeBases:\x0eknowledge_baseZD\"2/v2/{parent=projects/*/locations/*}/knowledgeBases:\x0eknowledge_baseZ>\",/v2/{parent=projects/*/agent}/knowledgeBases:\x0eknowledge_base\x12\x84\x02\n\x13\x44\x65leteKnowledgeBase\x12\x36.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest\x1a\x16.google.protobuf.Empty\"\x9c\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\x8e\x01*&/v2/{name=projects/*/knowledgeBases/*}Z4*2/v2/{name=projects/*/locations/*/knowledgeBases/*}Z.*,/v2/{name=projects/*/agent/knowledgeBases/*}\x12\x8a\x03\n\x13UpdateKnowledgeBase\x12\x36.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest\x1a).google.cloud.dialogflow.v2.KnowledgeBase\"\x8f\x02\xda\x41\x1aknowledge_base,update_mask\x82\xd3\xe4\x93\x02\xeb\x01\x32\x35/v2/{knowledge_base.name=projects/*/knowledgeBases/*}:\x0eknowledge_baseZS2A/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}:\x0eknowledge_baseZM2;/v2/{knowledge_base.name=projects/*/agent/knowledgeBases/*}:\x0eknowledge_base\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x98\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x12KnowledgeBaseProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - KnowledgeBase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeBase").msgclass - ListKnowledgeBasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListKnowledgeBasesRequest").msgclass - ListKnowledgeBasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListKnowledgeBasesResponse").msgclass - GetKnowledgeBaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetKnowledgeBaseRequest").msgclass - CreateKnowledgeBaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest").msgclass - DeleteKnowledgeBaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest").msgclass - UpdateKnowledgeBaseRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb deleted file mode 100644 index 8831f7a3fafa..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/knowledge_base.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/knowledge_base_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module KnowledgeBases - # Service for managing - # [KnowledgeBases][google.cloud.dialogflow.v2.KnowledgeBase]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.KnowledgeBases' - - # Returns the list of all knowledge bases of the specified agent. - rpc :ListKnowledgeBases, ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest, ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse - # Retrieves the specified knowledge base. - rpc :GetKnowledgeBase, ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest, ::Google::Cloud::Dialogflow::V2::KnowledgeBase - # Creates a knowledge base. - rpc :CreateKnowledgeBase, ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest, ::Google::Cloud::Dialogflow::V2::KnowledgeBase - # Deletes the specified knowledge base. - rpc :DeleteKnowledgeBase, ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest, ::Google::Protobuf::Empty - # Updates the specified knowledge base. - rpc :UpdateKnowledgeBase, ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest, ::Google::Cloud::Dialogflow::V2::KnowledgeBase - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases.rb deleted file mode 100644 index 71bbb77be3f4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/knowledge_bases/credentials" -require "google/cloud/dialogflow/v2/knowledge_bases/paths" -require "google/cloud/dialogflow/v2/knowledge_bases/client" -require "google/cloud/dialogflow/v2/knowledge_bases/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBases}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/knowledge_bases" - # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/knowledge_bases/rest" - # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new - # - module KnowledgeBases - end - end - end - end -end - -helper_path = ::File.join __dir__, "knowledge_bases", "helpers.rb" -require "google/cloud/dialogflow/v2/knowledge_bases/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb deleted file mode 100644 index 6c17f1be5967..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/client.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 "google/cloud/errors" -require "google/cloud/dialogflow/v2/knowledge_base_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module KnowledgeBases - ## - # Client for the KnowledgeBases service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBases}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :knowledge_bases_stub - - ## - # Configure the KnowledgeBases Client class. - # - # See {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all KnowledgeBases clients - # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::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 - @knowledge_bases_stub.universe_domain - end - - ## - # Create a new KnowledgeBases client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the KnowledgeBases 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/dialogflow/v2/knowledge_base_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 - - @knowledge_bases_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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 - ) - - @knowledge_bases_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 = @knowledge_bases_stub.endpoint - config.universe_domain = @knowledge_bases_stub.universe_domain - config.logger = @knowledge_bases_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 - @knowledge_bases_stub.logger - end - - # Service calls - - ## - # Returns the list of all knowledge bases of the specified agent. - # - # @overload list_knowledge_bases(request, options = nil) - # Pass arguments to `list_knowledge_bases` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_bases(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_knowledge_bases` via keyword arguments. Note that at - # least one keyword argument is 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 project to list of knowledge bases for. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By - # default 10 and at most 100. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # @param filter [::String] - # The filter expression used to filter knowledge bases returned by the list - # method. The expression has the following syntax: - # - # [AND ] ... - # - # The following fields and operators are supported: - # - # * display_name with has(:) operator - # * language_code with equals(=) operator - # - # Examples: - # - # * 'language_code=en-us' matches knowledge bases with en-us language code. - # * 'display_name:articles' matches knowledge bases whose display name - # contains "articles". - # * 'display_name:"Best Articles"' matches knowledge bases whose display - # name contains "Best Articles". - # * 'language_code=en-gb AND display_name=articles' matches all knowledge - # bases whose display name contains "articles" and whose language code is - # "en-gb". - # - # Note: An empty filter string (i.e. "") is a no-op and will result in no - # filtering. - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.new - # - # # Call the list_knowledge_bases method. - # result = client.list_knowledge_bases 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::Dialogflow::V2::KnowledgeBase. - # p item - # end - # - def list_knowledge_bases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest - - # Converts hash and nil to 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_knowledge_bases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_knowledge_bases.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_knowledge_bases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.call_rpc :list_knowledge_bases, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @knowledge_bases_stub, :list_knowledge_bases, 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 - - ## - # Retrieves the specified knowledge base. - # - # @overload get_knowledge_base(request, options = nil) - # Pass arguments to `get_knowledge_base` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_base(name: nil) - # Pass arguments to `get_knowledge_base` via keyword arguments. Note that at - # least one keyword argument is required. To 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 knowledge base to retrieve. - # Format `projects//locations//knowledgeBases/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new - # - # # Call the get_knowledge_base method. - # result = client.get_knowledge_base request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. - # p result - # - def get_knowledge_base request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest - - # Converts hash and nil to 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_knowledge_base.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_knowledge_base.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_knowledge_base.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.call_rpc :get_knowledge_base, 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 knowledge base. - # - # @overload create_knowledge_base(request, options = nil) - # Pass arguments to `create_knowledge_base` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_base(parent: nil, knowledge_base: nil) - # Pass arguments to `create_knowledge_base` via keyword arguments. Note that at - # least one keyword argument is 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 project to create a knowledge base for. - # Format: `projects//locations/`. - # @param knowledge_base [::Google::Cloud::Dialogflow::V2::KnowledgeBase, ::Hash] - # Required. The knowledge base to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new - # - # # Call the create_knowledge_base method. - # result = client.create_knowledge_base request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. - # p result - # - def create_knowledge_base request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest - - # Converts hash and nil to 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_knowledge_base.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_knowledge_base.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_knowledge_base.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.call_rpc :create_knowledge_base, 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 specified knowledge base. - # - # @overload delete_knowledge_base(request, options = nil) - # Pass arguments to `delete_knowledge_base` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_base(name: nil, force: nil) - # Pass arguments to `delete_knowledge_base` via keyword arguments. Note that at - # least one keyword argument is required. To 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 knowledge base to delete. - # Format: `projects//locations//knowledgeBases/`. - # @param force [::Boolean] - # Optional. Force deletes the knowledge base. When set to true, any documents - # in the knowledge base are also 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/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new - # - # # Call the delete_knowledge_base method. - # result = client.delete_knowledge_base request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_knowledge_base request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest - - # Converts hash and nil to 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_knowledge_base.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_knowledge_base.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_knowledge_base.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.call_rpc :delete_knowledge_base, 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 the specified knowledge base. - # - # @overload update_knowledge_base(request, options = nil) - # Pass arguments to `update_knowledge_base` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_base(knowledge_base: nil, update_mask: nil) - # Pass arguments to `update_knowledge_base` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param knowledge_base [::Google::Cloud::Dialogflow::V2::KnowledgeBase, ::Hash] - # Required. The knowledge base to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Not specified means `update all`. - # Currently, only `display_name` can be updated, an InvalidArgument will be - # returned for attempting to update other fields. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new - # - # # Call the update_knowledge_base method. - # result = client.update_knowledge_base request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. - # p result - # - def update_knowledge_base request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest - - # Converts hash and nil to 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_knowledge_base.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.knowledge_base&.name - header_params["knowledge_base.name"] = request.knowledge_base.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_knowledge_base.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_knowledge_base.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.call_rpc :update_knowledge_base, 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 KnowledgeBases API. - # - # This class represents the configuration for KnowledgeBases, - # 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::Dialogflow::V2::KnowledgeBases::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_knowledge_bases to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_knowledge_bases.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_knowledge_bases.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::Dialogflow::V2::KnowledgeBases::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 KnowledgeBases 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_knowledge_bases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_knowledge_bases - ## - # RPC-specific configuration for `get_knowledge_base` - # @return [::Gapic::Config::Method] - # - attr_reader :get_knowledge_base - ## - # RPC-specific configuration for `create_knowledge_base` - # @return [::Gapic::Config::Method] - # - attr_reader :create_knowledge_base - ## - # RPC-specific configuration for `delete_knowledge_base` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_knowledge_base - ## - # RPC-specific configuration for `update_knowledge_base` - # @return [::Gapic::Config::Method] - # - attr_reader :update_knowledge_base - - # @private - def initialize parent_rpcs = nil - list_knowledge_bases_config = parent_rpcs.list_knowledge_bases if parent_rpcs.respond_to? :list_knowledge_bases - @list_knowledge_bases = ::Gapic::Config::Method.new list_knowledge_bases_config - get_knowledge_base_config = parent_rpcs.get_knowledge_base if parent_rpcs.respond_to? :get_knowledge_base - @get_knowledge_base = ::Gapic::Config::Method.new get_knowledge_base_config - create_knowledge_base_config = parent_rpcs.create_knowledge_base if parent_rpcs.respond_to? :create_knowledge_base - @create_knowledge_base = ::Gapic::Config::Method.new create_knowledge_base_config - delete_knowledge_base_config = parent_rpcs.delete_knowledge_base if parent_rpcs.respond_to? :delete_knowledge_base - @delete_knowledge_base = ::Gapic::Config::Method.new delete_knowledge_base_config - update_knowledge_base_config = parent_rpcs.update_knowledge_base if parent_rpcs.respond_to? :update_knowledge_base - @update_knowledge_base = ::Gapic::Config::Method.new update_knowledge_base_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb deleted file mode 100644 index 7ec230c98448..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module KnowledgeBases - # Credentials for the KnowledgeBases API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb deleted file mode 100644 index eb8e676df920..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb +++ /dev/null @@ -1,105 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module KnowledgeBases - # Path helper methods for the KnowledgeBases API. - module Paths - ## - # Create a fully-qualified KnowledgeBase resource string. - # - # @overload knowledge_base_path(project:, knowledge_base:) - # The resource will be in the following format: - # - # `projects/{project}/knowledgeBases/{knowledge_base}` - # - # @param project [String] - # @param knowledge_base [String] - # - # @overload knowledge_base_path(project:, location:, knowledge_base:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}` - # - # @param project [String] - # @param location [String] - # @param knowledge_base [String] - # - # @return [::String] - def knowledge_base_path **args - resources = { - "knowledge_base:project" => (proc do |project:, knowledge_base:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/knowledgeBases/#{knowledge_base}" - end), - "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}" - 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 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 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest.rb deleted file mode 100644 index 437182b882a5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/knowledge_bases/credentials" -require "google/cloud/dialogflow/v2/knowledge_bases/paths" -require "google/cloud/dialogflow/v2/knowledge_bases/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBases}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/knowledge_bases/rest" - # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new - # - module KnowledgeBases - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/knowledge_bases/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb deleted file mode 100644 index 0f32fd6319f8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +++ /dev/null @@ -1,849 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/knowledge_base_pb" -require "google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module KnowledgeBases - module Rest - ## - # REST client for the KnowledgeBases service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBases}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :knowledge_bases_stub - - ## - # Configure the KnowledgeBases Client class. - # - # See {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all KnowledgeBases clients - # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::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 - @knowledge_bases_stub.universe_domain - end - - ## - # Create a new KnowledgeBases REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the KnowledgeBases 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 - - @knowledge_bases_stub = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @knowledge_bases_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 = @knowledge_bases_stub.endpoint - config.universe_domain = @knowledge_bases_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @knowledge_bases_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 - @knowledge_bases_stub.logger - end - - # Service calls - - ## - # Returns the list of all knowledge bases of the specified agent. - # - # @overload list_knowledge_bases(request, options = nil) - # Pass arguments to `list_knowledge_bases` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_bases(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_knowledge_bases` via keyword arguments. Note that at - # least one keyword argument is 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 project to list of knowledge bases for. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # The maximum number of items to return in a single page. By - # default 10 and at most 100. - # @param page_token [::String] - # The next_page_token value returned from a previous list request. - # @param filter [::String] - # The filter expression used to filter knowledge bases returned by the list - # method. The expression has the following syntax: - # - # [AND ] ... - # - # The following fields and operators are supported: - # - # * display_name with has(:) operator - # * language_code with equals(=) operator - # - # Examples: - # - # * 'language_code=en-us' matches knowledge bases with en-us language code. - # * 'display_name:articles' matches knowledge bases whose display name - # contains "articles". - # * 'display_name:"Best Articles"' matches knowledge bases whose display - # name contains "Best Articles". - # * 'language_code=en-gb AND display_name=articles' matches all knowledge - # bases whose display name contains "articles" and whose language code is - # "en-gb". - # - # Note: An empty filter string (i.e. "") is a no-op and will result in no - # filtering. - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.new - # - # # Call the list_knowledge_bases method. - # result = client.list_knowledge_bases 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::Dialogflow::V2::KnowledgeBase. - # p item - # end - # - def list_knowledge_bases request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest - - # Converts hash and nil to an 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_knowledge_bases.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_knowledge_bases.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_knowledge_bases.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.list_knowledge_bases request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @knowledge_bases_stub, :list_knowledge_bases, "knowledge_bases", 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 - - ## - # Retrieves the specified knowledge base. - # - # @overload get_knowledge_base(request, options = nil) - # Pass arguments to `get_knowledge_base` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_base(name: nil) - # Pass arguments to `get_knowledge_base` via keyword arguments. Note that at - # least one keyword argument is required. To 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 knowledge base to retrieve. - # Format `projects//locations//knowledgeBases/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new - # - # # Call the get_knowledge_base method. - # result = client.get_knowledge_base request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. - # p result - # - def get_knowledge_base request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest - - # Converts hash and nil to an 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_knowledge_base.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_knowledge_base.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_knowledge_base.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.get_knowledge_base 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 knowledge base. - # - # @overload create_knowledge_base(request, options = nil) - # Pass arguments to `create_knowledge_base` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_base(parent: nil, knowledge_base: nil) - # Pass arguments to `create_knowledge_base` via keyword arguments. Note that at - # least one keyword argument is 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 project to create a knowledge base for. - # Format: `projects//locations/`. - # @param knowledge_base [::Google::Cloud::Dialogflow::V2::KnowledgeBase, ::Hash] - # Required. The knowledge base to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new - # - # # Call the create_knowledge_base method. - # result = client.create_knowledge_base request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. - # p result - # - def create_knowledge_base request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest - - # Converts hash and nil to an 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_knowledge_base.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_knowledge_base.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_knowledge_base.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.create_knowledge_base 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 specified knowledge base. - # - # @overload delete_knowledge_base(request, options = nil) - # Pass arguments to `delete_knowledge_base` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_base(name: nil, force: nil) - # Pass arguments to `delete_knowledge_base` via keyword arguments. Note that at - # least one keyword argument is required. To 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 knowledge base to delete. - # Format: `projects//locations//knowledgeBases/`. - # @param force [::Boolean] - # Optional. Force deletes the knowledge base. When set to true, any documents - # in the knowledge base are also 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/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new - # - # # Call the delete_knowledge_base method. - # result = client.delete_knowledge_base request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_knowledge_base request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest - - # Converts hash and nil to an 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_knowledge_base.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_knowledge_base.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_knowledge_base.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.delete_knowledge_base 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 the specified knowledge base. - # - # @overload update_knowledge_base(request, options = nil) - # Pass arguments to `update_knowledge_base` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_knowledge_base(knowledge_base: nil, update_mask: nil) - # Pass arguments to `update_knowledge_base` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param knowledge_base [::Google::Cloud::Dialogflow::V2::KnowledgeBase, ::Hash] - # Required. The knowledge base to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Not specified means `update all`. - # Currently, only `display_name` can be updated, an InvalidArgument will be - # returned for attempting to update other fields. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new - # - # # Call the update_knowledge_base method. - # result = client.update_knowledge_base request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. - # p result - # - def update_knowledge_base request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest - - # Converts hash and nil to an 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_knowledge_base.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_knowledge_base.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_knowledge_base.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @knowledge_bases_stub.update_knowledge_base 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 KnowledgeBases REST API. - # - # This class represents the configuration for KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::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_knowledge_bases to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_knowledge_bases.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_knowledge_bases.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 KnowledgeBases 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_knowledge_bases` - # @return [::Gapic::Config::Method] - # - attr_reader :list_knowledge_bases - ## - # RPC-specific configuration for `get_knowledge_base` - # @return [::Gapic::Config::Method] - # - attr_reader :get_knowledge_base - ## - # RPC-specific configuration for `create_knowledge_base` - # @return [::Gapic::Config::Method] - # - attr_reader :create_knowledge_base - ## - # RPC-specific configuration for `delete_knowledge_base` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_knowledge_base - ## - # RPC-specific configuration for `update_knowledge_base` - # @return [::Gapic::Config::Method] - # - attr_reader :update_knowledge_base - - # @private - def initialize parent_rpcs = nil - list_knowledge_bases_config = parent_rpcs.list_knowledge_bases if parent_rpcs.respond_to? :list_knowledge_bases - @list_knowledge_bases = ::Gapic::Config::Method.new list_knowledge_bases_config - get_knowledge_base_config = parent_rpcs.get_knowledge_base if parent_rpcs.respond_to? :get_knowledge_base - @get_knowledge_base = ::Gapic::Config::Method.new get_knowledge_base_config - create_knowledge_base_config = parent_rpcs.create_knowledge_base if parent_rpcs.respond_to? :create_knowledge_base - @create_knowledge_base = ::Gapic::Config::Method.new create_knowledge_base_config - delete_knowledge_base_config = parent_rpcs.delete_knowledge_base if parent_rpcs.respond_to? :delete_knowledge_base - @delete_knowledge_base = ::Gapic::Config::Method.new delete_knowledge_base_config - update_knowledge_base_config = parent_rpcs.update_knowledge_base if parent_rpcs.respond_to? :update_knowledge_base - @update_knowledge_base = ::Gapic::Config::Method.new update_knowledge_base_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb deleted file mode 100644 index 7b40468fbfd7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/knowledge_bases/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/dialogflow/v2/knowledge_base_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module KnowledgeBases - module Rest - ## - # REST service stub for the KnowledgeBases 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_knowledge_bases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListKnowledgeBasesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse] - # A result object deserialized from the server's reply - def list_knowledge_bases request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_knowledge_bases_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_knowledge_bases", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse.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_knowledge_base REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::KnowledgeBase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # A result object deserialized from the server's reply - def get_knowledge_base request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_knowledge_base_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_knowledge_base", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.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_knowledge_base REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::KnowledgeBase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # A result object deserialized from the server's reply - def create_knowledge_base request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_knowledge_base_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_knowledge_base", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.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_knowledge_base REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_knowledge_base request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_knowledge_base_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_knowledge_base", - 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_knowledge_base REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::KnowledgeBase] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # A result object deserialized from the server's reply - def update_knowledge_base request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_knowledge_base_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_knowledge_base", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.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_knowledge_bases REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest] - # 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_knowledge_bases_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/knowledgeBases", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/knowledgeBases", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/knowledgeBases", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_knowledge_base REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest] - # 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_knowledge_base_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_knowledge_base REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest] - # 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_knowledge_base_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/knowledgeBases", - body: "knowledge_base", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/knowledgeBases", - body: "knowledge_base", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/knowledgeBases", - body: "knowledge_base", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_knowledge_base REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest] - # 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_knowledge_base_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_knowledge_base REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest] - # 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_knowledge_base_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{knowledge_base.name}", - body: "knowledge_base", - matches: [ - ["knowledge_base.name", %r{^projects/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{knowledge_base.name}", - body: "knowledge_base", - matches: [ - ["knowledge_base.name", %r{^projects/[^/]+/locations/[^/]+/knowledgeBases/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{knowledge_base.name}", - body: "knowledge_base", - matches: [ - ["knowledge_base.name", %r{^projects/[^/]+/agent/knowledgeBases/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/operations_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/operations_pb.rb deleted file mode 100644 index 79b84f1e19ab..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/operations_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/operations.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n+google/cloud/dialogflow/v2/operations.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"I\n$GeneratorEvaluationOperationMetadata\x12!\n\x14generator_evaluation\x18\x01 \x01(\tB\x03\xe0\x41\x03\x42\x95\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0fOperationsProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - GeneratorEvaluationOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GeneratorEvaluationOperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb deleted file mode 100644 index 87b3df01c38b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb +++ /dev/null @@ -1,92 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/participant.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/dialogflow/v2/audio_config_pb' -require 'google/cloud/dialogflow/v2/generator_pb' -require 'google/cloud/dialogflow/v2/session_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n,google/cloud/dialogflow/v2/participant.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a*google/cloud/dialogflow/v2/generator.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf8\x06\n\x0bParticipant\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12?\n\x04role\x18\x02 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x05\x12&\n\x19sip_recording_media_label\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12(\n\x1bobfuscated_external_user_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12n\n\x1a\x64ocuments_metadata_filters\x18\x08 \x03(\x0b\x32\x45.google.cloud.dialogflow.v2.Participant.DocumentsMetadataFiltersEntryB\x03\xe0\x41\x01\x12]\n\x14\x61gent_desktop_source\x18\n \x01(\x0e\x32:.google.cloud.dialogflow.v2.Participant.AgentDesktopSourceB\x03\xe0\x41\x01\x1a?\n\x1d\x44ocumentsMetadataFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"P\n\x04Role\x12\x14\n\x10ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHUMAN_AGENT\x10\x01\x12\x13\n\x0f\x41UTOMATED_AGENT\x10\x02\x12\x0c\n\x08\x45ND_USER\x10\x03\"\x85\x01\n\x12\x41gentDesktopSource\x12$\n AGENT_DESKTOP_SOURCE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bLIVE_PERSON\x10\x01\x12\x11\n\rGENESYS_CLOUD\x10\x02\x12\n\n\x06TWILIO\x10\x03\x12\x0e\n\nSALESFORCE\x10\x04\x12\t\n\x05OTHER\x10\x08:\xd8\x01\xea\x41\xd4\x01\n%dialogflow.googleapis.com/Participant\x12Jprojects/{project}/conversations/{conversation}/participants/{participant}\x12_projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}\"\x8c\x05\n\x07Message\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ontent\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bparticipant\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12K\n\x10participant_role\x18\x05 \x01(\x0e\x32,.google.cloud.dialogflow.v2.Participant.RoleB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x32\n\tsend_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12N\n\x12message_annotation\x18\x07 \x01(\x0b\x32-.google.cloud.dialogflow.v2.MessageAnnotationB\x03\xe0\x41\x03\x12T\n\x12sentiment_analysis\x18\x08 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SentimentAnalysisResultB\x03\xe0\x41\x03:\xc4\x01\xea\x41\xc0\x01\n!dialogflow.googleapis.com/Message\x12\x42projects/{project}/conversations/{conversation}/messages/{message}\x12Wprojects/{project}/locations/{location}/conversations/{conversation}/messages/{message}\"\x9c\x01\n\x18\x43reateParticipantRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Participant\x12\x41\n\x0bparticipant\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.ParticipantB\x03\xe0\x41\x02\"T\n\x15GetParticipantRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\"\x89\x01\n\x17ListParticipantsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%dialogflow.googleapis.com/Participant\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\"r\n\x18ListParticipantsResponse\x12=\n\x0cparticipants\x18\x01 \x03(\x0b\x32\'.google.cloud.dialogflow.v2.Participant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x93\x01\n\x18UpdateParticipantRequest\x12\x41\n\x0bparticipant\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.ParticipantB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\x8a\x05\n\x15\x41nalyzeContentRequest\x12\x42\n\x0bparticipant\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12;\n\ntext_input\x18\x06 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputH\x00\x12=\n\x0b\x61udio_input\x18\x07 \x01(\x0b\x32&.google.cloud.dialogflow.v2.AudioInputH\x00\x12=\n\x0b\x65vent_input\x18\x08 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInputH\x00\x12G\n\x10suggestion_input\x18\x0c \x01(\x0b\x32+.google.cloud.dialogflow.v2.SuggestionInputH\x00\x12I\n\x12reply_audio_config\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x41\n\x0cquery_params\x18\t \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12N\n\x13\x61ssist_query_params\x18\x0e \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\n\rcx_parameters\x18\x12 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x12\n\nrequest_id\x18\x0b \x01(\tB\x07\n\x05input\",\n\x0e\x44tmfParameters\x12\x1a\n\x12\x61\x63\x63\x65pts_dtmf_input\x18\x01 \x01(\x08\"\xde\x03\n\x16\x41nalyzeContentResponse\x12\x12\n\nreply_text\x18\x01 \x01(\t\x12<\n\x0breply_audio\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.OutputAudio\x12N\n\x15\x61utomated_agent_reply\x18\x03 \x01(\x0b\x32/.google.cloud.dialogflow.v2.AutomatedAgentReply\x12\x34\n\x07message\x18\x05 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12T\n\x1ehuman_agent_suggestion_results\x18\x06 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\n\x1b\x65nd_user_suggestion_results\x18\x07 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12\x43\n\x0f\x64tmf_parameters\x18\t \x01(\x0b\x32*.google.cloud.dialogflow.v2.DtmfParameters\"\xa6\x06\n\x1eStreamingAnalyzeContentRequest\x12\x42\n\x0bparticipant\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x44\n\x0c\x61udio_config\x18\x02 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigH\x00\x12\x42\n\x0btext_config\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.v2.InputTextConfigH\x00\x12I\n\x12reply_audio_config\x18\x04 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\x15\n\x0binput_audio\x18\x05 \x01(\x0cH\x01\x12\x14\n\ninput_text\x18\x06 \x01(\tH\x01\x12\x45\n\ninput_dtmf\x18\t \x01(\x0b\x32/.google.cloud.dialogflow.v2.TelephonyDtmfEventsH\x01\x12\x41\n\x0cquery_params\x18\x07 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12N\n\x13\x61ssist_query_params\x18\x08 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\x12.\n\rcx_parameters\x18\r \x01(\x0b\x32\x17.google.protobuf.Struct\x12&\n\x19\x65nable_extended_streaming\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01\x12\x31\n$enable_partial_automated_agent_reply\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x12\'\n\x1aoutput_multiple_utterances\x18\x12 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x15\x65nable_debugging_info\x18\x13 \x01(\x08\x42\x08\n\x06\x63onfigB\x07\n\x05input\"\xa5\x05\n\x1fStreamingAnalyzeContentResponse\x12R\n\x12recognition_result\x18\x01 \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.StreamingRecognitionResult\x12\x12\n\nreply_text\x18\x02 \x01(\t\x12<\n\x0breply_audio\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.OutputAudio\x12N\n\x15\x61utomated_agent_reply\x18\x04 \x01(\x0b\x32/.google.cloud.dialogflow.v2.AutomatedAgentReply\x12\x34\n\x07message\x18\x06 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Message\x12T\n\x1ehuman_agent_suggestion_results\x18\x07 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12Q\n\x1b\x65nd_user_suggestion_results\x18\x08 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SuggestionResult\x12\x43\n\x0f\x64tmf_parameters\x18\n \x01(\x0b\x32*.google.cloud.dialogflow.v2.DtmfParameters\x12R\n\x0e\x64\x65\x62ugging_info\x18\x0b \x01(\x0b\x32:.google.cloud.dialogflow.v2.CloudConversationDebuggingInfo\x12\x14\n\x0cspeech_model\x18\r \x01(\t\"\x85\x02\n\x16SuggestArticlesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12N\n\x13\x61ssist_query_params\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\"\x8b\x01\n\x17SuggestArticlesResponse\x12\x42\n\x0f\x61rticle_answers\x18\x01 \x03(\x0b\x32).google.cloud.dialogflow.v2.ArticleAnswer\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\x87\x02\n\x18SuggestFaqAnswersRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12N\n\x13\x61ssist_query_params\x18\x04 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.AssistQueryParameters\"\x85\x01\n\x19SuggestFaqAnswersResponse\x12:\n\x0b\x66\x61q_answers\x18\x01 \x03(\x0b\x32%.google.cloud.dialogflow.v2.FaqAnswer\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\xa1\x03\n\x1bGenerateSuggestionsResponse\x12w\n\x1cgenerator_suggestion_answers\x18\x01 \x03(\x0b\x32Q.google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x1a\xc8\x01\n\x19GeneratorSuggestionAnswer\x12M\n\x14generator_suggestion\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.GeneratorSuggestion\x12\x18\n\x10source_generator\x18\x02 \x01(\t\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\"\xf4\x01\n\x1aSuggestSmartRepliesRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x12\x63urrent_text_input\x18\x04 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInput\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"\xc3\x01\n\x1bSuggestSmartRepliesResponse\x12N\n\x13smart_reply_answers\x18\x01 \x03(\x0b\x32,.google.cloud.dialogflow.v2.SmartReplyAnswerB\x03\xe0\x41\x03\x12>\n\x0elatest_message\x18\x02 \x01(\tB&\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\"c\n\nAudioInput\x12\x41\n\x06\x63onfig\x18\x01 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigB\x03\xe0\x41\x02\x12\x12\n\x05\x61udio\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\"[\n\x0bOutputAudio\x12=\n\x06\x63onfig\x18\x01 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12\r\n\x05\x61udio\x18\x02 \x01(\x0c\"\xe8\x02\n\x13\x41utomatedAgentReply\x12P\n\x16\x64\x65tect_intent_response\x18\x01 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.DetectIntentResponse\x12k\n\x1a\x61utomated_agent_reply_type\x18\x07 \x01(\x0e\x32G.google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType\x12\x1a\n\x12\x61llow_cancellation\x18\x08 \x01(\x08\x12\x17\n\x0f\x63x_current_page\x18\x0b \x01(\t\"]\n\x17\x41utomatedAgentReplyType\x12*\n&AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PARTIAL\x10\x01\x12\t\n\x05\x46INAL\x10\x02\"\xe4\x01\n\rArticleAnswer\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08snippets\x18\x03 \x03(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12I\n\x08metadata\x18\x05 \x03(\x0b\x32\x37.google.cloud.dialogflow.v2.ArticleAnswer.MetadataEntry\x12\x15\n\ranswer_record\x18\x06 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe0\x01\n\tFaqAnswer\x12\x0e\n\x06\x61nswer\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x10\n\x08question\x18\x03 \x01(\t\x12\x0e\n\x06source\x18\x04 \x01(\t\x12\x45\n\x08metadata\x18\x05 \x03(\x0b\x32\x33.google.cloud.dialogflow.v2.FaqAnswer.MetadataEntry\x12\x15\n\ranswer_record\x18\x06 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"y\n\x10SmartReplyAnswer\x12\r\n\x05reply\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x42\n\ranswer_record\x18\x03 \x01(\tB+\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\"\\\n\x10IntentSuggestion\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\tintent_v2\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x08\n\x06intent\"\xc5\x01\n\x16\x44ialogflowAssistAnswer\x12?\n\x0cquery_result\x18\x01 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResultH\x00\x12I\n\x11intent_suggestion\x18\x05 \x01(\x0b\x32,.google.cloud.dialogflow.v2.IntentSuggestionH\x00\x12\x15\n\ranswer_record\x18\x02 \x01(\tB\x08\n\x06result\"\xb5\x04\n\x10SuggestionResult\x12#\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.StatusH\x00\x12X\n\x19suggest_articles_response\x18\x02 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SuggestArticlesResponseH\x00\x12g\n!suggest_knowledge_assist_response\x18\x08 \x01(\x0b\x32:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponseH\x00\x12]\n\x1csuggest_faq_answers_response\x18\x03 \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.SuggestFaqAnswersResponseH\x00\x12\x61\n\x1esuggest_smart_replies_response\x18\x04 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.SuggestSmartRepliesResponseH\x00\x12`\n\x1dgenerate_suggestions_response\x18\t \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.GenerateSuggestionsResponseH\x00\x42\x15\n\x13suggestion_response\"-\n\x0fInputTextConfig\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\"j\n\x14\x41nnotatedMessagePart\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x13\n\x0b\x65ntity_type\x18\x02 \x01(\t\x12/\n\x0f\x66ormatted_value\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\"n\n\x11MessageAnnotation\x12?\n\x05parts\x18\x01 \x03(\x0b\x32\x30.google.cloud.dialogflow.v2.AnnotatedMessagePart\x12\x18\n\x10\x63ontain_entities\x18\x02 \x01(\x08\"\xa3\x02\n\x0fSuggestionInput\x12\x1a\n\ranswer_record\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x30\n\nparameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12G\n\x06\x61\x63tion\x18\x05 \x01(\x0e\x32\x32.google.cloud.dialogflow.v2.SuggestionInput.ActionB\x03\xe0\x41\x01\x12\x32\n\tsend_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"E\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\n\n\x06\x43\x41NCEL\x10\x01\x12\n\n\x06REVISE\x10\x02\x12\x0b\n\x07\x43ONFIRM\x10\x03\"\xcd\x01\n\x15\x41ssistQueryParameters\x12s\n\x1a\x64ocuments_metadata_filters\x18\x01 \x03(\x0b\x32O.google.cloud.dialogflow.v2.AssistQueryParameters.DocumentsMetadataFiltersEntry\x1a?\n\x1d\x44ocumentsMetadataFiltersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xe3\x01\n\x1dSuggestKnowledgeAssistRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%dialogflow.googleapis.com/Participant\x12\x41\n\x0elatest_message\x18\x02 \x01(\tB)\xe0\x41\x01\xfa\x41#\n!dialogflow.googleapis.com/Message\x12\x19\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12%\n\x18previous_suggested_query\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xab\x02\n\x1eSuggestKnowledgeAssistResponse\x12W\n\x17knowledge_assist_answer\x18\x01 \x01(\x0b\x32\x31.google.cloud.dialogflow.v2.KnowledgeAssistAnswerB\x03\xe0\x41\x03\x12\x16\n\x0elatest_message\x18\x02 \x01(\t\x12\x14\n\x0c\x63ontext_size\x18\x03 \x01(\x05\x12\x81\x01\n\"additional_suggested_query_results\x18\x04 \x03(\x0b\x32P.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResultB\x03\xe0\x41\x01\"\xb9\x05\n!IngestedContextReferenceDebugInfo\x12\x1f\n\x17project_not_allowlisted\x18\x01 \x01(\x08\x12#\n\x1b\x63ontext_reference_retrieved\x18\x02 \x01(\x08\x12\x80\x01\n\x1eingested_parameters_debug_info\x18\x03 \x03(\x0b\x32X.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo\x1a\xca\x03\n\x1aIngestedParameterDebugInfo\x12\x11\n\tparameter\x18\x01 \x01(\t\x12\x82\x01\n\x10ingestion_status\x18\x02 \x01(\x0e\x32h.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus\"\x93\x02\n\x0fIngestionStatus\x12 \n\x1cINGESTION_STATUS_UNSPECIFIED\x10\x00\x12\x1e\n\x1aINGESTION_STATUS_SUCCEEDED\x10\x01\x12*\n&INGESTION_STATUS_CONTEXT_NOT_AVAILABLE\x10\x02\x12!\n\x1dINGESTION_STATUS_PARSE_FAILED\x10\x03\x12\"\n\x1eINGESTION_STATUS_INVALID_ENTRY\x10\x04\x12#\n\x1fINGESTION_STATUS_INVALID_FORMAT\x10\x05\x12&\n\"INGESTION_STATUS_LANGUAGE_MISMATCH\x10\x06\"\x97\x02\n\x0eServiceLatency\x12\x65\n\x1ainternal_service_latencies\x18\x01 \x03(\x0b\x32\x41.google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency\x1a\x9d\x01\n\x16InternalServiceLatency\x12\x0c\n\x04step\x18\x01 \x01(\t\x12\x12\n\nlatency_ms\x18\x02 \x01(\x02\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x31\n\rcomplete_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8c\x12\n\x18KnowledgeAssistDebugInfo\x12z\n\x1fquery_generation_failure_reason\x18\x01 \x01(\x0e\x32Q.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason\x12\x82\x01\n#query_categorization_failure_reason\x18\x02 \x01(\x0e\x32U.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason\x12V\n\x19\x64\x61tastore_response_reason\x18\x03 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.DatastoreResponseReason\x12o\n\x19knowledge_assist_behavior\x18\x04 \x01(\x0b\x32L.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior\x12l\n%ingested_context_reference_debug_info\x18\x05 \x01(\x0b\x32=.google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo\x12\x43\n\x0fservice_latency\x18\x06 \x01(\x0b\x32*.google.cloud.dialogflow.v2.ServiceLatency\x12r\n\x1bquery_generation_debug_info\x18\x07 \x01(\x0b\x32M.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo\x12/\n\x0e\x63\x65s_debug_info\x18\x08 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\xb9\x05\n\x17KnowledgeAssistBehavior\x12%\n\x1d\x61nswer_generation_rewriter_on\x18\x01 \x01(\x08\x12\"\n\x1a\x65nd_user_metadata_included\x18\x02 \x01(\x08\x12\x19\n\x11return_query_only\x18\x04 \x01(\x08\x12\x1b\n\x13use_pubsub_delivery\x18\x05 \x01(\x08\x12\x1d\n\x15\x64isable_sync_delivery\x18\x06 \x01(\x08\x12!\n\x19previous_queries_included\x18\x07 \x01(\x08\x12\x1e\n\x16use_translated_message\x18\x08 \x01(\x08\x12&\n\x1euse_custom_safety_filter_level\x18\t \x01(\x08\x12\x33\n+conversation_transcript_has_mixed_languages\x18\n \x01(\x08\x12\x30\n(query_generation_agent_language_mismatch\x18\x0b \x01(\x08\x12\x33\n+query_generation_end_user_language_mismatch\x18\x0c \x01(\x08\x12%\n\x1dthird_party_connector_allowed\x18\r \x01(\x08\x12\"\n\x1amultiple_queries_generated\x18\x0e \x01(\x08\x12&\n\x1equery_contained_search_context\x18\x0f \x01(\x08\x12.\n&invalid_items_query_suggestion_skipped\x18\x10 \x01(\x08\x12+\n#primary_query_redacted_and_replaced\x18\x11 \x01(\x08\x12%\n\x1d\x61ppended_search_context_count\x18\x12 \x01(\x05\x1aq\n\x18QueryGenerationDebugInfo\x12\x1a\n\x12prompt_token_count\x18\x01 \x01(\x05\x12\x1e\n\x16\x63\x61ndidates_token_count\x18\x02 \x01(\x05\x12\x19\n\x11total_token_count\x18\x03 \x01(\x05\"\xcf\x03\n\x1cQueryGenerationFailureReason\x12/\n+QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12!\n\x1dQUERY_GENERATION_OUT_OF_QUOTA\x10\x01\x12\x1b\n\x17QUERY_GENERATION_FAILED\x10\x02\x12\'\n#QUERY_GENERATION_NO_QUERY_GENERATED\x10\x03\x12\x1f\n\x1bQUERY_GENERATION_RAI_FAILED\x10\x04\x12\x14\n\x10NOT_IN_ALLOWLIST\x10\x05\x12#\n\x1fQUERY_GENERATION_QUERY_REDACTED\x10\x06\x12.\n*QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED\x10\n\x12\'\n#QUERY_GENERATION_EMPTY_CONVERSATION\x10\x0b\x12\'\n#QUERY_GENERATION_EMPTY_LAST_MESSAGE\x10\x0c\x12\x37\n3QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET\x10\r\"\xcc\x01\n QueryCategorizationFailureReason\x12\x33\n/QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED\x10\x00\x12\'\n#QUERY_CATEGORIZATION_INVALID_CONFIG\x10\x01\x12)\n%QUERY_CATEGORIZATION_RESULT_NOT_FOUND\x10\x02\x12\x1f\n\x1bQUERY_CATEGORIZATION_FAILED\x10\x03\"\xc1\x0c\n\x15KnowledgeAssistAnswer\x12Y\n\x0fsuggested_query\x18\x01 \x01(\x0b\x32@.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery\x12\x61\n\x16suggested_query_answer\x18\x02 \x01(\x0b\x32\x41.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer\x12\x15\n\ranswer_record\x18\x03 \x01(\t\x12Y\n\x1bknowledge_assist_debug_info\x18\x07 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo\x1a\xc9\x01\n\x0eSuggestedQuery\x12\x12\n\nquery_text\x18\x01 \x01(\t\x12l\n\x0fsearch_contexts\x18\x04 \x03(\x0b\x32N.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContextB\x03\xe0\x41\x01\x1a\x35\n\rSearchContext\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\xc7\x01\n\x1e\x41\x64\x64itionalSuggestedQueryResult\x12^\n\x0fsuggested_query\x18\x01 \x01(\x0b\x32@.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQueryB\x03\xe0\x41\x03\x12\x45\n\ranswer_record\x18\x05 \x01(\tB.\xe0\x41\x03\xfa\x41(\n&dialogflow.googleapis.com/AnswerRecord\x1a\xe1\x06\n\x0fKnowledgeAnswer\x12\x13\n\x0b\x61nswer_text\x18\x01 \x01(\t\x12\x61\n\nfaq_source\x18\x03 \x01(\x0b\x32K.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSourceH\x00\x12o\n\x11generative_source\x18\x04 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\x00\x12m\n\x0fplaybook_source\x18\x07 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceH\x00\x12\x65\n\x0c\x65vent_source\x18\x08 \x01(\x0b\x32M.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSourceH\x00\x1a\x1d\n\tFaqSource\x12\x10\n\x08question\x18\x02 \x01(\t\x1a\xe0\x01\n\x10GenerativeSource\x12l\n\x08snippets\x18\x01 \x03(\x0b\x32Z.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet\x1a^\n\x07Snippet\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\r\n\x05title\x18\x04 \x01(\t\x12)\n\x08metadata\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x1a\x82\x01\n\x0b\x45ventSource\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x64\n\x08snippets\x18\x02 \x01(\x0b\x32R.google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSourceB\x08\n\x06source*\xd6\x02\n\x17\x44\x61tastoreResponseReason\x12)\n%DATASTORE_RESPONSE_REASON_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x17\n\x13SEARCH_OUT_OF_QUOTA\x10\x02\x12\x18\n\x14SEARCH_EMPTY_RESULTS\x10\x03\x12%\n!ANSWER_GENERATION_GEN_AI_DISABLED\x10\x04\x12\"\n\x1e\x41NSWER_GENERATION_OUT_OF_QUOTA\x10\x05\x12\x1b\n\x17\x41NSWER_GENERATION_ERROR\x10\x06\x12%\n!ANSWER_GENERATION_NOT_ENOUGH_INFO\x10\x07\x12 \n\x1c\x41NSWER_GENERATION_RAI_FAILED\x10\x08\x12\"\n\x1e\x41NSWER_GENERATION_NOT_GROUNDED\x10\t2\xfa\x18\n\x0cParticipants\x12\xa5\x02\n\x11\x43reateParticipant\x12\x34.google.cloud.dialogflow.v2.CreateParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\xb0\x01\xda\x41\x12parent,participant\x82\xd3\xe4\x93\x02\x94\x01\"4/v2/{parent=projects/*/conversations/*}/participants:\x0bparticipantZO\"@/v2/{parent=projects/*/locations/*/conversations/*}/participants:\x0bparticipant\x12\xf6\x01\n\x0eGetParticipant\x12\x31.google.cloud.dialogflow.v2.GetParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\x12\x34/v2/{name=projects/*/conversations/*/participants/*}ZB\x12@/v2/{name=projects/*/locations/*/conversations/*/participants/*}\x12\x89\x02\n\x10ListParticipants\x12\x33.google.cloud.dialogflow.v2.ListParticipantsRequest\x1a\x34.google.cloud.dialogflow.v2.ListParticipantsResponse\"\x89\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02z\x12\x34/v2/{parent=projects/*/conversations/*}/participantsZB\x12@/v2/{parent=projects/*/locations/*/conversations/*}/participants\x12\xc2\x02\n\x11UpdateParticipant\x12\x34.google.cloud.dialogflow.v2.UpdateParticipantRequest\x1a\'.google.cloud.dialogflow.v2.Participant\"\xcd\x01\xda\x41\x17participant,update_mask\x82\xd3\xe4\x93\x02\xac\x01\x32@/v2/{participant.name=projects/*/conversations/*/participants/*}:\x0bparticipantZ[2L/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}:\x0bparticipant\x12\xfa\x02\n\x0e\x41nalyzeContent\x12\x31.google.cloud.dialogflow.v2.AnalyzeContentRequest\x1a\x32.google.cloud.dialogflow.v2.AnalyzeContentResponse\"\x80\x02\xda\x41\x16participant,text_input\xda\x41\x17participant,event_input\xda\x41\x17participant,audio_input\x82\xd3\xe4\x93\x02\xac\x01\"J/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent:\x01*Z[\"V/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent:\x01*\x12\x98\x01\n\x17StreamingAnalyzeContent\x12:.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest\x1a;.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse\"\x00(\x01\x30\x01\x12\xc9\x02\n\x0fSuggestArticles\x12\x32.google.cloud.dialogflow.v2.SuggestArticlesRequest\x1a\x33.google.cloud.dialogflow.v2.SuggestArticlesResponse\"\xcc\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xbc\x01\"R/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*Zc\"^/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles:\x01*\x12\xd3\x02\n\x11SuggestFaqAnswers\x12\x34.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest\x1a\x35.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse\"\xd0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xc0\x01\"T/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*Ze\"`/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers:\x01*\x12\xdd\x02\n\x13SuggestSmartReplies\x12\x36.google.cloud.dialogflow.v2.SuggestSmartRepliesRequest\x1a\x37.google.cloud.dialogflow.v2.SuggestSmartRepliesResponse\"\xd4\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xc4\x01\"V/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*Zg\"b/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies:\x01*\x12\xe3\x02\n\x16SuggestKnowledgeAssist\x12\x39.google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest\x1a:.google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse\"\xd1\x01\x82\xd3\xe4\x93\x02\xca\x01\"Y/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*Zj\"e/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestKnowledgeAssist:\x01*\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x96\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x10ParticipantProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - Participant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Participant").msgclass - Participant::Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Participant.Role").enummodule - Participant::AgentDesktopSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Participant.AgentDesktopSource").enummodule - Message = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Message").msgclass - CreateParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateParticipantRequest").msgclass - GetParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetParticipantRequest").msgclass - ListParticipantsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListParticipantsRequest").msgclass - ListParticipantsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListParticipantsResponse").msgclass - UpdateParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateParticipantRequest").msgclass - AnalyzeContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentRequest").msgclass - DtmfParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DtmfParameters").msgclass - AnalyzeContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentResponse").msgclass - StreamingAnalyzeContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest").msgclass - StreamingAnalyzeContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse").msgclass - SuggestArticlesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesRequest").msgclass - SuggestArticlesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesResponse").msgclass - SuggestFaqAnswersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestFaqAnswersRequest").msgclass - SuggestFaqAnswersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestFaqAnswersResponse").msgclass - GenerateSuggestionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateSuggestionsResponse").msgclass - GenerateSuggestionsResponse::GeneratorSuggestionAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GenerateSuggestionsResponse.GeneratorSuggestionAnswer").msgclass - SuggestSmartRepliesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestSmartRepliesRequest").msgclass - SuggestSmartRepliesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestSmartRepliesResponse").msgclass - AudioInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AudioInput").msgclass - OutputAudio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudio").msgclass - AutomatedAgentReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AutomatedAgentReply").msgclass - AutomatedAgentReply::AutomatedAgentReplyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType").enummodule - ArticleAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ArticleAnswer").msgclass - FaqAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FaqAnswer").msgclass - SmartReplyAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyAnswer").msgclass - IntentSuggestion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IntentSuggestion").msgclass - DialogflowAssistAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DialogflowAssistAnswer").msgclass - SuggestionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionResult").msgclass - InputTextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputTextConfig").msgclass - AnnotatedMessagePart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnnotatedMessagePart").msgclass - MessageAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.MessageAnnotation").msgclass - SuggestionInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionInput").msgclass - SuggestionInput::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionInput.Action").enummodule - AssistQueryParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AssistQueryParameters").msgclass - SuggestKnowledgeAssistRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestKnowledgeAssistRequest").msgclass - SuggestKnowledgeAssistResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestKnowledgeAssistResponse").msgclass - IngestedContextReferenceDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo").msgclass - IngestedContextReferenceDebugInfo::IngestedParameterDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo").msgclass - IngestedContextReferenceDebugInfo::IngestedParameterDebugInfo::IngestionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus").enummodule - ServiceLatency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ServiceLatency").msgclass - ServiceLatency::InternalServiceLatency = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ServiceLatency.InternalServiceLatency").msgclass - KnowledgeAssistDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo").msgclass - KnowledgeAssistDebugInfo::KnowledgeAssistBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior").msgclass - KnowledgeAssistDebugInfo::QueryGenerationDebugInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationDebugInfo").msgclass - KnowledgeAssistDebugInfo::QueryGenerationFailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryGenerationFailureReason").enummodule - KnowledgeAssistDebugInfo::QueryCategorizationFailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason").enummodule - KnowledgeAssistAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer").msgclass - KnowledgeAssistAnswer::SuggestedQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery").msgclass - KnowledgeAssistAnswer::SuggestedQuery::SearchContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.SuggestedQuery.SearchContext").msgclass - KnowledgeAssistAnswer::AdditionalSuggestedQueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.AdditionalSuggestedQueryResult").msgclass - KnowledgeAssistAnswer::KnowledgeAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer").msgclass - KnowledgeAssistAnswer::KnowledgeAnswer::FaqSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.FaqSource").msgclass - KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource").msgclass - KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource::Snippet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.GenerativeSource.Snippet").msgclass - KnowledgeAssistAnswer::KnowledgeAnswer::EventSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.KnowledgeAssistAnswer.KnowledgeAnswer.EventSource").msgclass - DatastoreResponseReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DatastoreResponseReason").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb deleted file mode 100644 index 267aafd6ef5a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +++ /dev/null @@ -1,85 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/participant.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/participant_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Participants - # Service for managing [Participants][google.cloud.dialogflow.v2.Participant]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Participants' - - # Creates a new participant in a conversation. - rpc :CreateParticipant, ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, ::Google::Cloud::Dialogflow::V2::Participant - # Retrieves a conversation participant. - rpc :GetParticipant, ::Google::Cloud::Dialogflow::V2::GetParticipantRequest, ::Google::Cloud::Dialogflow::V2::Participant - # Returns the list of all participants in the specified conversation. - rpc :ListParticipants, ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, ::Google::Cloud::Dialogflow::V2::ListParticipantsResponse - # Updates the specified participant. - rpc :UpdateParticipant, ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, ::Google::Cloud::Dialogflow::V2::Participant - # Adds a text (chat, for example), or audio (phone recording, for example) - # message from a participant into the conversation. - # - # Note: Always use agent versions for production traffic - # sent to virtual agents. See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - rpc :AnalyzeContent, ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse - # Adds a text (chat, for example), or audio (phone recording, for example) - # message from a participant into the conversation. - # Note: This method is only available through the gRPC API (not REST). - # - # The top-level message sent to the client by the server is - # `StreamingAnalyzeContentResponse`. Multiple response messages can be - # returned in order. The first one or more messages contain the - # `recognition_result` field. Each result represents a more complete - # transcript of what the user said. The next message contains the - # `reply_text` field and potentially the `reply_audio` field. The message can - # also contain the `automated_agent_reply` field. - # - # Note: Always use agent versions for production traffic - # sent to virtual agents. See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - rpc :StreamingAnalyzeContent, stream(::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest), stream(::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse) - # Gets suggested articles for a participant based on specific historical - # messages. - rpc :SuggestArticles, ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse - # Gets suggested faq answers for a participant based on specific historical - # messages. - rpc :SuggestFaqAnswers, ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse - # Gets smart replies for a participant based on specific historical - # messages. - rpc :SuggestSmartReplies, ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest, ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse - # Gets knowledge assist suggestions based on historical messages. - rpc :SuggestKnowledgeAssist, ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest, ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants.rb deleted file mode 100644 index b5cdfcd2f82e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/participants/credentials" -require "google/cloud/dialogflow/v2/participants/paths" -require "google/cloud/dialogflow/v2/participants/client" -require "google/cloud/dialogflow/v2/participants/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/participants" - # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/participants/rest" - # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - module Participants - end - end - end - end -end - -helper_path = ::File.join __dir__, "participants", "helpers.rb" -require "google/cloud/dialogflow/v2/participants/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb deleted file mode 100644 index 2921f33bb8c5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb +++ /dev/null @@ -1,1469 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/participant_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Participants - ## - # Client for the Participants service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :participants_stub - - ## - # Configure the Participants Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Participants::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Participants clients - # ::Google::Cloud::Dialogflow::V2::Participants::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.analyze_content.timeout = 220.0 - default_config.rpcs.analyze_content.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.streaming_analyze_content.timeout = 220.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Participants 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::Dialogflow::V2::Participants::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 - @participants_stub.universe_domain - end - - ## - # Create a new Participants client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Participants 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/dialogflow/v2/participant_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 - - @participants_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Participants::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 - ) - - @participants_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 = @participants_stub.endpoint - config.universe_domain = @participants_stub.universe_domain - config.logger = @participants_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 - @participants_stub.logger - end - - # Service calls - - ## - # Creates a new participant in a conversation. - # - # @overload create_participant(request, options = nil) - # Pass arguments to `create_participant` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_participant(parent: nil, participant: nil) - # Pass arguments to `create_participant` via keyword arguments. Note that at - # least one keyword argument is 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. Resource identifier of the conversation adding the participant. - # Format: `projects//locations//conversations/`. - # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash] - # Required. The participant to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new - # - # # Call the create_participant method. - # result = client.create_participant request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. - # p result - # - def create_participant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest - - # Converts hash and nil to 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_participant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_participant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_participant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :create_participant, 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 - - ## - # Retrieves a conversation participant. - # - # @overload get_participant(request, options = nil) - # Pass arguments to `get_participant` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetParticipantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetParticipantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_participant(name: nil) - # Pass arguments to `get_participant` via keyword arguments. Note that at - # least one keyword argument is required. To 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 participant. Format: - # `projects//locations//conversations//participants/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new - # - # # Call the get_participant method. - # result = client.get_participant request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. - # p result - # - def get_participant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetParticipantRequest - - # Converts hash and nil to 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_participant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_participant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_participant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :get_participant, 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 - - ## - # Returns the list of all participants in the specified conversation. - # - # @overload list_participants(request, options = nil) - # Pass arguments to `list_participants` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListParticipantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_participants(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_participants` via keyword arguments. Note that at - # least one keyword argument is 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 conversation to list all participants from. - # Format: `projects//locations//conversations/`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new - # - # # Call the list_participants method. - # result = client.list_participants 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::Dialogflow::V2::Participant. - # p item - # end - # - def list_participants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest - - # Converts hash and nil to 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_participants.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_participants.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_participants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :list_participants, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @participants_stub, :list_participants, 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 specified participant. - # - # @overload update_participant(request, options = nil) - # Pass arguments to `update_participant` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_participant(participant: nil, update_mask: nil) - # Pass arguments to `update_participant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash] - # Required. The participant to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to specify which fields to update. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new - # - # # Call the update_participant method. - # result = client.update_participant request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. - # p result - # - def update_participant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest - - # Converts hash and nil to 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_participant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.participant&.name - header_params["participant.name"] = request.participant.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_participant.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_participant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :update_participant, 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 - - ## - # Adds a text (chat, for example), or audio (phone recording, for example) - # message from a participant into the conversation. - # - # Note: Always use agent versions for production traffic - # sent to virtual agents. See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # - # @overload analyze_content(request, options = nil) - # Pass arguments to `analyze_content` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload analyze_content(participant: nil, text_input: nil, audio_input: nil, event_input: nil, suggestion_input: nil, reply_audio_config: nil, query_params: nil, assist_query_params: nil, cx_parameters: nil, request_id: nil) - # Pass arguments to `analyze_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 participant [::String] - # Required. The name of the participant this text comes from. - # Format: `projects//locations//conversations//participants/`. - # @param text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] - # The natural language text to be processed. - # - # Note: The following parameters are mutually exclusive: `text_input`, `audio_input`, `event_input`, `suggestion_input`. 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 audio_input [::Google::Cloud::Dialogflow::V2::AudioInput, ::Hash] - # The natural language speech audio to be processed. - # - # Note: The following parameters are mutually exclusive: `audio_input`, `text_input`, `event_input`, `suggestion_input`. 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 event_input [::Google::Cloud::Dialogflow::V2::EventInput, ::Hash] - # An input event to send to Dialogflow. - # - # Note: The following parameters are mutually exclusive: `event_input`, `text_input`, `audio_input`, `suggestion_input`. 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 suggestion_input [::Google::Cloud::Dialogflow::V2::SuggestionInput, ::Hash] - # An input representing the selection of a suggestion. - # - # Note: The following parameters are mutually exclusive: `suggestion_input`, `text_input`, `audio_input`, `event_input`. 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 reply_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash] - # Speech synthesis configuration. - # The speech synthesis settings for a virtual agent that may be configured - # for the associated conversation profile are not used when calling - # AnalyzeContent. If this configuration is not supplied, speech synthesis - # is disabled. - # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash] - # Parameters for a Dialogflow virtual-agent query. - # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] - # Parameters for a human assist query. - # @param cx_parameters [::Google::Protobuf::Struct, ::Hash] - # Additional parameters to be put into Dialogflow CX session parameters. To - # remove a parameter from the session, clients should explicitly set the - # parameter value to null. - # - # Note: this field should only be used if you are connecting to a Dialogflow - # CX agent. - # @param request_id [::String] - # A unique identifier for this request. Restricted to 36 ASCII characters. - # A random UUID is recommended. - # This request is only idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new - # - # # Call the analyze_content method. - # result = client.analyze_content request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse. - # p result - # - def analyze_content request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.analyze_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::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.participant - header_params["participant"] = request.participant - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.analyze_content.timeout, - metadata: metadata, - retry_policy: @config.rpcs.analyze_content.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :analyze_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 - - ## - # Adds a text (chat, for example), or audio (phone recording, for example) - # message from a participant into the conversation. - # Note: This method is only available through the gRPC API (not REST). - # - # The top-level message sent to the client by the server is - # `StreamingAnalyzeContentResponse`. Multiple response messages can be - # returned in order. The first one or more messages contain the - # `recognition_result` field. Each result represents a more complete - # transcript of what the user said. The next message contains the - # `reply_text` field and potentially the `reply_audio` field. The message can - # also contain the `automated_agent_reply` field. - # - # Note: Always use agent versions for production traffic - # sent to virtual agents. See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest, ::Hash>] - # An enumerable of {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest} 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::Dialogflow::V2::StreamingAnalyzeContentResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the streaming_analyze_content method to start streaming. - # output = client.streaming_analyze_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::Dialogflow::V2::StreamingAnalyzeContentRequest.new - # input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse - # output.each do |current_response| - # p current_response - # end - # - def streaming_analyze_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::Dialogflow::V2::StreamingAnalyzeContentRequest - 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.streaming_analyze_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::Dialogflow::V2::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.streaming_analyze_content.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_analyze_content.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :streaming_analyze_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 - - ## - # Gets suggested articles for a participant based on specific historical - # messages. - # - # @overload suggest_articles(request, options = nil) - # Pass arguments to `suggest_articles` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload suggest_articles(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil) - # Pass arguments to `suggest_articles` via keyword arguments. Note that at - # least one keyword argument is 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 name of the participant to fetch suggestion for. - # Format: `projects//locations//conversations//participants/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message to compile suggestion - # for. If empty, it will be the latest message of the conversation. - # - # Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Optional. Max number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#latest_message latest_message} - # to use as context when compiling the suggestion. By default 20 and at - # most 50. - # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] - # Parameters for a human assist query. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new - # - # # Call the suggest_articles method. - # result = client.suggest_articles request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse. - # p result - # - def suggest_articles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.suggest_articles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.suggest_articles.timeout, - metadata: metadata, - retry_policy: @config.rpcs.suggest_articles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :suggest_articles, 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 suggested faq answers for a participant based on specific historical - # messages. - # - # @overload suggest_faq_answers(request, options = nil) - # Pass arguments to `suggest_faq_answers` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload suggest_faq_answers(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil) - # Pass arguments to `suggest_faq_answers` via keyword arguments. Note that at - # least one keyword argument is 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 name of the participant to fetch suggestion for. - # Format: `projects//locations//conversations//participants/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message to compile suggestion - # for. If empty, it will be the latest message of the conversation. - # - # Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Optional. Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 20 and at most 50. - # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] - # Parameters for a human assist query. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new - # - # # Call the suggest_faq_answers method. - # result = client.suggest_faq_answers request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse. - # p result - # - def suggest_faq_answers request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.suggest_faq_answers.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.suggest_faq_answers.timeout, - metadata: metadata, - retry_policy: @config.rpcs.suggest_faq_answers.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :suggest_faq_answers, 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 smart replies for a participant based on specific historical - # messages. - # - # @overload suggest_smart_replies(request, options = nil) - # Pass arguments to `suggest_smart_replies` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload suggest_smart_replies(parent: nil, current_text_input: nil, latest_message: nil, context_size: nil) - # Pass arguments to `suggest_smart_replies` via keyword arguments. Note that at - # least one keyword argument is 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 name of the participant to fetch suggestion for. - # Format: `projects//locations//conversations//participants/`. - # @param current_text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] - # The current natural language text segment to compile suggestion - # for. This provides a way for user to get follow up smart reply suggestion - # after a smart reply selection, without sending a text message. - # @param latest_message [::String] - # The name of the latest conversation message to compile suggestion - # for. If empty, it will be the latest message of the conversation. - # - # Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 20 and at most 50. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new - # - # # Call the suggest_smart_replies method. - # result = client.suggest_smart_replies request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse. - # p result - # - def suggest_smart_replies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.suggest_smart_replies.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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.suggest_smart_replies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.suggest_smart_replies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :suggest_smart_replies, 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 knowledge assist suggestions based on historical messages. - # - # @overload suggest_knowledge_assist(request, options = nil) - # Pass arguments to `suggest_knowledge_assist` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload suggest_knowledge_assist(parent: nil, latest_message: nil, context_size: nil, previous_suggested_query: nil) - # Pass arguments to `suggest_knowledge_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 parent [::String] - # Required. The name of the participant to fetch suggestions for. - # Format: `projects//locations//conversations//participants/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message to compile - # suggestions for. If empty, it will be the latest message of the - # conversation. Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Optional. Max number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest#latest_message latest_message} - # to use as context when compiling the suggestion. The context size is by - # default 100 and at most 100. - # @param previous_suggested_query [::String] - # Optional. The previously suggested query for the given conversation. This - # helps identify whether the next suggestion we generate is reasonably - # different from the previous one. This is useful to avoid similar - # suggestions within the conversation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new - # - # # Call the suggest_knowledge_assist method. - # result = client.suggest_knowledge_assist request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse. - # p result - # - def suggest_knowledge_assist request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.suggest_knowledge_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::Dialogflow::V2::VERSION - metadata[:"x-goog-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.suggest_knowledge_assist.timeout, - metadata: metadata, - retry_policy: @config.rpcs.suggest_knowledge_assist.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.call_rpc :suggest_knowledge_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 Participants API. - # - # This class represents the configuration for Participants, - # 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::Dialogflow::V2::Participants::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_participant to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Participants::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_participant.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_participant.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::Dialogflow::V2::Participants::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Participants 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_participant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_participant - ## - # RPC-specific configuration for `get_participant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_participant - ## - # RPC-specific configuration for `list_participants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_participants - ## - # RPC-specific configuration for `update_participant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_participant - ## - # RPC-specific configuration for `analyze_content` - # @return [::Gapic::Config::Method] - # - attr_reader :analyze_content - ## - # RPC-specific configuration for `streaming_analyze_content` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_analyze_content - ## - # RPC-specific configuration for `suggest_articles` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_articles - ## - # RPC-specific configuration for `suggest_faq_answers` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_faq_answers - ## - # RPC-specific configuration for `suggest_smart_replies` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_smart_replies - ## - # RPC-specific configuration for `suggest_knowledge_assist` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_knowledge_assist - - # @private - def initialize parent_rpcs = nil - create_participant_config = parent_rpcs.create_participant if parent_rpcs.respond_to? :create_participant - @create_participant = ::Gapic::Config::Method.new create_participant_config - get_participant_config = parent_rpcs.get_participant if parent_rpcs.respond_to? :get_participant - @get_participant = ::Gapic::Config::Method.new get_participant_config - list_participants_config = parent_rpcs.list_participants if parent_rpcs.respond_to? :list_participants - @list_participants = ::Gapic::Config::Method.new list_participants_config - update_participant_config = parent_rpcs.update_participant if parent_rpcs.respond_to? :update_participant - @update_participant = ::Gapic::Config::Method.new update_participant_config - analyze_content_config = parent_rpcs.analyze_content if parent_rpcs.respond_to? :analyze_content - @analyze_content = ::Gapic::Config::Method.new analyze_content_config - streaming_analyze_content_config = parent_rpcs.streaming_analyze_content if parent_rpcs.respond_to? :streaming_analyze_content - @streaming_analyze_content = ::Gapic::Config::Method.new streaming_analyze_content_config - suggest_articles_config = parent_rpcs.suggest_articles if parent_rpcs.respond_to? :suggest_articles - @suggest_articles = ::Gapic::Config::Method.new suggest_articles_config - suggest_faq_answers_config = parent_rpcs.suggest_faq_answers if parent_rpcs.respond_to? :suggest_faq_answers - @suggest_faq_answers = ::Gapic::Config::Method.new suggest_faq_answers_config - suggest_smart_replies_config = parent_rpcs.suggest_smart_replies if parent_rpcs.respond_to? :suggest_smart_replies - @suggest_smart_replies = ::Gapic::Config::Method.new suggest_smart_replies_config - suggest_knowledge_assist_config = parent_rpcs.suggest_knowledge_assist if parent_rpcs.respond_to? :suggest_knowledge_assist - @suggest_knowledge_assist = ::Gapic::Config::Method.new suggest_knowledge_assist_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/credentials.rb deleted file mode 100644 index 1d703fb329b6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Participants - # Credentials for the Participants API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/paths.rb deleted file mode 100644 index f10924438fbf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/paths.rb +++ /dev/null @@ -1,353 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module Participants - # Path helper methods for the Participants API. - module Paths - ## - # Create a fully-qualified Context resource string. - # - # @overload context_path(project:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @return [::String] - def context_path **args - resources = { - "context:project:session" => (proc do |project:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - end), - "context:location:project:session" => (proc do |project:, location:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - 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:, conversation:) - # The resource will be in the following format: - # - # `projects/{project}/conversations/{conversation}` - # - # @param project [String] - # @param conversation [String] - # - # @overload conversation_path(project:, location:, conversation:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversations/{conversation}` - # - # @param project [String] - # @param location [String] - # @param conversation [String] - # - # @return [::String] - def conversation_path **args - resources = { - "conversation:project" => (proc do |project:, conversation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/conversations/#{conversation}" - end), - "conversation:location:project" => (proc do |project:, location:, conversation:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/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 Message resource string. - # - # @overload message_path(project:, conversation:, message:) - # The resource will be in the following format: - # - # `projects/{project}/conversations/{conversation}/messages/{message}` - # - # @param project [String] - # @param conversation [String] - # @param message [String] - # - # @overload message_path(project:, location:, conversation:, message:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}` - # - # @param project [String] - # @param location [String] - # @param conversation [String] - # @param message [String] - # - # @return [::String] - def message_path **args - resources = { - "conversation:message:project" => (proc do |project:, conversation:, message:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" - - "projects/#{project}/conversations/#{conversation}/messages/#{message}" - end), - "conversation:location:message:project" => (proc do |project:, location:, conversation:, message:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversations/#{conversation}/messages/#{message}" - 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 Participant resource string. - # - # @overload participant_path(project:, conversation:, participant:) - # The resource will be in the following format: - # - # `projects/{project}/conversations/{conversation}/participants/{participant}` - # - # @param project [String] - # @param conversation [String] - # @param participant [String] - # - # @overload participant_path(project:, location:, conversation:, participant:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}` - # - # @param project [String] - # @param location [String] - # @param conversation [String] - # @param participant [String] - # - # @return [::String] - def participant_path **args - resources = { - "conversation:participant:project" => (proc do |project:, conversation:, participant:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" - - "projects/#{project}/conversations/#{conversation}/participants/#{participant}" - end), - "conversation:location:participant:project" => (proc do |project:, location:, conversation:, participant:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/" - - "projects/#{project}/locations/#{location}/conversations/#{conversation}/participants/#{participant}" - 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 PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - ## - # Create a fully-qualified SessionEntityType resource string. - # - # @overload session_entity_type_path(project:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, environment:, user:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, location:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, location:, environment:, user:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param entity_type [String] - # - # @return [::String] - def session_entity_type_path **args - resources = { - "entity_type:project:session" => (proc do |project:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}/entityTypes/#{entity_type}" - end), - "entity_type:environment:project:session:user" => (proc do |project:, environment:, user:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" - end), - "entity_type:location:project:session" => (proc do |project:, location:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}/entityTypes/#{entity_type}" - end), - "entity_type:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest.rb deleted file mode 100644 index 1f43879e56b5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/participants/credentials" -require "google/cloud/dialogflow/v2/participants/paths" -require "google/cloud/dialogflow/v2/participants/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/participants/rest" - # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - module Participants - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/participants/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb deleted file mode 100644 index 332db1c00cc1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +++ /dev/null @@ -1,1270 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/participant_pb" -require "google/cloud/dialogflow/v2/participants/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Participants - module Rest - ## - # REST client for the Participants service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :participants_stub - - ## - # Configure the Participants Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Participants::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Participants clients - # ::Google::Cloud::Dialogflow::V2::Participants::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.analyze_content.timeout = 220.0 - default_config.rpcs.analyze_content.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Participants 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::Dialogflow::V2::Participants::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 - @participants_stub.universe_domain - end - - ## - # Create a new Participants REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Participants 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 - - @participants_stub = ::Google::Cloud::Dialogflow::V2::Participants::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @participants_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 = @participants_stub.endpoint - config.universe_domain = @participants_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @participants_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 - @participants_stub.logger - end - - # Service calls - - ## - # Creates a new participant in a conversation. - # - # @overload create_participant(request, options = nil) - # Pass arguments to `create_participant` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_participant(parent: nil, participant: nil) - # Pass arguments to `create_participant` via keyword arguments. Note that at - # least one keyword argument is 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. Resource identifier of the conversation adding the participant. - # Format: `projects//locations//conversations/`. - # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash] - # Required. The participant to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Participant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new - # - # # Call the create_participant method. - # result = client.create_participant request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. - # p result - # - def create_participant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest - - # Converts hash and nil to an 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_participant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_participant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_participant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.create_participant 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 - - ## - # Retrieves a conversation participant. - # - # @overload get_participant(request, options = nil) - # Pass arguments to `get_participant` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetParticipantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetParticipantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_participant(name: nil) - # Pass arguments to `get_participant` via keyword arguments. Note that at - # least one keyword argument is required. To 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 participant. Format: - # `projects//locations//conversations//participants/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Participant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new - # - # # Call the get_participant method. - # result = client.get_participant request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. - # p result - # - def get_participant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetParticipantRequest - - # Converts hash and nil to an 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_participant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_participant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_participant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.get_participant 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 - - ## - # Returns the list of all participants in the specified conversation. - # - # @overload list_participants(request, options = nil) - # Pass arguments to `list_participants` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListParticipantsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_participants(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_participants` via keyword arguments. Note that at - # least one keyword argument is 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 conversation to list all participants from. - # Format: `projects//locations//conversations/`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new - # - # # Call the list_participants method. - # result = client.list_participants 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::Dialogflow::V2::Participant. - # p item - # end - # - def list_participants request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest - - # Converts hash and nil to an 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_participants.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_participants.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_participants.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.list_participants request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @participants_stub, :list_participants, "participants", 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 specified participant. - # - # @overload update_participant(request, options = nil) - # Pass arguments to `update_participant` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_participant(participant: nil, update_mask: nil) - # Pass arguments to `update_participant` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash] - # Required. The participant to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to specify which fields to update. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Participant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new - # - # # Call the update_participant method. - # result = client.update_participant request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. - # p result - # - def update_participant request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest - - # Converts hash and nil to an 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_participant.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_participant.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_participant.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.update_participant 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 - - ## - # Adds a text (chat, for example), or audio (phone recording, for example) - # message from a participant into the conversation. - # - # Note: Always use agent versions for production traffic - # sent to virtual agents. See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # - # @overload analyze_content(request, options = nil) - # Pass arguments to `analyze_content` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload analyze_content(participant: nil, text_input: nil, audio_input: nil, event_input: nil, suggestion_input: nil, reply_audio_config: nil, query_params: nil, assist_query_params: nil, cx_parameters: nil, request_id: nil) - # Pass arguments to `analyze_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 participant [::String] - # Required. The name of the participant this text comes from. - # Format: `projects//locations//conversations//participants/`. - # @param text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] - # The natural language text to be processed. - # - # Note: The following parameters are mutually exclusive: `text_input`, `audio_input`, `event_input`, `suggestion_input`. 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 audio_input [::Google::Cloud::Dialogflow::V2::AudioInput, ::Hash] - # The natural language speech audio to be processed. - # - # Note: The following parameters are mutually exclusive: `audio_input`, `text_input`, `event_input`, `suggestion_input`. 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 event_input [::Google::Cloud::Dialogflow::V2::EventInput, ::Hash] - # An input event to send to Dialogflow. - # - # Note: The following parameters are mutually exclusive: `event_input`, `text_input`, `audio_input`, `suggestion_input`. 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 suggestion_input [::Google::Cloud::Dialogflow::V2::SuggestionInput, ::Hash] - # An input representing the selection of a suggestion. - # - # Note: The following parameters are mutually exclusive: `suggestion_input`, `text_input`, `audio_input`, `event_input`. 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 reply_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash] - # Speech synthesis configuration. - # The speech synthesis settings for a virtual agent that may be configured - # for the associated conversation profile are not used when calling - # AnalyzeContent. If this configuration is not supplied, speech synthesis - # is disabled. - # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash] - # Parameters for a Dialogflow virtual-agent query. - # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] - # Parameters for a human assist query. - # @param cx_parameters [::Google::Protobuf::Struct, ::Hash] - # Additional parameters to be put into Dialogflow CX session parameters. To - # remove a parameter from the session, clients should explicitly set the - # parameter value to null. - # - # Note: this field should only be used if you are connecting to a Dialogflow - # CX agent. - # @param request_id [::String] - # A unique identifier for this request. Restricted to 36 ASCII characters. - # A random UUID is recommended. - # This request is only idempotent if a `request_id` is provided. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new - # - # # Call the analyze_content method. - # result = client.analyze_content request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse. - # p result - # - def analyze_content request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.analyze_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.analyze_content.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.analyze_content.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.analyze_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 - - ## - # Gets suggested articles for a participant based on specific historical - # messages. - # - # @overload suggest_articles(request, options = nil) - # Pass arguments to `suggest_articles` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload suggest_articles(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil) - # Pass arguments to `suggest_articles` via keyword arguments. Note that at - # least one keyword argument is 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 name of the participant to fetch suggestion for. - # Format: `projects//locations//conversations//participants/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message to compile suggestion - # for. If empty, it will be the latest message of the conversation. - # - # Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Optional. Max number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#latest_message latest_message} - # to use as context when compiling the suggestion. By default 20 and at - # most 50. - # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] - # Parameters for a human assist query. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new - # - # # Call the suggest_articles method. - # result = client.suggest_articles request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse. - # p result - # - def suggest_articles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.suggest_articles.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.suggest_articles.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.suggest_articles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.suggest_articles 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 suggested faq answers for a participant based on specific historical - # messages. - # - # @overload suggest_faq_answers(request, options = nil) - # Pass arguments to `suggest_faq_answers` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload suggest_faq_answers(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil) - # Pass arguments to `suggest_faq_answers` via keyword arguments. Note that at - # least one keyword argument is 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 name of the participant to fetch suggestion for. - # Format: `projects//locations//conversations//participants/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message to compile suggestion - # for. If empty, it will be the latest message of the conversation. - # - # Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Optional. Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 20 and at most 50. - # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash] - # Parameters for a human assist query. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new - # - # # Call the suggest_faq_answers method. - # result = client.suggest_faq_answers request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse. - # p result - # - def suggest_faq_answers request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.suggest_faq_answers.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.suggest_faq_answers.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.suggest_faq_answers.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.suggest_faq_answers 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 smart replies for a participant based on specific historical - # messages. - # - # @overload suggest_smart_replies(request, options = nil) - # Pass arguments to `suggest_smart_replies` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload suggest_smart_replies(parent: nil, current_text_input: nil, latest_message: nil, context_size: nil) - # Pass arguments to `suggest_smart_replies` via keyword arguments. Note that at - # least one keyword argument is 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 name of the participant to fetch suggestion for. - # Format: `projects//locations//conversations//participants/`. - # @param current_text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash] - # The current natural language text segment to compile suggestion - # for. This provides a way for user to get follow up smart reply suggestion - # after a smart reply selection, without sending a text message. - # @param latest_message [::String] - # The name of the latest conversation message to compile suggestion - # for. If empty, it will be the latest message of the conversation. - # - # Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 20 and at most 50. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new - # - # # Call the suggest_smart_replies method. - # result = client.suggest_smart_replies request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse. - # p result - # - def suggest_smart_replies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.suggest_smart_replies.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.suggest_smart_replies.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.suggest_smart_replies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.suggest_smart_replies 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 knowledge assist suggestions based on historical messages. - # - # @overload suggest_knowledge_assist(request, options = nil) - # Pass arguments to `suggest_knowledge_assist` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload suggest_knowledge_assist(parent: nil, latest_message: nil, context_size: nil, previous_suggested_query: nil) - # Pass arguments to `suggest_knowledge_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 parent [::String] - # Required. The name of the participant to fetch suggestions for. - # Format: `projects//locations//conversations//participants/`. - # @param latest_message [::String] - # Optional. The name of the latest conversation message to compile - # suggestions for. If empty, it will be the latest message of the - # conversation. Format: `projects//locations//conversations//messages/`. - # @param context_size [::Integer] - # Optional. Max number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest#latest_message latest_message} - # to use as context when compiling the suggestion. The context size is by - # default 100 and at most 100. - # @param previous_suggested_query [::String] - # Optional. The previously suggested query for the given conversation. This - # helps identify whether the next suggestion we generate is reasonably - # different from the previous one. This is useful to avoid similar - # suggestions within the conversation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new - # - # # Call the suggest_knowledge_assist method. - # result = client.suggest_knowledge_assist request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse. - # p result - # - def suggest_knowledge_assist request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.suggest_knowledge_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::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.suggest_knowledge_assist.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.suggest_knowledge_assist.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @participants_stub.suggest_knowledge_assist 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 Participants REST API. - # - # This class represents the configuration for Participants 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::Dialogflow::V2::Participants::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_participant to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_participant.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_participant.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Participants 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_participant` - # @return [::Gapic::Config::Method] - # - attr_reader :create_participant - ## - # RPC-specific configuration for `get_participant` - # @return [::Gapic::Config::Method] - # - attr_reader :get_participant - ## - # RPC-specific configuration for `list_participants` - # @return [::Gapic::Config::Method] - # - attr_reader :list_participants - ## - # RPC-specific configuration for `update_participant` - # @return [::Gapic::Config::Method] - # - attr_reader :update_participant - ## - # RPC-specific configuration for `analyze_content` - # @return [::Gapic::Config::Method] - # - attr_reader :analyze_content - ## - # RPC-specific configuration for `suggest_articles` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_articles - ## - # RPC-specific configuration for `suggest_faq_answers` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_faq_answers - ## - # RPC-specific configuration for `suggest_smart_replies` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_smart_replies - ## - # RPC-specific configuration for `suggest_knowledge_assist` - # @return [::Gapic::Config::Method] - # - attr_reader :suggest_knowledge_assist - - # @private - def initialize parent_rpcs = nil - create_participant_config = parent_rpcs.create_participant if parent_rpcs.respond_to? :create_participant - @create_participant = ::Gapic::Config::Method.new create_participant_config - get_participant_config = parent_rpcs.get_participant if parent_rpcs.respond_to? :get_participant - @get_participant = ::Gapic::Config::Method.new get_participant_config - list_participants_config = parent_rpcs.list_participants if parent_rpcs.respond_to? :list_participants - @list_participants = ::Gapic::Config::Method.new list_participants_config - update_participant_config = parent_rpcs.update_participant if parent_rpcs.respond_to? :update_participant - @update_participant = ::Gapic::Config::Method.new update_participant_config - analyze_content_config = parent_rpcs.analyze_content if parent_rpcs.respond_to? :analyze_content - @analyze_content = ::Gapic::Config::Method.new analyze_content_config - suggest_articles_config = parent_rpcs.suggest_articles if parent_rpcs.respond_to? :suggest_articles - @suggest_articles = ::Gapic::Config::Method.new suggest_articles_config - suggest_faq_answers_config = parent_rpcs.suggest_faq_answers if parent_rpcs.respond_to? :suggest_faq_answers - @suggest_faq_answers = ::Gapic::Config::Method.new suggest_faq_answers_config - suggest_smart_replies_config = parent_rpcs.suggest_smart_replies if parent_rpcs.respond_to? :suggest_smart_replies - @suggest_smart_replies = ::Gapic::Config::Method.new suggest_smart_replies_config - suggest_knowledge_assist_config = parent_rpcs.suggest_knowledge_assist if parent_rpcs.respond_to? :suggest_knowledge_assist - @suggest_knowledge_assist = ::Gapic::Config::Method.new suggest_knowledge_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-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb deleted file mode 100644 index 8dc67dca237c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb +++ /dev/null @@ -1,707 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/participant_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Participants - module Rest - ## - # REST service stub for the Participants 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_participant REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Participant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # A result object deserialized from the server's reply - def create_participant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_participant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_participant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Participant.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_participant REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetParticipantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Participant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # A result object deserialized from the server's reply - def get_participant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_participant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_participant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Participant.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_participants REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListParticipantsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListParticipantsResponse] - # A result object deserialized from the server's reply - def list_participants request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_participants_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_participants", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListParticipantsResponse.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_participant REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Participant] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # A result object deserialized from the server's reply - def update_participant request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_participant_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_participant", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Participant.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the analyze_content REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::AnalyzeContentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse] - # A result object deserialized from the server's reply - def analyze_content request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_analyze_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: "analyze_content", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the suggest_articles REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SuggestArticlesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] - # A result object deserialized from the server's reply - def suggest_articles request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_suggest_articles_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "suggest_articles", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the suggest_faq_answers REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SuggestFaqAnswersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] - # A result object deserialized from the server's reply - def suggest_faq_answers request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_suggest_faq_answers_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "suggest_faq_answers", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the suggest_smart_replies REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SuggestSmartRepliesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] - # A result object deserialized from the server's reply - def suggest_smart_replies request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_suggest_smart_replies_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "suggest_smart_replies", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the suggest_knowledge_assist REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SuggestKnowledgeAssistResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] - # A result object deserialized from the server's reply - def suggest_knowledge_assist request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_suggest_knowledge_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: "suggest_knowledge_assist", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse.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_participant REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest] - # 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_participant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/participants", - body: "participant", - matches: [ - ["parent", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/participants", - body: "participant", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_participant REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetParticipantRequest] - # 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_participant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_participants REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest] - # 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_participants_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/participants", - matches: [ - ["parent", %r{^projects/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/participants", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_participant REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest] - # 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_participant_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{participant.name}", - body: "participant", - matches: [ - ["participant.name", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{participant.name}", - body: "participant", - matches: [ - ["participant.name", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the analyze_content REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_analyze_content_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{participant}:analyzeContent", - body: "*", - matches: [ - ["participant", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{participant}:analyzeContent", - body: "*", - matches: [ - ["participant", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the suggest_articles REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_suggest_articles_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:suggestArticles", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:suggestArticles", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the suggest_faq_answers REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_suggest_faq_answers_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:suggestFaqAnswers", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:suggestFaqAnswers", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the suggest_smart_replies REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_suggest_smart_replies_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:suggestSmartReplies", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:suggestSmartReplies", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the suggest_knowledge_assist REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_suggest_knowledge_assist_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:suggestKnowledgeAssist", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/suggestions:suggestKnowledgeAssist", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/participants/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/rest.rb deleted file mode 100644 index 436b9c384fef..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/rest.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/agents/rest" -require "google/cloud/dialogflow/v2/tools/rest" -require "google/cloud/dialogflow/v2/generators/rest" -require "google/cloud/dialogflow/v2/contexts/rest" -require "google/cloud/dialogflow/v2/intents/rest" -require "google/cloud/dialogflow/v2/entity_types/rest" -require "google/cloud/dialogflow/v2/session_entity_types/rest" -require "google/cloud/dialogflow/v2/sessions/rest" -require "google/cloud/dialogflow/v2/participants/rest" -require "google/cloud/dialogflow/v2/answer_records/rest" -require "google/cloud/dialogflow/v2/conversation_profiles/rest" -require "google/cloud/dialogflow/v2/conversations/rest" -require "google/cloud/dialogflow/v2/conversation_datasets/rest" -require "google/cloud/dialogflow/v2/conversation_models/rest" -require "google/cloud/dialogflow/v2/documents/rest" -require "google/cloud/dialogflow/v2/encryption_spec_service/rest" -require "google/cloud/dialogflow/v2/fulfillments/rest" -require "google/cloud/dialogflow/v2/environments/rest" -require "google/cloud/dialogflow/v2/generator_evaluations/rest" -require "google/cloud/dialogflow/v2/knowledge_bases/rest" -require "google/cloud/dialogflow/v2/sip_trunks/rest" -require "google/cloud/dialogflow/v2/versions/rest" -require "google/cloud/dialogflow/v2/bindings_override" -require "google/cloud/dialogflow/v2/version" - -module Google - module Cloud - module Dialogflow - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/dialogflow/v2/rest" - # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new - # - module V2 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb deleted file mode 100644 index 14e32d97a1ef..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/session_entity_type.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/dialogflow/v2/entity_type_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n4google/cloud/dialogflow/v2/session_entity_type.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/dialogflow/v2/entity_type.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa1\x06\n\x11SessionEntityType\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x63\n\x14\x65ntity_override_mode\x18\x02 \x01(\x0e\x32@.google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideModeB\x03\xe0\x41\x02\x12\x44\n\x08\x65ntities\x18\x03 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.EntityB\x03\xe0\x41\x02\"\x82\x01\n\x12\x45ntityOverrideMode\x12$\n ENTITY_OVERRIDE_MODE_UNSPECIFIED\x10\x00\x12!\n\x1d\x45NTITY_OVERRIDE_MODE_OVERRIDE\x10\x01\x12#\n\x1f\x45NTITY_OVERRIDE_MODE_SUPPLEMENT\x10\x02:\xc8\x03\xea\x41\xc4\x03\n+dialogflow.googleapis.com/SessionEntityType\x12\x45projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}\x12mprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}\x12Zprojects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}\x12\x82\x01projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}\"\x95\x01\n\x1dListSessionEntityTypesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+dialogflow.googleapis.com/SessionEntityType\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\"\x86\x01\n\x1eListSessionEntityTypesResponse\x12K\n\x14session_entity_types\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"`\n\x1bGetSessionEntityTypeRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+dialogflow.googleapis.com/SessionEntityType\"\xb6\x01\n\x1e\x43reateSessionEntityTypeRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+dialogflow.googleapis.com/SessionEntityType\x12O\n\x13session_entity_type\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityTypeB\x03\xe0\x41\x02\"\xa7\x01\n\x1eUpdateSessionEntityTypeRequest\x12O\n\x13session_entity_type\x18\x01 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityTypeB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"c\n\x1e\x44\x65leteSessionEntityTypeRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+dialogflow.googleapis.com/SessionEntityType2\xea\x14\n\x12SessionEntityTypes\x12\xc6\x03\n\x16ListSessionEntityTypes\x12\x39.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest\x1a:.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse\"\xb4\x02\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xa4\x02\x12\x34/v2/{parent=projects/*/agent/sessions/*}/entityTypesZM\x12K/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypesZB\x12@/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypesZY\x12W/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes\x12\xb3\x03\n\x14GetSessionEntityType\x12\x37.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest\x1a-.google.cloud.dialogflow.v2.SessionEntityType\"\xb2\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xa4\x02\x12\x34/v2/{name=projects/*/agent/sessions/*/entityTypes/*}ZM\x12K/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}ZB\x12@/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}ZY\x12W/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}\x12\xa3\x04\n\x17\x43reateSessionEntityType\x12:.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest\x1a-.google.cloud.dialogflow.v2.SessionEntityType\"\x9c\x03\xda\x41\x1aparent,session_entity_type\x82\xd3\xe4\x93\x02\xf8\x02\"4/v2/{parent=projects/*/agent/sessions/*}/entityTypes:\x13session_entity_typeZb\"K/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes:\x13session_entity_typeZW\"@/v2/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes:\x13session_entity_typeZn\"W/v2/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes:\x13session_entity_type\x12\x8f\x05\n\x17UpdateSessionEntityType\x12:.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest\x1a-.google.cloud.dialogflow.v2.SessionEntityType\"\x88\x04\xda\x41\x13session_entity_type\xda\x41\x1fsession_entity_type,update_mask\x82\xd3\xe4\x93\x02\xc9\x03\x32H/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}:\x13session_entity_typeZv2_/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}:\x13session_entity_typeZk2T/v2/{session_entity_type.name=projects/*/locations/*/agent/sessions/*/entityTypes/*}:\x13session_entity_typeZ\x82\x01\x32k/v2/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}:\x13session_entity_type\x12\xa2\x03\n\x17\x44\x65leteSessionEntityType\x12:.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest\x1a\x16.google.protobuf.Empty\"\xb2\x02\xda\x41\x04name\x82\xd3\xe4\x93\x02\xa4\x02*4/v2/{name=projects/*/agent/sessions/*/entityTypes/*}ZM*K/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}ZB*@/v2/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}ZY*W/v2/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x9c\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x16SessionEntityTypeProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - SessionEntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SessionEntityType").msgclass - SessionEntityType::EntityOverrideMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode").enummodule - ListSessionEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListSessionEntityTypesRequest").msgclass - ListSessionEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListSessionEntityTypesResponse").msgclass - GetSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetSessionEntityTypeRequest").msgclass - CreateSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest").msgclass - UpdateSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest").msgclass - DeleteSessionEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb deleted file mode 100644 index 41a9ea6ba7fc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +++ /dev/null @@ -1,77 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/session_entity_type.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/session_entity_type_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module SessionEntityTypes - # Service for managing - # [SessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityType]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.SessionEntityTypes' - - # Returns the list of all session entity types in the specified session. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - rpc :ListSessionEntityTypes, ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse - # Retrieves the specified session entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - rpc :GetSessionEntityType, ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::SessionEntityType - # Creates a session entity type. - # - # If the specified session entity type already exists, overrides the session - # entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - rpc :CreateSessionEntityType, ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::SessionEntityType - # Updates the specified session entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - rpc :UpdateSessionEntityType, ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::SessionEntityType - # Deletes the specified session entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - rpc :DeleteSessionEntityType, ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types.rb deleted file mode 100644 index 58adf508a177..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/session_entity_types/credentials" -require "google/cloud/dialogflow/v2/session_entity_types/paths" -require "google/cloud/dialogflow/v2/session_entity_types/client" -require "google/cloud/dialogflow/v2/session_entity_types/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/session_entity_types" - # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/session_entity_types/rest" - # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new - # - module SessionEntityTypes - end - end - end - end -end - -helper_path = ::File.join __dir__, "session_entity_types", "helpers.rb" -require "google/cloud/dialogflow/v2/session_entity_types/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb deleted file mode 100644 index 38325689aa25..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +++ /dev/null @@ -1,926 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/session_entity_type_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module SessionEntityTypes - ## - # Client for the SessionEntityTypes service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :session_entity_types_stub - - ## - # Configure the SessionEntityTypes Client class. - # - # See {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionEntityTypes clients - # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::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_entity_types_stub.universe_domain - end - - ## - # Create a new SessionEntityTypes client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SessionEntityTypes 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/dialogflow/v2/session_entity_type_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_entity_types_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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_entity_types_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_entity_types_stub.endpoint - config.universe_domain = @session_entity_types_stub.universe_domain - config.logger = @session_entity_types_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_entity_types_stub.logger - end - - # Service calls - - ## - # Returns the list of all session entity types in the specified session. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload list_session_entity_types(request, options = nil) - # Pass arguments to `list_session_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_session_entity_types(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_session_entity_types` via keyword arguments. Note that at - # least one keyword argument is 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 session to list all session entity types from. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users// - # sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new - # - # # Call the list_session_entity_types method. - # result = client.list_session_entity_types 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::Dialogflow::V2::SessionEntityType. - # p item - # end - # - def list_session_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest - - # Converts hash and nil to 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_session_entity_types.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_session_entity_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_session_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.call_rpc :list_session_entity_types, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @session_entity_types_stub, :list_session_entity_types, 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 - - ## - # Retrieves the specified session entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload get_session_entity_type(request, options = nil) - # Pass arguments to `get_session_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(name: nil) - # Pass arguments to `get_session_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To 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 session entity type. Format: - # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new - # - # # Call the get_session_entity_type method. - # result = client.get_session_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. - # p result - # - def get_session_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest - - # Converts hash and nil to 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entity_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_session_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.call_rpc :get_session_entity_type, 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 entity type. - # - # If the specified session entity type already exists, overrides the session - # entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload create_session_entity_type(request, options = nil) - # Pass arguments to `create_session_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(parent: nil, session_entity_type: nil) - # Pass arguments to `create_session_entity_type` via keyword arguments. Note that at - # least one keyword argument is 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 session to create a session entity type for. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users// - # sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @param session_entity_type [::Google::Cloud::Dialogflow::V2::SessionEntityType, ::Hash] - # Required. The session entity type to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new - # - # # Call the create_session_entity_type method. - # result = client.create_session_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. - # p result - # - def create_session_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest - - # Converts hash and nil to 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entity_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_session_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.call_rpc :create_session_entity_type, 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 the specified session entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload update_session_entity_type(request, options = nil) - # Pass arguments to `update_session_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(session_entity_type: nil, update_mask: nil) - # Pass arguments to `update_session_entity_type` via keyword arguments. Note that at - # least one keyword argument is 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_entity_type [::Google::Cloud::Dialogflow::V2::SessionEntityType, ::Hash] - # Required. The session entity type to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new - # - # # Call the update_session_entity_type method. - # result = client.update_session_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. - # p result - # - def update_session_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest - - # Converts hash and nil to 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entity_type&.name - header_params["session_entity_type.name"] = request.session_entity_type.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_entity_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_session_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.call_rpc :update_session_entity_type, 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 specified session entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload delete_session_entity_type(request, options = nil) - # Pass arguments to `delete_session_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(name: nil) - # Pass arguments to `delete_session_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To 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 entity type to delete. Format: - # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new - # - # # Call the delete_session_entity_type method. - # result = client.delete_session_entity_type request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest - - # Converts hash and nil to 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_entity_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_session_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.call_rpc :delete_session_entity_type, 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 SessionEntityTypes API. - # - # This class represents the configuration for SessionEntityTypes, - # 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::Dialogflow::V2::SessionEntityTypes::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_session_entity_types to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_session_entity_types.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_session_entity_types.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::Dialogflow::V2::SessionEntityTypes::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 SessionEntityTypes 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_session_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_session_entity_types - ## - # RPC-specific configuration for `get_session_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session_entity_type - ## - # RPC-specific configuration for `create_session_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session_entity_type - ## - # RPC-specific configuration for `update_session_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :update_session_entity_type - ## - # RPC-specific configuration for `delete_session_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session_entity_type - - # @private - def initialize parent_rpcs = nil - list_session_entity_types_config = parent_rpcs.list_session_entity_types if parent_rpcs.respond_to? :list_session_entity_types - @list_session_entity_types = ::Gapic::Config::Method.new list_session_entity_types_config - get_session_entity_type_config = parent_rpcs.get_session_entity_type if parent_rpcs.respond_to? :get_session_entity_type - @get_session_entity_type = ::Gapic::Config::Method.new get_session_entity_type_config - create_session_entity_type_config = parent_rpcs.create_session_entity_type if parent_rpcs.respond_to? :create_session_entity_type - @create_session_entity_type = ::Gapic::Config::Method.new create_session_entity_type_config - update_session_entity_type_config = parent_rpcs.update_session_entity_type if parent_rpcs.respond_to? :update_session_entity_type - @update_session_entity_type = ::Gapic::Config::Method.new update_session_entity_type_config - delete_session_entity_type_config = parent_rpcs.delete_session_entity_type if parent_rpcs.respond_to? :delete_session_entity_type - @delete_session_entity_type = ::Gapic::Config::Method.new delete_session_entity_type_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.rb deleted file mode 100644 index 04cd06ceeddc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module SessionEntityTypes - # Credentials for the SessionEntityTypes API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb deleted file mode 100644 index 21432a061adf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +++ /dev/null @@ -1,195 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module SessionEntityTypes - # Path helper methods for the SessionEntityTypes API. - module Paths - ## - # Create a fully-qualified Session resource string. - # - # @overload session_path(project:, session:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}` - # - # @param project [String] - # @param session [String] - # - # @overload session_path(project:, environment:, user:, session:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # - # @overload session_path(project:, location:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # - # @overload session_path(project:, location:, environment:, user:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # - # @return [::String] - def session_path **args - resources = { - "project:session" => (proc do |project:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}" - end), - "environment:project:session:user" => (proc do |project:, environment:, user:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}" - end), - "location:project:session" => (proc do |project:, location:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}" - end), - "environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/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 - - ## - # Create a fully-qualified SessionEntityType resource string. - # - # @overload session_entity_type_path(project:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, environment:, user:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, location:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, location:, environment:, user:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param entity_type [String] - # - # @return [::String] - def session_entity_type_path **args - resources = { - "entity_type:project:session" => (proc do |project:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}/entityTypes/#{entity_type}" - end), - "entity_type:environment:project:session:user" => (proc do |project:, environment:, user:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" - end), - "entity_type:location:project:session" => (proc do |project:, location:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}/entityTypes/#{entity_type}" - end), - "entity_type:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest.rb deleted file mode 100644 index 90b414377df2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/session_entity_types/credentials" -require "google/cloud/dialogflow/v2/session_entity_types/paths" -require "google/cloud/dialogflow/v2/session_entity_types/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing - # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/session_entity_types/rest" - # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new - # - module SessionEntityTypes - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/session_entity_types/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb deleted file mode 100644 index 37386c595066..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +++ /dev/null @@ -1,856 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/session_entity_type_pb" -require "google/cloud/dialogflow/v2/session_entity_types/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module SessionEntityTypes - module Rest - ## - # REST client for the SessionEntityTypes service. - # - # Service for managing - # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityTypes}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :session_entity_types_stub - - ## - # Configure the SessionEntityTypes Client class. - # - # See {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SessionEntityTypes clients - # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::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_entity_types_stub.universe_domain - end - - ## - # Create a new SessionEntityTypes REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SessionEntityTypes 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_entity_types_stub = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @session_entity_types_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_entity_types_stub.endpoint - config.universe_domain = @session_entity_types_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @session_entity_types_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_entity_types_stub.logger - end - - # Service calls - - ## - # Returns the list of all session entity types in the specified session. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload list_session_entity_types(request, options = nil) - # Pass arguments to `list_session_entity_types` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_session_entity_types(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_session_entity_types` via keyword arguments. Note that at - # least one keyword argument is 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 session to list all session entity types from. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users// - # sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SessionEntityType>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new - # - # # Call the list_session_entity_types method. - # result = client.list_session_entity_types 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::Dialogflow::V2::SessionEntityType. - # p item - # end - # - def list_session_entity_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest - - # Converts hash and nil to an 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_session_entity_types.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_session_entity_types.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_session_entity_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.list_session_entity_types request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @session_entity_types_stub, :list_session_entity_types, "session_entity_types", 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 - - ## - # Retrieves the specified session entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload get_session_entity_type(request, options = nil) - # Pass arguments to `get_session_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(name: nil) - # Pass arguments to `get_session_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To 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 session entity type. Format: - # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new - # - # # Call the get_session_entity_type method. - # result = client.get_session_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. - # p result - # - def get_session_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest - - # Converts hash and nil to an 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_session_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.get_session_entity_type 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 entity type. - # - # If the specified session entity type already exists, overrides the session - # entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload create_session_entity_type(request, options = nil) - # Pass arguments to `create_session_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(parent: nil, session_entity_type: nil) - # Pass arguments to `create_session_entity_type` via keyword arguments. Note that at - # least one keyword argument is 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 session to create a session entity type for. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users// - # sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @param session_entity_type [::Google::Cloud::Dialogflow::V2::SessionEntityType, ::Hash] - # Required. The session entity type to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new - # - # # Call the create_session_entity_type method. - # result = client.create_session_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. - # p result - # - def create_session_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest - - # Converts hash and nil to an 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_session_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.create_session_entity_type 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 the specified session entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload update_session_entity_type(request, options = nil) - # Pass arguments to `update_session_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(session_entity_type: nil, update_mask: nil) - # Pass arguments to `update_session_entity_type` via keyword arguments. Note that at - # least one keyword argument is 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_entity_type [::Google::Cloud::Dialogflow::V2::SessionEntityType, ::Hash] - # Required. The session entity type to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new - # - # # Call the update_session_entity_type method. - # result = client.update_session_entity_type request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. - # p result - # - def update_session_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest - - # Converts hash and nil to an 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_session_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.update_session_entity_type 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 specified session entity type. - # - # This method doesn't work with Google Assistant integration. - # Contact Dialogflow support if you need to use session entities - # with Google Assistant integration. - # - # @overload delete_session_entity_type(request, options = nil) - # Pass arguments to `delete_session_entity_type` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_entity_type(name: nil) - # Pass arguments to `delete_session_entity_type` via keyword arguments. Note that at - # least one keyword argument is required. To 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 entity type to delete. Format: - # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new - # - # # Call the delete_session_entity_type method. - # result = client.delete_session_entity_type request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_session_entity_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest - - # Converts hash and nil to an 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_entity_type.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_entity_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_session_entity_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @session_entity_types_stub.delete_session_entity_type 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 SessionEntityTypes REST API. - # - # This class represents the configuration for SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::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_session_entity_types to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_session_entity_types.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_session_entity_types.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 SessionEntityTypes 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_session_entity_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_session_entity_types - ## - # RPC-specific configuration for `get_session_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :get_session_entity_type - ## - # RPC-specific configuration for `create_session_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :create_session_entity_type - ## - # RPC-specific configuration for `update_session_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :update_session_entity_type - ## - # RPC-specific configuration for `delete_session_entity_type` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_session_entity_type - - # @private - def initialize parent_rpcs = nil - list_session_entity_types_config = parent_rpcs.list_session_entity_types if parent_rpcs.respond_to? :list_session_entity_types - @list_session_entity_types = ::Gapic::Config::Method.new list_session_entity_types_config - get_session_entity_type_config = parent_rpcs.get_session_entity_type if parent_rpcs.respond_to? :get_session_entity_type - @get_session_entity_type = ::Gapic::Config::Method.new get_session_entity_type_config - create_session_entity_type_config = parent_rpcs.create_session_entity_type if parent_rpcs.respond_to? :create_session_entity_type - @create_session_entity_type = ::Gapic::Config::Method.new create_session_entity_type_config - update_session_entity_type_config = parent_rpcs.update_session_entity_type if parent_rpcs.respond_to? :update_session_entity_type - @update_session_entity_type = ::Gapic::Config::Method.new update_session_entity_type_config - delete_session_entity_type_config = parent_rpcs.delete_session_entity_type if parent_rpcs.respond_to? :delete_session_entity_type - @delete_session_entity_type = ::Gapic::Config::Method.new delete_session_entity_type_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb deleted file mode 100644 index 45160c65d7f7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb +++ /dev/null @@ -1,499 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/session_entity_type_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module SessionEntityTypes - module Rest - ## - # REST service stub for the SessionEntityTypes 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_session_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListSessionEntityTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse] - # A result object deserialized from the server's reply - def list_session_entity_types request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_session_entity_types_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_session_entity_types", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse.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_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # A result object deserialized from the server's reply - def get_session_entity_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_session_entity_type_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_type", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.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_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # A result object deserialized from the server's reply - def create_session_entity_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_session_entity_type_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_type", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.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_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SessionEntityType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # A result object deserialized from the server's reply - def update_session_entity_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_session_entity_type_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_type", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.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_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_entity_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_session_entity_type_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_entity_type", - 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_session_entity_types REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest] - # 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_session_entity_types_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/entityTypes", - matches: [ - ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/entityTypes", - matches: [ - ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/entityTypes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/entityTypes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_session_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest] - # 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_entity_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_session_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest] - # 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_entity_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes", - body: "session_entity_type", - matches: [ - ["parent", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes", - body: "session_entity_type", - matches: [ - ["parent", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes", - body: "session_entity_type", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/entityTypes", - body: "session_entity_type", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_session_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest] - # 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_entity_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{session_entity_type.name}", - body: "session_entity_type", - matches: [ - ["session_entity_type.name", %r{^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{session_entity_type.name}", - body: "session_entity_type", - matches: [ - ["session_entity_type.name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{session_entity_type.name}", - body: "session_entity_type", - matches: [ - ["session_entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{session_entity_type.name}", - body: "session_entity_type", - matches: [ - ["session_entity_type.name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_session_entity_type REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest] - # 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_entity_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/entityTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_pb.rb deleted file mode 100644 index 58b3f3fd3a57..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_pb.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/session.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/dialogflow/v2/audio_config_pb' -require 'google/cloud/dialogflow/v2/context_pb' -require 'google/cloud/dialogflow/v2/intent_pb' -require 'google/cloud/dialogflow/v2/session_entity_type_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' -require 'google/rpc/status_pb' -require 'google/type/latlng_pb' - - -descriptor_data = "\n(google/cloud/dialogflow/v2/session.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/dialogflow/v2/audio_config.proto\x1a(google/cloud/dialogflow/v2/context.proto\x1a\'google/cloud/dialogflow/v2/intent.proto\x1a\x34google/cloud/dialogflow/v2/session_entity_type.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17google/rpc/status.proto\x1a\x18google/type/latlng.proto\"\xf5\x02\n\x13\x44\x65tectIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x41\n\x0cquery_params\x18\x02 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12@\n\x0bquery_input\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.v2.QueryInputB\x03\xe0\x41\x02\x12J\n\x13output_audio_config\x18\x04 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12<\n\x18output_audio_config_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x13\n\x0binput_audio\x18\x05 \x01(\x0c\"\xf8\x01\n\x14\x44\x65tectIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12=\n\x0cquery_result\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResult\x12*\n\x0ewebhook_status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0coutput_audio\x18\x04 \x01(\x0c\x12J\n\x13output_audio_config\x18\x06 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\"\x9f\x04\n\x0fQueryParameters\x12\x11\n\ttime_zone\x18\x01 \x01(\t\x12)\n\x0cgeo_location\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\x12\x35\n\x08\x63ontexts\x18\x03 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x16\n\x0ereset_contexts\x18\x04 \x01(\x08\x12K\n\x14session_entity_types\x18\x05 \x03(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\x12(\n\x07payload\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x65\n!sentiment_analysis_request_config\x18\n \x01(\x0b\x32:.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig\x12X\n\x0fwebhook_headers\x18\x0e \x03(\x0b\x32?.google.cloud.dialogflow.v2.QueryParameters.WebhookHeadersEntry\x12\x10\n\x08platform\x18\x12 \x01(\t\x1a\x35\n\x13WebhookHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xcb\x01\n\nQueryInput\x12\x44\n\x0c\x61udio_config\x18\x01 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigH\x00\x12\x35\n\x04text\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputH\x00\x12\x37\n\x05\x65vent\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInputH\x00\x42\x07\n\x05input\"\xae\x05\n\x0bQueryResult\x12\x12\n\nquery_text\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12%\n\x1dspeech_recognition_confidence\x18\x02 \x01(\x02\x12\x0e\n\x06\x61\x63tion\x18\x03 \x01(\t\x12+\n\nparameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12#\n\x1b\x61ll_required_params_present\x18\x05 \x01(\x08\x12\x1c\n\x14\x63\x61ncels_slot_filling\x18\x15 \x01(\x08\x12\x18\n\x10\x66ulfillment_text\x18\x06 \x01(\t\x12H\n\x14\x66ulfillment_messages\x18\x07 \x03(\x0b\x32*.google.cloud.dialogflow.v2.Intent.Message\x12\x16\n\x0ewebhook_source\x18\x08 \x01(\t\x12\x30\n\x0fwebhook_payload\x18\t \x01(\x0b\x32\x17.google.protobuf.Struct\x12<\n\x0foutput_contexts\x18\n \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x32\n\x06intent\x18\x0b \x01(\x0b\x32\".google.cloud.dialogflow.v2.Intent\x12#\n\x1bintent_detection_confidence\x18\x0c \x01(\x02\x12\x30\n\x0f\x64iagnostic_info\x18\x0e \x01(\x0b\x32\x17.google.protobuf.Struct\x12V\n\x19sentiment_analysis_result\x18\x11 \x01(\x0b\x32\x33.google.cloud.dialogflow.v2.SentimentAnalysisResult\"\xbb\x03\n\x1cStreamingDetectIntentRequest\x12:\n\x07session\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Session\x12\x41\n\x0cquery_params\x18\x02 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12@\n\x0bquery_input\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.v2.QueryInputB\x03\xe0\x41\x02\x12\x1c\n\x10single_utterance\x18\x04 \x01(\x08\x42\x02\x18\x01\x12J\n\x13output_audio_config\x18\x05 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12<\n\x18output_audio_config_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x13\n\x0binput_audio\x18\x06 \x01(\x0c\x12\x1d\n\x15\x65nable_debugging_info\x18\x08 \x01(\x08\"\xb0\x07\n\x1e\x43loudConversationDebuggingInfo\x12\x19\n\x11\x61udio_data_chunks\x18\x01 \x01(\x05\x12\x39\n\x16result_end_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x37\n\x14\x66irst_audio_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10single_utterance\x18\x05 \x01(\x08\x12\x43\n speech_partial_results_end_times\x18\x06 \x03(\x0b\x32\x19.google.protobuf.Duration\x12\x41\n\x1espeech_final_results_end_times\x18\x07 \x03(\x0b\x32\x19.google.protobuf.Duration\x12\x19\n\x11partial_responses\x18\x08 \x01(\x05\x12,\n$speaker_id_passive_latency_ms_offset\x18\t \x01(\x05\x12\x1f\n\x17\x62\x61rgein_event_triggered\x18\n \x01(\x08\x12\x1f\n\x17speech_single_utterance\x18\x0b \x01(\x08\x12=\n\x1a\x64tmf_partial_results_times\x18\x0c \x03(\x0b\x32\x19.google.protobuf.Duration\x12;\n\x18\x64tmf_final_results_times\x18\r \x03(\x0b\x32\x19.google.protobuf.Duration\x12\x43\n single_utterance_end_time_offset\x18\x0e \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x11no_speech_timeout\x18\x0f \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x36\n\x13\x65ndpointing_timeout\x18\x13 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\ris_input_text\x18\x10 \x01(\x08\x12@\n\x1d\x63lient_half_close_time_offset\x18\x11 \x01(\x0b\x32\x19.google.protobuf.Duration\x12J\n\'client_half_close_streaming_time_offset\x18\x12 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xa9\x03\n\x1dStreamingDetectIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12R\n\x12recognition_result\x18\x02 \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.StreamingRecognitionResult\x12=\n\x0cquery_result\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResult\x12*\n\x0ewebhook_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\x12\x14\n\x0coutput_audio\x18\x05 \x01(\x0c\x12J\n\x13output_audio_config\x18\x06 \x01(\x0b\x32-.google.cloud.dialogflow.v2.OutputAudioConfig\x12R\n\x0e\x64\x65\x62ugging_info\x18\x08 \x01(\x0b\x32:.google.cloud.dialogflow.v2.CloudConversationDebuggingInfo\"\x9d\x03\n\x1aStreamingRecognitionResult\x12X\n\x0cmessage_type\x18\x01 \x01(\x0e\x32\x42.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType\x12\x12\n\ntranscript\x18\x02 \x01(\t\x12\x10\n\x08is_final\x18\x03 \x01(\x08\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x44\n\x10speech_word_info\x18\x07 \x03(\x0b\x32*.google.cloud.dialogflow.v2.SpeechWordInfo\x12\x34\n\x11speech_end_offset\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x15\n\rlanguage_code\x18\n \x01(\t\"X\n\x0bMessageType\x12\x1c\n\x18MESSAGE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nTRANSCRIPT\x10\x01\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x02\":\n\tTextInput\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x02\"h\n\nEventInput\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12+\n\nparameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\"F\n\x1eSentimentAnalysisRequestConfig\x12$\n\x1c\x61nalyze_query_text_sentiment\x18\x01 \x01(\x08\"^\n\x17SentimentAnalysisResult\x12\x43\n\x14query_text_sentiment\x18\x01 \x01(\x0b\x32%.google.cloud.dialogflow.v2.Sentiment\"-\n\tSentiment\x12\r\n\x05score\x18\x01 \x01(\x02\x12\x11\n\tmagnitude\x18\x02 \x01(\x02\x32\xe5\x05\n\x08Sessions\x12\xc9\x03\n\x0c\x44\x65tectIntent\x12/.google.cloud.dialogflow.v2.DetectIntentRequest\x1a\x30.google.cloud.dialogflow.v2.DetectIntentResponse\"\xd5\x02\xda\x41\x13session,query_input\x82\xd3\xe4\x93\x02\xb8\x02\"6/v2/{session=projects/*/agent/sessions/*}:detectIntent:\x01*ZR\"M/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent:\x01*ZG\"B/v2/{session=projects/*/locations/*/agent/sessions/*}:detectIntent:\x01*Z^\"Y/v2/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent:\x01*\x12\x92\x01\n\x15StreamingDetectIntent\x12\x38.google.cloud.dialogflow.v2.StreamingDetectIntentRequest\x1a\x39.google.cloud.dialogflow.v2.StreamingDetectIntentResponse\"\x00(\x01\x30\x01\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xe7\x03\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cSessionProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\xd1\x02\n!dialogflow.googleapis.com/Session\x12+projects/{project}/agent/sessions/{session}\x12Sprojects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}\x12@projects/{project}/locations/{location}/agent/sessions/{session}\x12hprojects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - DetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DetectIntentRequest").msgclass - DetectIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DetectIntentResponse").msgclass - QueryParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.QueryParameters").msgclass - QueryInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.QueryInput").msgclass - QueryResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.QueryResult").msgclass - StreamingDetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingDetectIntentRequest").msgclass - CloudConversationDebuggingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CloudConversationDebuggingInfo").msgclass - StreamingDetectIntentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingDetectIntentResponse").msgclass - StreamingRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingRecognitionResult").msgclass - StreamingRecognitionResult::MessageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType").enummodule - TextInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TextInput").msgclass - EventInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EventInput").msgclass - SentimentAnalysisRequestConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig").msgclass - SentimentAnalysisResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SentimentAnalysisResult").msgclass - Sentiment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Sentiment").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_services_pb.rb deleted file mode 100644 index bb5ba0443bf7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/session_services_pb.rb +++ /dev/null @@ -1,77 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/session.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/session_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Sessions - # A service used for session interactions. - # - # For more information, see the [API interactions - # guide](https://cloud.google.com/dialogflow/docs/api-overview). - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Sessions' - - # Processes a natural language query and returns structured, actionable data - # as a result. This method is not idempotent, because it may cause contexts - # and session entity types to be updated, which in turn might affect - # results of future queries. - # - # If you might use - # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) - # or other CCAI products now or in the future, consider using - # [AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] - # instead of `DetectIntent`. `AnalyzeContent` has additional - # functionality for Agent Assist and other CCAI products. - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - rpc :DetectIntent, ::Google::Cloud::Dialogflow::V2::DetectIntentRequest, ::Google::Cloud::Dialogflow::V2::DetectIntentResponse - # Processes a natural language query in audio format in a streaming fashion - # and returns structured, actionable data as a result. This method is only - # available via the gRPC API (not REST). - # - # If you might use - # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) - # or other CCAI products now or in the future, consider using - # [StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] - # instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has - # additional functionality for Agent Assist and other CCAI products. - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - rpc :StreamingDetectIntent, stream(::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest), stream(::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse) - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions.rb deleted file mode 100644 index e7878c3ba995..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/sessions/credentials" -require "google/cloud/dialogflow/v2/sessions/paths" -require "google/cloud/dialogflow/v2/sessions/client" -require "google/cloud/dialogflow/v2/sessions/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # A service used for session interactions. - # - # For more information, see the [API interactions - # guide](https://cloud.google.com/dialogflow/docs/api-overview). - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/sessions" - # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/sessions/rest" - # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new - # - module Sessions - end - end - end - end -end - -helper_path = ::File.join __dir__, "sessions", "helpers.rb" -require "google/cloud/dialogflow/v2/sessions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb deleted file mode 100644 index d8473dfc5199..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb +++ /dev/null @@ -1,663 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/session_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Sessions - ## - # Client for the Sessions service. - # - # A service used for session interactions. - # - # For more information, see the [API interactions - # guide](https://cloud.google.com/dialogflow/docs/api-overview). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :sessions_stub - - ## - # Configure the Sessions Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Sessions::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Sessions clients - # ::Google::Cloud::Dialogflow::V2::Sessions::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.detect_intent.timeout = 220.0 - default_config.rpcs.detect_intent.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.streaming_detect_intent.timeout = 220.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Sessions 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::Dialogflow::V2::Sessions::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 - @sessions_stub.universe_domain - end - - ## - # Create a new Sessions client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Sessions 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/dialogflow/v2/session_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 - - @sessions_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Sessions::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 - ) - - @sessions_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 = @sessions_stub.endpoint - config.universe_domain = @sessions_stub.universe_domain - config.logger = @sessions_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 - @sessions_stub.logger - end - - # Service calls - - ## - # Processes a natural language query and returns structured, actionable data - # as a result. This method is not idempotent, because it may cause contexts - # and session entity types to be updated, which in turn might affect - # results of future queries. - # - # If you might use - # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) - # or other CCAI products now or in the future, consider using - # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content AnalyzeContent} - # instead of `DetectIntent`. `AnalyzeContent` has additional - # functionality for Agent Assist and other CCAI products. - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # - # @overload detect_intent(request, options = nil) - # Pass arguments to `detect_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DetectIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, output_audio_config_mask: nil, input_audio: nil) - # Pass arguments to `detect_intent` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The name of the session this query is sent to. Format: - # `projects//agent/sessions/`, or - # `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - # default 'draft' environment (`Environment ID` might be referred to as - # environment name at some places). If `User ID` is not specified, we are - # using "-". It's up to the API caller to choose an appropriate `Session ID` - # and `User Id`. They can be a random number or some type of user and session - # identifiers (preferably hashed). The length of the `Session ID` and - # `User ID` must not exceed 36 characters. - # - # For more information, see the [API interactions - # guide](https://cloud.google.com/dialogflow/docs/api-overview). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash] - # The parameters of this query. - # @param query_input [::Google::Cloud::Dialogflow::V2::QueryInput, ::Hash] - # Required. The input specification. It can be set to: - # - # 1. an audio config which instructs the speech recognizer how to process - # the speech audio, - # - # 2. a conversational query in the form of text, or - # - # 3. an event that specifies which intent to trigger. - # @param output_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash] - # Instructs the speech synthesizer how to generate the output - # audio. If this field is not set and agent-level speech synthesizer is not - # configured, no output audio is generated. - # @param output_audio_config_mask [::Google::Protobuf::FieldMask, ::Hash] - # Mask for - # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} - # indicating which settings in this request-level config should override - # speech synthesizer settings defined at agent-level. - # - # If unspecified or empty, - # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} - # replaces the agent-level config in its entirety. - # @param input_audio [::String] - # The natural language speech audio to be processed. This field - # should be populated iff `query_input` is set to an input audio config. - # A single request can contain up to 1 minute of speech audio data. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Sessions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DetectIntentRequest.new - # - # # Call the detect_intent method. - # result = client.detect_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::DetectIntentResponse. - # p result - # - def detect_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DetectIntentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.detect_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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 - header_params["session"] = request.session - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.detect_intent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.detect_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.call_rpc :detect_intent, 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 - - ## - # Processes a natural language query in audio format in a streaming fashion - # and returns structured, actionable data as a result. This method is only - # available via the gRPC API (not REST). - # - # If you might use - # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) - # or other CCAI products now or in the future, consider using - # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content StreamingAnalyzeContent} - # instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has - # additional functionality for Agent Assist and other CCAI products. - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest, ::Hash>] - # An enumerable of {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest} 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::Dialogflow::V2::StreamingDetectIntentResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Sessions::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the streaming_detect_intent method to start streaming. - # output = client.streaming_detect_intent 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::Dialogflow::V2::StreamingDetectIntentRequest.new - # input << Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse - # output.each do |current_response| - # p current_response - # end - # - def streaming_detect_intent 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::Dialogflow::V2::StreamingDetectIntentRequest - 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.streaming_detect_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::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.streaming_detect_intent.timeout, - metadata: metadata, - retry_policy: @config.rpcs.streaming_detect_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.call_rpc :streaming_detect_intent, 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 Sessions API. - # - # This class represents the configuration for Sessions, - # 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::Dialogflow::V2::Sessions::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 - # # detect_intent to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Sessions::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.detect_intent.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.detect_intent.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::Dialogflow::V2::Sessions::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Sessions 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `detect_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :detect_intent - ## - # RPC-specific configuration for `streaming_detect_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :streaming_detect_intent - - # @private - def initialize parent_rpcs = nil - detect_intent_config = parent_rpcs.detect_intent if parent_rpcs.respond_to? :detect_intent - @detect_intent = ::Gapic::Config::Method.new detect_intent_config - streaming_detect_intent_config = parent_rpcs.streaming_detect_intent if parent_rpcs.respond_to? :streaming_detect_intent - @streaming_detect_intent = ::Gapic::Config::Method.new streaming_detect_intent_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/credentials.rb deleted file mode 100644 index 719484c5b734..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Sessions - # Credentials for the Sessions API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/paths.rb deleted file mode 100644 index 39fd39c82662..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/paths.rb +++ /dev/null @@ -1,299 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module Sessions - # Path helper methods for the Sessions API. - module Paths - ## - # Create a fully-qualified Context resource string. - # - # @overload context_path(project:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # @param context [String] - # - # @overload context_path(project:, location:, environment:, user:, session:, context:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param context [String] - # - # @return [::String] - def context_path **args - resources = { - "context:project:session" => (proc do |project:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:project:session:user" => (proc do |project:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - end), - "context:location:project:session" => (proc do |project:, location:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}" - end), - "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}" - 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 PhraseSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - # - # @param project [String] - # @param location [String] - # @param phrase_set [String] - # - # @return [::String] - def phrase_set_path project:, location:, phrase_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}" - end - - ## - # Create a fully-qualified Session resource string. - # - # @overload session_path(project:, session:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}` - # - # @param project [String] - # @param session [String] - # - # @overload session_path(project:, environment:, user:, session:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # - # @overload session_path(project:, location:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # - # @overload session_path(project:, location:, environment:, user:, session:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # - # @return [::String] - def session_path **args - resources = { - "project:session" => (proc do |project:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}" - end), - "environment:project:session:user" => (proc do |project:, environment:, user:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}" - end), - "location:project:session" => (proc do |project:, location:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}" - end), - "environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/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 - - ## - # Create a fully-qualified SessionEntityType resource string. - # - # @overload session_entity_type_path(project:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, environment:, user:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, location:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param session [String] - # @param entity_type [String] - # - # @overload session_entity_type_path(project:, location:, environment:, user:, session:, entity_type:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}` - # - # @param project [String] - # @param location [String] - # @param environment [String] - # @param user [String] - # @param session [String] - # @param entity_type [String] - # - # @return [::String] - def session_entity_type_path **args - resources = { - "entity_type:project:session" => (proc do |project:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/sessions/#{session}/entityTypes/#{entity_type}" - end), - "entity_type:environment:project:session:user" => (proc do |project:, environment:, user:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" - end), - "entity_type:location:project:session" => (proc do |project:, location:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/sessions/#{session}/entityTypes/#{entity_type}" - end), - "entity_type:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, entity_type:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/" - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest.rb deleted file mode 100644 index a54dfd0aa54d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest.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/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/sessions/credentials" -require "google/cloud/dialogflow/v2/sessions/paths" -require "google/cloud/dialogflow/v2/sessions/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # A service used for session interactions. - # - # For more information, see the [API interactions - # guide](https://cloud.google.com/dialogflow/docs/api-overview). - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/sessions/rest" - # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new - # - module Sessions - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/sessions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb deleted file mode 100644 index 9eecf6c3ffb2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +++ /dev/null @@ -1,521 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/session_pb" -require "google/cloud/dialogflow/v2/sessions/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Sessions - module Rest - ## - # REST client for the Sessions service. - # - # A service used for session interactions. - # - # For more information, see the [API interactions - # guide](https://cloud.google.com/dialogflow/docs/api-overview). - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :sessions_stub - - ## - # Configure the Sessions Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Sessions clients - # ::Google::Cloud::Dialogflow::V2::Sessions::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.detect_intent.timeout = 220.0 - default_config.rpcs.detect_intent.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Sessions 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::Dialogflow::V2::Sessions::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 - @sessions_stub.universe_domain - end - - ## - # Create a new Sessions REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Sessions 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 - - @sessions_stub = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @sessions_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 = @sessions_stub.endpoint - config.universe_domain = @sessions_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @sessions_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 - @sessions_stub.logger - end - - # Service calls - - ## - # Processes a natural language query and returns structured, actionable data - # as a result. This method is not idempotent, because it may cause contexts - # and session entity types to be updated, which in turn might affect - # results of future queries. - # - # If you might use - # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) - # or other CCAI products now or in the future, consider using - # {::Google::Cloud::Dialogflow::V2::Participants::Rest::Client#analyze_content AnalyzeContent} - # instead of `DetectIntent`. `AnalyzeContent` has additional - # functionality for Agent Assist and other CCAI products. - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # - # @overload detect_intent(request, options = nil) - # Pass arguments to `detect_intent` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DetectIntentRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload detect_intent(session: nil, query_params: nil, query_input: nil, output_audio_config: nil, output_audio_config_mask: nil, input_audio: nil) - # Pass arguments to `detect_intent` via keyword arguments. Note that at - # least one keyword argument is 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 [::String] - # Required. The name of the session this query is sent to. Format: - # `projects//agent/sessions/`, or - # `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - # default 'draft' environment (`Environment ID` might be referred to as - # environment name at some places). If `User ID` is not specified, we are - # using "-". It's up to the API caller to choose an appropriate `Session ID` - # and `User Id`. They can be a random number or some type of user and session - # identifiers (preferably hashed). The length of the `Session ID` and - # `User ID` must not exceed 36 characters. - # - # For more information, see the [API interactions - # guide](https://cloud.google.com/dialogflow/docs/api-overview). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash] - # The parameters of this query. - # @param query_input [::Google::Cloud::Dialogflow::V2::QueryInput, ::Hash] - # Required. The input specification. It can be set to: - # - # 1. an audio config which instructs the speech recognizer how to process - # the speech audio, - # - # 2. a conversational query in the form of text, or - # - # 3. an event that specifies which intent to trigger. - # @param output_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash] - # Instructs the speech synthesizer how to generate the output - # audio. If this field is not set and agent-level speech synthesizer is not - # configured, no output audio is generated. - # @param output_audio_config_mask [::Google::Protobuf::FieldMask, ::Hash] - # Mask for - # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} - # indicating which settings in this request-level config should override - # speech synthesizer settings defined at agent-level. - # - # If unspecified or empty, - # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} - # replaces the agent-level config in its entirety. - # @param input_audio [::String] - # The natural language speech audio to be processed. This field - # should be populated iff `query_input` is set to an input audio config. - # A single request can contain up to 1 minute of speech audio data. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DetectIntentRequest.new - # - # # Call the detect_intent method. - # result = client.detect_intent request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::DetectIntentResponse. - # p result - # - def detect_intent request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DetectIntentRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.detect_intent.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.detect_intent.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.detect_intent.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sessions_stub.detect_intent 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 Sessions REST API. - # - # This class represents the configuration for Sessions 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::Dialogflow::V2::Sessions::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 - # # detect_intent to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.detect_intent.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.detect_intent.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Sessions 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `detect_intent` - # @return [::Gapic::Config::Method] - # - attr_reader :detect_intent - - # @private - def initialize parent_rpcs = nil - detect_intent_config = parent_rpcs.detect_intent if parent_rpcs.respond_to? :detect_intent - @detect_intent = ::Gapic::Config::Method.new detect_intent_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb deleted file mode 100644 index 57eddd51008a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb +++ /dev/null @@ -1,167 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/session_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Sessions - module Rest - ## - # REST service stub for the Sessions 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 detect_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DetectIntentRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::DetectIntentResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] - # A result object deserialized from the server's reply - def detect_intent request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_detect_intent_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "detect_intent", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::DetectIntentResponse.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 detect_intent REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DetectIntentRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_detect_intent_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{session}:detectIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{session}:detectIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{session}:detectIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/locations/[^/]+/agent/sessions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{session}:detectIntent", - body: "*", - matches: [ - ["session", %r{^projects/[^/]+/locations/[^/]+/agent/environments/[^/]+/users/[^/]+/sessions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_pb.rb deleted file mode 100644 index 86c669511b75..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_pb.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/sip_trunk.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/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n*google/cloud/dialogflow/v2/sip_trunk.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x91\x01\n\x15\x43reateSipTrunkRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/SipTrunk\x12<\n\tsip_trunk\x18\x02 \x01(\x0b\x32$.google.cloud.dialogflow.v2.SipTrunkB\x03\xe0\x41\x02\"Q\n\x15\x44\x65leteSipTrunkRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/SipTrunk\"\x83\x01\n\x14ListSipTrunksRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"dialogflow.googleapis.com/SipTrunk\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\"j\n\x15ListSipTrunksResponse\x12\x38\n\nsip_trunks\x18\x01 \x03(\x0b\x32$.google.cloud.dialogflow.v2.SipTrunk\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x12GetSipTrunkRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"dialogflow.googleapis.com/SipTrunk\"\x8b\x01\n\x15UpdateSipTrunkRequest\x12<\n\tsip_trunk\x18\x01 \x01(\x0b\x32$.google.cloud.dialogflow.v2.SipTrunkB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x96\x02\n\x08SipTrunk\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1e\n\x11\x65xpected_hostname\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12@\n\x0b\x63onnections\x18\x03 \x03(\x0b\x32&.google.cloud.dialogflow.v2.ConnectionB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01:z\xea\x41w\n\"dialogflow.googleapis.com/SipTrunk\x12\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v2/{parent=projects/*/locations/*}/sipTrunks\x12\xa1\x01\n\x0bGetSipTrunk\x12..google.cloud.dialogflow.v2.GetSipTrunkRequest\x1a$.google.cloud.dialogflow.v2.SipTrunk\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v2/{name=projects/*/locations/*/sipTrunks/*}\x12\xcd\x01\n\x0eUpdateSipTrunk\x12\x31.google.cloud.dialogflow.v2.UpdateSipTrunkRequest\x1a$.google.cloud.dialogflow.v2.SipTrunk\"b\xda\x41\x15sip_trunk,update_mask\x82\xd3\xe4\x93\x02\x44\x32\x37/v2/{sip_trunk.name=projects/*/locations/*/sipTrunks/*}:\tsip_trunk\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x93\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\rSipTrunkProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - CreateSipTrunkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateSipTrunkRequest").msgclass - DeleteSipTrunkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteSipTrunkRequest").msgclass - ListSipTrunksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListSipTrunksRequest").msgclass - ListSipTrunksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListSipTrunksResponse").msgclass - GetSipTrunkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetSipTrunkRequest").msgclass - UpdateSipTrunkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateSipTrunkRequest").msgclass - SipTrunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SipTrunk").msgclass - Connection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Connection").msgclass - Connection::ErrorDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Connection.ErrorDetails").msgclass - Connection::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Connection.State").enummodule - Connection::CertificateState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Connection.CertificateState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_services_pb.rb deleted file mode 100644 index 1ae92b63af91..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunk_services_pb.rb +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/sip_trunk.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/sip_trunk_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module SipTrunks - # Service for managing [SipTrunks][google.cloud.dialogflow.v2.SipTrunk]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.SipTrunks' - - # Creates a SipTrunk for a specified location. - rpc :CreateSipTrunk, ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest, ::Google::Cloud::Dialogflow::V2::SipTrunk - # Deletes a specified SipTrunk. - rpc :DeleteSipTrunk, ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest, ::Google::Protobuf::Empty - # Returns a list of SipTrunks in the specified location. - rpc :ListSipTrunks, ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest, ::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse - # Retrieves the specified SipTrunk. - rpc :GetSipTrunk, ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest, ::Google::Cloud::Dialogflow::V2::SipTrunk - # Updates the specified SipTrunk. - rpc :UpdateSipTrunk, ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest, ::Google::Cloud::Dialogflow::V2::SipTrunk - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks.rb deleted file mode 100644 index cf2b2e46636c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/sip_trunks/credentials" -require "google/cloud/dialogflow/v2/sip_trunks/paths" -require "google/cloud/dialogflow/v2/sip_trunks/client" -require "google/cloud/dialogflow/v2/sip_trunks/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::SipTrunk SipTrunks}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/sip_trunks" - # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/sip_trunks/rest" - # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new - # - module SipTrunks - end - end - end - end -end - -helper_path = ::File.join __dir__, "sip_trunks", "helpers.rb" -require "google/cloud/dialogflow/v2/sip_trunks/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/client.rb deleted file mode 100644 index c4085a591b93..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/client.rb +++ /dev/null @@ -1,887 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/sip_trunk_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module SipTrunks - ## - # Client for the SipTrunks service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::SipTrunk SipTrunks}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :sip_trunks_stub - - ## - # Configure the SipTrunks Client class. - # - # See {::Google::Cloud::Dialogflow::V2::SipTrunks::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SipTrunks clients - # ::Google::Cloud::Dialogflow::V2::SipTrunks::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SipTrunks 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::Dialogflow::V2::SipTrunks::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 - @sip_trunks_stub.universe_domain - end - - ## - # Create a new SipTrunks client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SipTrunks 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/dialogflow/v2/sip_trunk_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 - - @sip_trunks_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::SipTrunks::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 - ) - - @sip_trunks_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 = @sip_trunks_stub.endpoint - config.universe_domain = @sip_trunks_stub.universe_domain - config.logger = @sip_trunks_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 - @sip_trunks_stub.logger - end - - # Service calls - - ## - # Creates a SipTrunk for a specified location. - # - # @overload create_sip_trunk(request, options = nil) - # Pass arguments to `create_sip_trunk` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunk(parent: nil, sip_trunk: nil) - # Pass arguments to `create_sip_trunk` via keyword arguments. Note that at - # least one keyword argument is 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 location to create a SIP trunk for. - # Format: `projects//locations/`. - # @param sip_trunk [::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash] - # Required. The SIP trunk to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SipTrunk] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new - # - # # Call the create_sip_trunk method. - # result = client.create_sip_trunk request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. - # p result - # - def create_sip_trunk request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest - - # Converts hash and nil to 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_sip_trunk.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_sip_trunk.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_sip_trunk.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.call_rpc :create_sip_trunk, 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 specified SipTrunk. - # - # @overload delete_sip_trunk(request, options = nil) - # Pass arguments to `delete_sip_trunk` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunk(name: nil) - # Pass arguments to `delete_sip_trunk` via keyword arguments. Note that at - # least one keyword argument is required. To 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 SIP trunk to delete. - # Format: `projects//locations//sipTrunks/`. - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new - # - # # Call the delete_sip_trunk method. - # result = client.delete_sip_trunk request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_sip_trunk request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest - - # Converts hash and nil to 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_sip_trunk.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_sip_trunk.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_sip_trunk.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.call_rpc :delete_sip_trunk, 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 - - ## - # Returns a list of SipTrunks in the specified location. - # - # @overload list_sip_trunks(request, options = nil) - # Pass arguments to `list_sip_trunks` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunks(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_sip_trunks` via keyword arguments. Note that at - # least one keyword argument is 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 location to list SIP trunks from. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.new - # - # # Call the list_sip_trunks method. - # result = client.list_sip_trunks 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::Dialogflow::V2::SipTrunk. - # p item - # end - # - def list_sip_trunks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest - - # Converts hash and nil to 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_sip_trunks.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_sip_trunks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sip_trunks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.call_rpc :list_sip_trunks, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @sip_trunks_stub, :list_sip_trunks, 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 - - ## - # Retrieves the specified SipTrunk. - # - # @overload get_sip_trunk(request, options = nil) - # Pass arguments to `get_sip_trunk` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunk(name: nil) - # Pass arguments to `get_sip_trunk` via keyword arguments. Note that at - # least one keyword argument is required. To 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 SIP trunk to delete. - # Format: `projects//locations//sipTrunks/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SipTrunk] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new - # - # # Call the get_sip_trunk method. - # result = client.get_sip_trunk request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. - # p result - # - def get_sip_trunk request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest - - # Converts hash and nil to 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_sip_trunk.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_sip_trunk.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_sip_trunk.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.call_rpc :get_sip_trunk, 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 the specified SipTrunk. - # - # @overload update_sip_trunk(request, options = nil) - # Pass arguments to `update_sip_trunk` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunk(sip_trunk: nil, update_mask: nil) - # Pass arguments to `update_sip_trunk` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param sip_trunk [::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash] - # Required. The SipTrunk to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. If the mask is not - # present, all fields will be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::SipTrunk] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new - # - # # Call the update_sip_trunk method. - # result = client.update_sip_trunk request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. - # p result - # - def update_sip_trunk request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest - - # Converts hash and nil to 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_sip_trunk.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.sip_trunk&.name - header_params["sip_trunk.name"] = request.sip_trunk.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_sip_trunk.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_sip_trunk.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.call_rpc :update_sip_trunk, 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 SipTrunks API. - # - # This class represents the configuration for SipTrunks, - # 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::Dialogflow::V2::SipTrunks::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_sip_trunk to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_sip_trunk.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_sip_trunk.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::Dialogflow::V2::SipTrunks::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 SipTrunks 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_sip_trunk` - # @return [::Gapic::Config::Method] - # - attr_reader :create_sip_trunk - ## - # RPC-specific configuration for `delete_sip_trunk` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_sip_trunk - ## - # RPC-specific configuration for `list_sip_trunks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sip_trunks - ## - # RPC-specific configuration for `get_sip_trunk` - # @return [::Gapic::Config::Method] - # - attr_reader :get_sip_trunk - ## - # RPC-specific configuration for `update_sip_trunk` - # @return [::Gapic::Config::Method] - # - attr_reader :update_sip_trunk - - # @private - def initialize parent_rpcs = nil - create_sip_trunk_config = parent_rpcs.create_sip_trunk if parent_rpcs.respond_to? :create_sip_trunk - @create_sip_trunk = ::Gapic::Config::Method.new create_sip_trunk_config - delete_sip_trunk_config = parent_rpcs.delete_sip_trunk if parent_rpcs.respond_to? :delete_sip_trunk - @delete_sip_trunk = ::Gapic::Config::Method.new delete_sip_trunk_config - list_sip_trunks_config = parent_rpcs.list_sip_trunks if parent_rpcs.respond_to? :list_sip_trunks - @list_sip_trunks = ::Gapic::Config::Method.new list_sip_trunks_config - get_sip_trunk_config = parent_rpcs.get_sip_trunk if parent_rpcs.respond_to? :get_sip_trunk - @get_sip_trunk = ::Gapic::Config::Method.new get_sip_trunk_config - update_sip_trunk_config = parent_rpcs.update_sip_trunk if parent_rpcs.respond_to? :update_sip_trunk - @update_sip_trunk = ::Gapic::Config::Method.new update_sip_trunk_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/credentials.rb deleted file mode 100644 index 2364ac38eac9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module SipTrunks - # Credentials for the SipTrunks API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/paths.rb deleted file mode 100644 index e3f7d2ffa2d6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/paths.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module SipTrunks - # Path helper methods for the SipTrunks API. - module Paths - ## - # 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 SipTrunk resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sipTrunks/{siptrunk}` - # - # @param project [String] - # @param location [String] - # @param siptrunk [String] - # - # @return [::String] - def sip_trunk_path project:, location:, siptrunk: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sipTrunks/#{siptrunk}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest.rb deleted file mode 100644 index 7e01c1fc35b8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/sip_trunks/credentials" -require "google/cloud/dialogflow/v2/sip_trunks/paths" -require "google/cloud/dialogflow/v2/sip_trunks/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::SipTrunk SipTrunks}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/sip_trunks/rest" - # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new - # - module SipTrunks - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/sip_trunks/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/client.rb deleted file mode 100644 index b9188fa28bdd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/client.rb +++ /dev/null @@ -1,817 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/sip_trunk_pb" -require "google/cloud/dialogflow/v2/sip_trunks/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module SipTrunks - module Rest - ## - # REST client for the SipTrunks service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::SipTrunk SipTrunks}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :sip_trunks_stub - - ## - # Configure the SipTrunks Client class. - # - # See {::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SipTrunks clients - # ::Google::Cloud::Dialogflow::V2::SipTrunks::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SipTrunks 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::Dialogflow::V2::SipTrunks::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 - @sip_trunks_stub.universe_domain - end - - ## - # Create a new SipTrunks REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SipTrunks 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 - - @sip_trunks_stub = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @sip_trunks_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 = @sip_trunks_stub.endpoint - config.universe_domain = @sip_trunks_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @sip_trunks_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 - @sip_trunks_stub.logger - end - - # Service calls - - ## - # Creates a SipTrunk for a specified location. - # - # @overload create_sip_trunk(request, options = nil) - # Pass arguments to `create_sip_trunk` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunk(parent: nil, sip_trunk: nil) - # Pass arguments to `create_sip_trunk` via keyword arguments. Note that at - # least one keyword argument is 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 location to create a SIP trunk for. - # Format: `projects//locations/`. - # @param sip_trunk [::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash] - # Required. The SIP trunk to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SipTrunk] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new - # - # # Call the create_sip_trunk method. - # result = client.create_sip_trunk request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. - # p result - # - def create_sip_trunk request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest - - # Converts hash and nil to an 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_sip_trunk.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_sip_trunk.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_sip_trunk.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.create_sip_trunk 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 specified SipTrunk. - # - # @overload delete_sip_trunk(request, options = nil) - # Pass arguments to `delete_sip_trunk` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunk(name: nil) - # Pass arguments to `delete_sip_trunk` via keyword arguments. Note that at - # least one keyword argument is required. To 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 SIP trunk to delete. - # Format: `projects//locations//sipTrunks/`. - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new - # - # # Call the delete_sip_trunk method. - # result = client.delete_sip_trunk request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_sip_trunk request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest - - # Converts hash and nil to an 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_sip_trunk.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_sip_trunk.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_sip_trunk.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.delete_sip_trunk 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 - - ## - # Returns a list of SipTrunks in the specified location. - # - # @overload list_sip_trunks(request, options = nil) - # Pass arguments to `list_sip_trunks` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunks(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_sip_trunks` via keyword arguments. Note that at - # least one keyword argument is 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 location to list SIP trunks from. - # Format: `projects//locations/`. - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::SipTrunk>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.new - # - # # Call the list_sip_trunks method. - # result = client.list_sip_trunks 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::Dialogflow::V2::SipTrunk. - # p item - # end - # - def list_sip_trunks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest - - # Converts hash and nil to an 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_sip_trunks.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_sip_trunks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_sip_trunks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.list_sip_trunks request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @sip_trunks_stub, :list_sip_trunks, "sip_trunks", 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 - - ## - # Retrieves the specified SipTrunk. - # - # @overload get_sip_trunk(request, options = nil) - # Pass arguments to `get_sip_trunk` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunk(name: nil) - # Pass arguments to `get_sip_trunk` via keyword arguments. Note that at - # least one keyword argument is required. To 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 SIP trunk to delete. - # Format: `projects//locations//sipTrunks/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SipTrunk] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new - # - # # Call the get_sip_trunk method. - # result = client.get_sip_trunk request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. - # p result - # - def get_sip_trunk request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest - - # Converts hash and nil to an 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_sip_trunk.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_sip_trunk.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_sip_trunk.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.get_sip_trunk 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 the specified SipTrunk. - # - # @overload update_sip_trunk(request, options = nil) - # Pass arguments to `update_sip_trunk` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sip_trunk(sip_trunk: nil, update_mask: nil) - # Pass arguments to `update_sip_trunk` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param sip_trunk [::Google::Cloud::Dialogflow::V2::SipTrunk, ::Hash] - # Required. The SipTrunk to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The mask to control which fields get updated. If the mask is not - # present, all fields will be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::SipTrunk] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new - # - # # Call the update_sip_trunk method. - # result = client.update_sip_trunk request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. - # p result - # - def update_sip_trunk request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest - - # Converts hash and nil to an 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_sip_trunk.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_sip_trunk.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_sip_trunk.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @sip_trunks_stub.update_sip_trunk 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 SipTrunks REST API. - # - # This class represents the configuration for SipTrunks 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::Dialogflow::V2::SipTrunks::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_sip_trunk to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_sip_trunk.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_sip_trunk.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 SipTrunks 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_sip_trunk` - # @return [::Gapic::Config::Method] - # - attr_reader :create_sip_trunk - ## - # RPC-specific configuration for `delete_sip_trunk` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_sip_trunk - ## - # RPC-specific configuration for `list_sip_trunks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sip_trunks - ## - # RPC-specific configuration for `get_sip_trunk` - # @return [::Gapic::Config::Method] - # - attr_reader :get_sip_trunk - ## - # RPC-specific configuration for `update_sip_trunk` - # @return [::Gapic::Config::Method] - # - attr_reader :update_sip_trunk - - # @private - def initialize parent_rpcs = nil - create_sip_trunk_config = parent_rpcs.create_sip_trunk if parent_rpcs.respond_to? :create_sip_trunk - @create_sip_trunk = ::Gapic::Config::Method.new create_sip_trunk_config - delete_sip_trunk_config = parent_rpcs.delete_sip_trunk if parent_rpcs.respond_to? :delete_sip_trunk - @delete_sip_trunk = ::Gapic::Config::Method.new delete_sip_trunk_config - list_sip_trunks_config = parent_rpcs.list_sip_trunks if parent_rpcs.respond_to? :list_sip_trunks - @list_sip_trunks = ::Gapic::Config::Method.new list_sip_trunks_config - get_sip_trunk_config = parent_rpcs.get_sip_trunk if parent_rpcs.respond_to? :get_sip_trunk - @get_sip_trunk = ::Gapic::Config::Method.new get_sip_trunk_config - update_sip_trunk_config = parent_rpcs.update_sip_trunk if parent_rpcs.respond_to? :update_sip_trunk - @update_sip_trunk = ::Gapic::Config::Method.new update_sip_trunk_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/rest/service_stub.rb deleted file mode 100644 index 393ddef453ab..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sip_trunks/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/dialogflow/v2/sip_trunk_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module SipTrunks - module Rest - ## - # REST service stub for the SipTrunks 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_sip_trunk REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SipTrunk] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # A result object deserialized from the server's reply - def create_sip_trunk request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_sip_trunk_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_sip_trunk", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SipTrunk.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_sip_trunk REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_sip_trunk request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_sip_trunk_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_sip_trunk", - 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 list_sip_trunks REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListSipTrunksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse] - # A result object deserialized from the server's reply - def list_sip_trunks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_sip_trunks_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_sip_trunks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse.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_sip_trunk REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SipTrunk] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # A result object deserialized from the server's reply - def get_sip_trunk request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_sip_trunk_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_sip_trunk", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SipTrunk.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_sip_trunk REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::SipTrunk] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # A result object deserialized from the server's reply - def update_sip_trunk request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_sip_trunk_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_sip_trunk", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::SipTrunk.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_sip_trunk REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest] - # 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_sip_trunk_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/sipTrunks", - body: "sip_trunk", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_sip_trunk REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest] - # 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_sip_trunk_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sipTrunks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_sip_trunks REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest] - # 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_sip_trunks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/sipTrunks", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_sip_trunk REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest] - # 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_sip_trunk_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sipTrunks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_sip_trunk REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest] - # 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_sip_trunk_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{sip_trunk.name}", - body: "sip_trunk", - matches: [ - ["sip_trunk.name", %r{^projects/[^/]+/locations/[^/]+/sipTrunks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_call_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_call_pb.rb deleted file mode 100644 index d12d5335e9b9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_call_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/tool_call.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n*google/cloud/dialogflow/v2/tool_call.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd8\x04\n\x08ToolCall\x12\x36\n\x04tool\x18\x01 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/ToolH\x00\x12\x33\n\x08\x63\x65s_tool\x18\x0b \x01(\tB\x1f\xe0\x41\x01\xfa\x41\x19\n\x17\x63\x65s.googleapis.com/ToolH\x00\x12\x39\n\x0b\x63\x65s_toolset\x18\x0c \x01(\tB\"\xe0\x41\x01\xfa\x41\x1c\n\x1a\x63\x65s.googleapis.com/ToolsetH\x00\x12\x31\n\x07\x63\x65s_app\x18\x08 \x01(\tB\x1e\xe0\x41\x01\xfa\x41\x18\n\x16\x63\x65s.googleapis.com/AppH\x00\x12\x1e\n\x11tool_display_name\x18\t \x01(\tB\x03\xe0\x41\x01\x12!\n\x14tool_display_details\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x61\x63tion\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x36\n\x10input_parameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\ranswer_record\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12>\n\x05state\x18\x07 \x01(\x0e\x32*.google.cloud.dialogflow.v2.ToolCall.StateB\x03\xe0\x41\x03\"E\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tTRIGGERED\x10\x01\x12\x16\n\x12NEEDS_CONFIRMATION\x10\x02\x42\x08\n\x06source\"\xf2\x03\n\x0eToolCallResult\x12\x36\n\x04tool\x18\x01 \x01(\tB&\xe0\x41\x01\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/ToolH\x00\x12\x39\n\x0b\x63\x65s_toolset\x18\r \x01(\tB\"\xe0\x41\x01\xfa\x41\x1c\n\x1a\x63\x65s.googleapis.com/ToolsetH\x00\x12\x33\n\x08\x63\x65s_tool\x18\x0c \x01(\tB\x1f\xe0\x41\x01\xfa\x41\x19\n\x17\x63\x65s.googleapis.com/ToolH\x00\x12\x31\n\x07\x63\x65s_app\x18\x0b \x01(\tB\x1e\xe0\x41\x01\xfa\x41\x18\n\x16\x63\x65s.googleapis.com/AppH\x00\x12\x13\n\x06\x61\x63tion\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x41\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.ToolCallResult.ErrorH\x01\x12\x15\n\x0braw_content\x18\x05 \x01(\x0cH\x01\x12\x11\n\x07\x63ontent\x18\x06 \x01(\tH\x01\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\ranswer_record\x18\t \x01(\tB\x03\xe0\x41\x01\x1a\x1d\n\x05\x45rror\x12\x14\n\x07message\x18\x01 \x01(\tB\x03\xe0\x41\x01\x42\x08\n\x06sourceB\x08\n\x06resultB\x93\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\rToolCallProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - ToolCall = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolCall").msgclass - ToolCall::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolCall.State").enummodule - ToolCallResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolCallResult").msgclass - ToolCallResult::Error = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolCallResult.Error").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_pb.rb deleted file mode 100644 index 03ba94b43d4b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/tool.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/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n%google/cloud/dialogflow/v2/tool.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x96\x01\n\x11\x43reateToolRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Tool\x12\x33\n\x04tool\x18\x02 \x01(\x0b\x32 .google.cloud.dialogflow.v2.ToolB\x03\xe0\x41\x02\x12\x14\n\x07tool_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"F\n\x0eGetToolRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\"{\n\x10ListToolsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64ialogflow.googleapis.com/Tool\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\"]\n\x11ListToolsResponse\x12/\n\x05tools\x18\x01 \x03(\x0b\x32 .google.cloud.dialogflow.v2.Tool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"I\n\x11\x44\x65leteToolRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64ialogflow.googleapis.com/Tool\"~\n\x11UpdateToolRequest\x12\x33\n\x04tool\x18\x01 \x01(\x0b\x32 .google.cloud.dialogflow.v2.ToolB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xae\x1f\n\x04Tool\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12\x15\n\x08tool_key\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0c\x64isplay_name\x18\x13 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12q\n\x1f\x61\x63tion_confirmation_requirement\x18\x11 \x03(\x0b\x32\x43.google.cloud.dialogflow.v2.Tool.ActionConfirmationRequirementEntryB\x03\xe0\x41\x01\x12L\n\x0e\x65xtension_spec\x18\x04 \x01(\x0b\x32..google.cloud.dialogflow.v2.Tool.ExtensionToolB\x02\x18\x01H\x00\x12\x46\n\rfunction_spec\x18\r \x01(\x0b\x32-.google.cloud.dialogflow.v2.Tool.FunctionToolH\x00\x12H\n\x0e\x63onnector_spec\x18\x12 \x01(\x0b\x32..google.cloud.dialogflow.v2.Tool.ConnectorToolH\x00\x12\x45\n\ropen_api_spec\x18\x14 \x01(\x0b\x32,.google.cloud.dialogflow.v2.Tool.OpenApiToolH\x00\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzs\x18\x0e \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\x1a\"\n\rExtensionTool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a\xbe\x01\n\x0c\x46unctionTool\x12\x32\n\x0cinput_schema\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x33\n\routput_schema\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructB\x03\xe0\x41\x01\x12\x45\n\x0bmethod_type\x18\x04 \x01(\x0e\x32+.google.cloud.dialogflow.v2.Tool.MethodTypeB\x03\xe0\x41\x01\x1a\xa6\x02\n\x0bOpenApiTool\x12\x1a\n\x0btext_schema\x18\x01 \x01(\tB\x03\xe0\x41\x02H\x00\x12L\n\x0e\x61uthentication\x18\x02 \x01(\x0b\x32/.google.cloud.dialogflow.v2.Tool.AuthenticationB\x03\xe0\x41\x01\x12\x43\n\ntls_config\x18\x03 \x01(\x0b\x32*.google.cloud.dialogflow.v2.Tool.TLSConfigB\x03\xe0\x41\x01\x12^\n\x18service_directory_config\x18\x04 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfigB\x03\xe0\x41\x01\x42\x08\n\x06schema\x1a\xc4\x04\n\rConnectorTool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12K\n\x07\x61\x63tions\x18\x02 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.Tool.ConnectorTool.ActionB\x03\xe0\x41\x02\x1a\xd2\x03\n\x06\x41\x63tion\x12\x1e\n\x14\x63onnection_action_id\x18\x04 \x01(\tH\x00\x12\x61\n\x10\x65ntity_operation\x18\x05 \x01(\x0b\x32\x45.google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperationH\x00\x12\x19\n\x0cinput_fields\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x1a\n\routput_fields\x18\x03 \x03(\tB\x03\xe0\x41\x01\x1a\xfe\x01\n\x0f\x45ntityOperation\x12\x16\n\tentity_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12k\n\toperation\x18\x02 \x01(\x0e\x32S.google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationTypeB\x03\xe0\x41\x02\"f\n\rOperationType\x12\x1e\n\x1aOPERATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04LIST\x10\x01\x12\x07\n\x03GET\x10\x02\x12\n\n\x06\x43REATE\x10\x03\x12\n\n\x06UPDATE\x10\x04\x12\n\n\x06\x44\x45LETE\x10\x05\x42\r\n\x0b\x61\x63tion_spec\x1a\xda\x0b\n\x0e\x41uthentication\x12V\n\x0e\x61pi_key_config\x18\x01 \x01(\x0b\x32<.google.cloud.dialogflow.v2.Tool.Authentication.ApiKeyConfigH\x00\x12S\n\x0coauth_config\x18\x02 \x01(\x0b\x32;.google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfigH\x00\x12k\n\x19service_agent_auth_config\x18\x03 \x01(\x0b\x32\x46.google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfigH\x00\x12`\n\x13\x62\x65\x61rer_token_config\x18\x04 \x01(\x0b\x32\x41.google.cloud.dialogflow.v2.Tool.Authentication.BearerTokenConfigH\x00\x1a\xf3\x01\n\x0c\x41piKeyConfig\x12\x15\n\x08key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07\x61pi_key\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12V\n\x1asecret_version_for_api_key\x18\x04 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12^\n\x10request_location\x18\x03 \x01(\x0e\x32?.google.cloud.dialogflow.v2.Tool.Authentication.RequestLocationB\x03\xe0\x41\x02\x1a\x87\x03\n\x0bOAuthConfig\x12i\n\x10oauth_grant_type\x18\x01 \x01(\x0e\x32J.google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig.OauthGrantTypeB\x03\xe0\x41\x02\x12\x16\n\tclient_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x1a\n\rclient_secret\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\\\n secret_version_for_client_secret\x18\x06 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x1b\n\x0etoken_endpoint\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x06scopes\x18\x05 \x03(\tB\x03\xe0\x41\x01\"I\n\x0eOauthGrantType\x12 \n\x1cOAUTH_GRANT_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43LIENT_CREDENTIAL\x10\x01\x1a\xea\x01\n\x16ServiceAgentAuthConfig\x12x\n\x12service_agent_auth\x18\x01 \x01(\x0e\x32W.google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuthB\x03\xe0\x41\x01\"V\n\x10ServiceAgentAuth\x12\"\n\x1eSERVICE_AGENT_AUTH_UNSPECIFIED\x10\x00\x12\x0c\n\x08ID_TOKEN\x10\x01\x12\x10\n\x0c\x41\x43\x43\x45SS_TOKEN\x10\x02\x1a}\n\x11\x42\x65\x61rerTokenConfig\x12\x12\n\x05token\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12T\n\x18secret_version_for_token\x18\x02 \x01(\tB2\xe0\x41\x01\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"Q\n\x0fRequestLocation\x12 \n\x1cREQUEST_LOCATION_UNSPECIFIED\x10\x00\x12\n\n\x06HEADER\x10\x01\x12\x10\n\x0cQUERY_STRING\x10\x02\x42\r\n\x0b\x61uth_config\x1a\x8d\x01\n\tTLSConfig\x12H\n\x08\x63\x61_certs\x18\x01 \x03(\x0b\x32\x31.google.cloud.dialogflow.v2.Tool.TLSConfig.CACertB\x03\xe0\x41\x02\x1a\x36\n\x06\x43\x41\x43\x65rt\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x63\x65rt\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x1aZ\n\x16ServiceDirectoryConfig\x12@\n\x07service\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x1a~\n\"ActionConfirmationRequirementEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12G\n\x05value\x18\x02 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirement:\x02\x38\x01\"c\n\x17\x43onfirmationRequirement\x12(\n$CONFIRMATION_REQUIREMENT_UNSPECIFIED\x10\x00\x12\x0c\n\x08REQUIRED\x10\x01\x12\x10\n\x0cNOT_REQUIRED\x10\x02\"\\\n\nMethodType\x12\x1b\n\x17METHOD_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03GET\x10\x01\x12\x08\n\x04POST\x10\x02\x12\x07\n\x03PUT\x10\x03\x12\n\n\x06\x44\x45LETE\x10\x04\x12\t\n\x05PATCH\x10\x05:f\xea\x41\x63\n\x1e\x64ialogflow.googleapis.com/Tool\x12\x34projects/{project}/locations/{location}/tools/{tool}*\x05tools2\x04toolB\x0f\n\rspecificationB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi2\xac\x07\n\x05Tools\x12\xac\x01\n\nCreateTool\x12-.google.cloud.dialogflow.v2.CreateToolRequest\x1a .google.cloud.dialogflow.v2.Tool\"M\xda\x41\x13parent,tool,tool_id\x82\xd3\xe4\x93\x02\x31\")/v2/{parent=projects/*/locations/*}/tools:\x04tool\x12\x91\x01\n\x07GetTool\x12*.google.cloud.dialogflow.v2.GetToolRequest\x1a .google.cloud.dialogflow.v2.Tool\"8\xda\x41\x04name\x82\xd3\xe4\x93\x02+\x12)/v2/{name=projects/*/locations/*/tools/*}\x12\xa4\x01\n\tListTools\x12,.google.cloud.dialogflow.v2.ListToolsRequest\x1a-.google.cloud.dialogflow.v2.ListToolsResponse\":\xda\x41\x06parent\x82\xd3\xe4\x93\x02+\x12)/v2/{parent=projects/*/locations/*}/tools\x12\x8d\x01\n\nDeleteTool\x12-.google.cloud.dialogflow.v2.DeleteToolRequest\x1a\x16.google.protobuf.Empty\"8\xda\x41\x04name\x82\xd3\xe4\x93\x02+*)/v2/{name=projects/*/locations/*/tools/*}\x12\xae\x01\n\nUpdateTool\x12-.google.cloud.dialogflow.v2.UpdateToolRequest\x1a .google.cloud.dialogflow.v2.Tool\"O\xda\x41\x10tool,update_mask\x82\xd3\xe4\x93\x02\x36\x32./v2/{tool.name=projects/*/locations/*/tools/*}:\x04tool\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xf6\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\tToolProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\x64\n*secretmanager.googleapis.com/SecretVersion\x12\x36projects/{project}/secrets/{secret}/versions/{version}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - CreateToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateToolRequest").msgclass - GetToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetToolRequest").msgclass - ListToolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListToolsRequest").msgclass - ListToolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListToolsResponse").msgclass - DeleteToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteToolRequest").msgclass - UpdateToolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateToolRequest").msgclass - Tool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool").msgclass - Tool::ExtensionTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ExtensionTool").msgclass - Tool::FunctionTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.FunctionTool").msgclass - Tool::OpenApiTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.OpenApiTool").msgclass - Tool::ConnectorTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConnectorTool").msgclass - Tool::ConnectorTool::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConnectorTool.Action").msgclass - Tool::ConnectorTool::Action::EntityOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation").msgclass - Tool::ConnectorTool::Action::EntityOperation::OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConnectorTool.Action.EntityOperation.OperationType").enummodule - Tool::Authentication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication").msgclass - Tool::Authentication::ApiKeyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.ApiKeyConfig").msgclass - Tool::Authentication::OAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig").msgclass - Tool::Authentication::OAuthConfig::OauthGrantType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.OAuthConfig.OauthGrantType").enummodule - Tool::Authentication::ServiceAgentAuthConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig").msgclass - Tool::Authentication::ServiceAgentAuthConfig::ServiceAgentAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.ServiceAgentAuthConfig.ServiceAgentAuth").enummodule - Tool::Authentication::BearerTokenConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.BearerTokenConfig").msgclass - Tool::Authentication::RequestLocation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation").enummodule - Tool::TLSConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.TLSConfig").msgclass - Tool::TLSConfig::CACert = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.TLSConfig.CACert").msgclass - Tool::ServiceDirectoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ServiceDirectoryConfig").msgclass - Tool::ConfirmationRequirement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.ConfirmationRequirement").enummodule - Tool::MethodType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Tool.MethodType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_services_pb.rb deleted file mode 100644 index 2523d3df1147..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tool_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/tool.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/tool_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Tools - # Tool Service for LLM powered Agent Assist. Tools can be used to interact with - # remote APIs (e.g. fetching orders) to retrieve additional information as - # input to LLM. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Tools' - - # Creates a tool. - rpc :CreateTool, ::Google::Cloud::Dialogflow::V2::CreateToolRequest, ::Google::Cloud::Dialogflow::V2::Tool - # Retrieves a tool. - rpc :GetTool, ::Google::Cloud::Dialogflow::V2::GetToolRequest, ::Google::Cloud::Dialogflow::V2::Tool - # Lists tools. - rpc :ListTools, ::Google::Cloud::Dialogflow::V2::ListToolsRequest, ::Google::Cloud::Dialogflow::V2::ListToolsResponse - # Deletes a tool. - rpc :DeleteTool, ::Google::Cloud::Dialogflow::V2::DeleteToolRequest, ::Google::Protobuf::Empty - # Updates a tool. - rpc :UpdateTool, ::Google::Cloud::Dialogflow::V2::UpdateToolRequest, ::Google::Cloud::Dialogflow::V2::Tool - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools.rb deleted file mode 100644 index b1b2e61ed6ab..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/tools/credentials" -require "google/cloud/dialogflow/v2/tools/paths" -require "google/cloud/dialogflow/v2/tools/client" -require "google/cloud/dialogflow/v2/tools/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Tool Service for LLM powered Agent Assist. Tools can be used to interact with - # remote APIs (e.g. fetching orders) to retrieve additional information as - # input to LLM. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/tools" - # client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/tools/rest" - # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new - # - module Tools - end - end - end - end -end - -helper_path = ::File.join __dir__, "tools", "helpers.rb" -require "google/cloud/dialogflow/v2/tools/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/client.rb deleted file mode 100644 index 24392857a1c1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/client.rb +++ /dev/null @@ -1,899 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/tool_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Tools - ## - # Client for the Tools service. - # - # Tool Service for LLM powered Agent Assist. Tools can be used to interact with - # remote APIs (e.g. fetching orders) to retrieve additional information as - # input to LLM. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tools_stub - - ## - # Configure the Tools Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Tools::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Tools clients - # ::Google::Cloud::Dialogflow::V2::Tools::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Tools 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::Dialogflow::V2::Tools::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 - @tools_stub.universe_domain - end - - ## - # Create a new Tools client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Tools 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/dialogflow/v2/tool_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 - - @tools_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Tools::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 - ) - - @tools_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 = @tools_stub.endpoint - config.universe_domain = @tools_stub.universe_domain - config.logger = @tools_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 - @tools_stub.logger - end - - # Service calls - - ## - # Creates a tool. - # - # @overload create_tool(request, options = nil) - # Pass arguments to `create_tool` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateToolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateToolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tool(parent: nil, tool: nil, tool_id: nil) - # Pass arguments to `create_tool` via keyword arguments. Note that at - # least one keyword argument is 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 project/location to create tool for. Format: - # `projects//locations/` - # @param tool [::Google::Cloud::Dialogflow::V2::Tool, ::Hash] - # Required. The tool to create. - # @param tool_id [::String] - # Optional. The ID to use for the tool, which will become the final - # component of the tool's resource name. - # - # The tool ID must be compliant with the regression formula - # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - # If the field is not provide, an Id will be auto-generated. - # If the field is provided, the caller is responsible for - # 1. the uniqueness of the ID, otherwise the request will be rejected. - # 2. the consistency for whether to use custom ID or not under a project to - # better ensure uniqueness. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Tool] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateToolRequest.new - # - # # Call the create_tool method. - # result = client.create_tool request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. - # p result - # - def create_tool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateToolRequest - - # Converts hash and nil to 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_tool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_tool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_tool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.call_rpc :create_tool, 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 - - ## - # Retrieves a tool. - # - # @overload get_tool(request, options = nil) - # Pass arguments to `get_tool` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetToolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetToolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tool(name: nil) - # Pass arguments to `get_tool` via keyword arguments. Note that at - # least one keyword argument is required. To 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 tool resource name to retrieve. Format: - # `projects//locations//tools/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Tool] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetToolRequest.new - # - # # Call the get_tool method. - # result = client.get_tool request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. - # p result - # - def get_tool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetToolRequest - - # Converts hash and nil to 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_tool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_tool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_tool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.call_rpc :get_tool, 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 tools. - # - # @overload list_tools(request, options = nil) - # Pass arguments to `list_tools` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListToolsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListToolsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tools(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tools` via keyword arguments. Note that at - # least one keyword argument is 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 project/location to list tools for. Format: - # `projects//locations/` - # @param page_size [::Integer] - # Optional. Maximum number of conversation models to return in a single page. - # Default to 10. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Tool>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Tool>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListToolsRequest.new - # - # # Call the list_tools method. - # result = client.list_tools 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::Dialogflow::V2::Tool. - # p item - # end - # - def list_tools request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListToolsRequest - - # Converts hash and nil to 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_tools.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_tools.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tools.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.call_rpc :list_tools, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @tools_stub, :list_tools, 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 tool. - # - # @overload delete_tool(request, options = nil) - # Pass arguments to `delete_tool` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteToolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteToolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tool(name: nil) - # Pass arguments to `delete_tool` via keyword arguments. Note that at - # least one keyword argument is required. To 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 tool resource name to delete. Format: - # `projects//locations//tools/` - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteToolRequest.new - # - # # Call the delete_tool method. - # result = client.delete_tool request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteToolRequest - - # Converts hash and nil to 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_tool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_tool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_tool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.call_rpc :delete_tool, 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 tool. - # - # @overload update_tool(request, options = nil) - # Pass arguments to `update_tool` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateToolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateToolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tool(tool: nil, update_mask: nil) - # Pass arguments to `update_tool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tool [::Google::Cloud::Dialogflow::V2::Tool, ::Hash] - # Required. The tool to update. - # The name field of tool is to identify the tool to - # update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The list of fields to update. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Tool] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateToolRequest.new - # - # # Call the update_tool method. - # result = client.update_tool request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. - # p result - # - def update_tool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateToolRequest - - # Converts hash and nil to 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_tool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.tool&.name - header_params["tool.name"] = request.tool.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_tool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_tool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.call_rpc :update_tool, 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 Tools API. - # - # This class represents the configuration for Tools, - # 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::Dialogflow::V2::Tools::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_tool to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Tools::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tool.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tool.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::Dialogflow::V2::Tools::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Tools 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_tool` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tool - ## - # RPC-specific configuration for `get_tool` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tool - ## - # RPC-specific configuration for `list_tools` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tools - ## - # RPC-specific configuration for `delete_tool` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tool - ## - # RPC-specific configuration for `update_tool` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tool - - # @private - def initialize parent_rpcs = nil - create_tool_config = parent_rpcs.create_tool if parent_rpcs.respond_to? :create_tool - @create_tool = ::Gapic::Config::Method.new create_tool_config - get_tool_config = parent_rpcs.get_tool if parent_rpcs.respond_to? :get_tool - @get_tool = ::Gapic::Config::Method.new get_tool_config - list_tools_config = parent_rpcs.list_tools if parent_rpcs.respond_to? :list_tools - @list_tools = ::Gapic::Config::Method.new list_tools_config - delete_tool_config = parent_rpcs.delete_tool if parent_rpcs.respond_to? :delete_tool - @delete_tool = ::Gapic::Config::Method.new delete_tool_config - update_tool_config = parent_rpcs.update_tool if parent_rpcs.respond_to? :update_tool - @update_tool = ::Gapic::Config::Method.new update_tool_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/credentials.rb deleted file mode 100644 index 6b01618f767d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Tools - # Credentials for the Tools API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/paths.rb deleted file mode 100644 index f021f5d31682..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/paths.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! - - -module Google - module Cloud - module Dialogflow - module V2 - module Tools - # Path helper methods for the Tools API. - module Paths - ## - # 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 SecretVersion resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}/versions/{version}` - # - # @param project [String] - # @param secret [String] - # @param version [String] - # - # @return [::String] - def secret_version_path project:, secret:, version: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}/versions/#{version}" - end - - ## - # Create a fully-qualified Service resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}` - # - # @param project [String] - # @param location [String] - # @param namespace [String] - # @param service [String] - # - # @return [::String] - def service_path project:, location:, namespace:, service: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "namespace cannot contain /" if namespace.to_s.include? "/" - - "projects/#{project}/locations/#{location}/namespaces/#{namespace}/services/#{service}" - end - - ## - # Create a fully-qualified Tool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/tools/{tool}` - # - # @param project [String] - # @param location [String] - # @param tool [String] - # - # @return [::String] - def tool_path project:, location:, tool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/tools/#{tool}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest.rb deleted file mode 100644 index 4356a3dfa7d4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/tools/credentials" -require "google/cloud/dialogflow/v2/tools/paths" -require "google/cloud/dialogflow/v2/tools/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Tool Service for LLM powered Agent Assist. Tools can be used to interact with - # remote APIs (e.g. fetching orders) to retrieve additional information as - # input to LLM. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/tools/rest" - # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new - # - module Tools - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/tools/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/client.rb deleted file mode 100644 index 7976c58b42f3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/client.rb +++ /dev/null @@ -1,829 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/tool_pb" -require "google/cloud/dialogflow/v2/tools/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Tools - module Rest - ## - # REST client for the Tools service. - # - # Tool Service for LLM powered Agent Assist. Tools can be used to interact with - # remote APIs (e.g. fetching orders) to retrieve additional information as - # input to LLM. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :tools_stub - - ## - # Configure the Tools Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Tools::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Tools clients - # ::Google::Cloud::Dialogflow::V2::Tools::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Tools 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::Dialogflow::V2::Tools::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 - @tools_stub.universe_domain - end - - ## - # Create a new Tools REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Tools 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 - - @tools_stub = ::Google::Cloud::Dialogflow::V2::Tools::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @tools_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 = @tools_stub.endpoint - config.universe_domain = @tools_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @tools_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 - @tools_stub.logger - end - - # Service calls - - ## - # Creates a tool. - # - # @overload create_tool(request, options = nil) - # Pass arguments to `create_tool` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateToolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateToolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tool(parent: nil, tool: nil, tool_id: nil) - # Pass arguments to `create_tool` via keyword arguments. Note that at - # least one keyword argument is 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 project/location to create tool for. Format: - # `projects//locations/` - # @param tool [::Google::Cloud::Dialogflow::V2::Tool, ::Hash] - # Required. The tool to create. - # @param tool_id [::String] - # Optional. The ID to use for the tool, which will become the final - # component of the tool's resource name. - # - # The tool ID must be compliant with the regression formula - # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - # If the field is not provide, an Id will be auto-generated. - # If the field is provided, the caller is responsible for - # 1. the uniqueness of the ID, otherwise the request will be rejected. - # 2. the consistency for whether to use custom ID or not under a project to - # better ensure uniqueness. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Tool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateToolRequest.new - # - # # Call the create_tool method. - # result = client.create_tool request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. - # p result - # - def create_tool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateToolRequest - - # Converts hash and nil to an 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_tool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_tool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_tool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.create_tool 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 - - ## - # Retrieves a tool. - # - # @overload get_tool(request, options = nil) - # Pass arguments to `get_tool` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetToolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetToolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tool(name: nil) - # Pass arguments to `get_tool` via keyword arguments. Note that at - # least one keyword argument is required. To 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 tool resource name to retrieve. Format: - # `projects//locations//tools/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Tool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetToolRequest.new - # - # # Call the get_tool method. - # result = client.get_tool request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. - # p result - # - def get_tool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetToolRequest - - # Converts hash and nil to an 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_tool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_tool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_tool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.get_tool 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 tools. - # - # @overload list_tools(request, options = nil) - # Pass arguments to `list_tools` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListToolsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListToolsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tools(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tools` via keyword arguments. Note that at - # least one keyword argument is 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 project/location to list tools for. Format: - # `projects//locations/` - # @param page_size [::Integer] - # Optional. Maximum number of conversation models to return in a single page. - # Default to 10. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Tool>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Tool>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListToolsRequest.new - # - # # Call the list_tools method. - # result = client.list_tools 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::Dialogflow::V2::Tool. - # p item - # end - # - def list_tools request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListToolsRequest - - # Converts hash and nil to an 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_tools.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_tools.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tools.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.list_tools request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @tools_stub, :list_tools, "tools", 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 tool. - # - # @overload delete_tool(request, options = nil) - # Pass arguments to `delete_tool` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteToolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteToolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tool(name: nil) - # Pass arguments to `delete_tool` via keyword arguments. Note that at - # least one keyword argument is required. To 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 tool resource name to delete. Format: - # `projects//locations//tools/` - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteToolRequest.new - # - # # Call the delete_tool method. - # result = client.delete_tool request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_tool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteToolRequest - - # Converts hash and nil to an 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_tool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_tool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_tool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.delete_tool 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 tool. - # - # @overload update_tool(request, options = nil) - # Pass arguments to `update_tool` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateToolRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateToolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_tool(tool: nil, update_mask: nil) - # Pass arguments to `update_tool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param tool [::Google::Cloud::Dialogflow::V2::Tool, ::Hash] - # Required. The tool to update. - # The name field of tool is to identify the tool to - # update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The list of fields to update. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Tool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateToolRequest.new - # - # # Call the update_tool method. - # result = client.update_tool request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. - # p result - # - def update_tool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateToolRequest - - # Converts hash and nil to an 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_tool.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_tool.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_tool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @tools_stub.update_tool 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 Tools REST API. - # - # This class represents the configuration for Tools 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::Dialogflow::V2::Tools::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_tool to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_tool.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_tool.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Tools 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_tool` - # @return [::Gapic::Config::Method] - # - attr_reader :create_tool - ## - # RPC-specific configuration for `get_tool` - # @return [::Gapic::Config::Method] - # - attr_reader :get_tool - ## - # RPC-specific configuration for `list_tools` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tools - ## - # RPC-specific configuration for `delete_tool` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_tool - ## - # RPC-specific configuration for `update_tool` - # @return [::Gapic::Config::Method] - # - attr_reader :update_tool - - # @private - def initialize parent_rpcs = nil - create_tool_config = parent_rpcs.create_tool if parent_rpcs.respond_to? :create_tool - @create_tool = ::Gapic::Config::Method.new create_tool_config - get_tool_config = parent_rpcs.get_tool if parent_rpcs.respond_to? :get_tool - @get_tool = ::Gapic::Config::Method.new get_tool_config - list_tools_config = parent_rpcs.list_tools if parent_rpcs.respond_to? :list_tools - @list_tools = ::Gapic::Config::Method.new list_tools_config - delete_tool_config = parent_rpcs.delete_tool if parent_rpcs.respond_to? :delete_tool - @delete_tool = ::Gapic::Config::Method.new delete_tool_config - update_tool_config = parent_rpcs.update_tool if parent_rpcs.respond_to? :update_tool - @update_tool = ::Gapic::Config::Method.new update_tool_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/rest/service_stub.rb deleted file mode 100644 index 78e262df8366..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/tools/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/dialogflow/v2/tool_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Tools - module Rest - ## - # REST service stub for the Tools 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_tool REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateToolRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Tool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # A result object deserialized from the server's reply - def create_tool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_tool_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_tool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Tool.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_tool REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetToolRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Tool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # A result object deserialized from the server's reply - def get_tool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_tool_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_tool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Tool.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_tools REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListToolsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListToolsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListToolsResponse] - # A result object deserialized from the server's reply - def list_tools request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tools_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_tools", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListToolsResponse.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_tool REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteToolRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_tool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_tool_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_tool", - 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_tool REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateToolRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Tool] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # A result object deserialized from the server's reply - def update_tool request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_tool_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_tool", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Tool.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_tool REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateToolRequest] - # 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_tool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/tools", - body: "tool", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_tool REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetToolRequest] - # 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_tool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/tools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tools REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListToolsRequest] - # 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_tools_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/tools", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_tool REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteToolRequest] - # 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_tool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/tools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_tool REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateToolRequest] - # 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_tool_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{tool.name}", - body: "tool", - matches: [ - ["tool.name", %r{^projects/[^/]+/locations/[^/]+/tools/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/toolset_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/toolset_pb.rb deleted file mode 100644 index c286fdc62dd2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/toolset_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/toolset.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/dialogflow/v2/tool_pb' - - -descriptor_data = "\n(google/cloud/dialogflow/v2/toolset.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/dialogflow/v2/tool.proto\"\xbe\x01\n\x0bToolsetTool\x12\x33\n\x07toolset\x18\x01 \x01(\tB\"\xe0\x41\x02\xfa\x41\x1c\n\x1a\x63\x65s.googleapis.com/Toolset\x12\x19\n\x0coperation_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12_\n\x18\x63onfirmation_requirement\x18\x03 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.Tool.ConfirmationRequirementB\x03\xe0\x41\x01\x42\xf8\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cToolsetProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41\x63\n\x1a\x63\x65s.googleapis.com/Toolset\x12\x45projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - ToolsetTool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ToolsetTool").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/validation_result_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/validation_result_pb.rb deleted file mode 100644 index 824c5890955c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/validation_result_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/validation_result.proto - -require 'google/protobuf' - - -descriptor_data = "\n2google/cloud/dialogflow/v2/validation_result.proto\x12\x1agoogle.cloud.dialogflow.v2\"\xd7\x01\n\x0fValidationError\x12\x46\n\x08severity\x18\x01 \x01(\x0e\x32\x34.google.cloud.dialogflow.v2.ValidationError.Severity\x12\x0f\n\x07\x65ntries\x18\x03 \x03(\t\x12\x15\n\rerror_message\x18\x04 \x01(\t\"T\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x08\n\x04INFO\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04\"Z\n\x10ValidationResult\x12\x46\n\x11validation_errors\x18\x01 \x03(\x0b\x32+.google.cloud.dialogflow.v2.ValidationErrorB\x9b\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x15ValidationResultProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - ValidationError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ValidationError").msgclass - ValidationError::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ValidationError.Severity").enummodule - ValidationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ValidationResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb deleted file mode 100644 index 1567f6197690..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/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 Dialogflow - module V2 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_pb.rb deleted file mode 100644 index 5e60296c0acb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/version.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/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n(google/cloud/dialogflow/v2/version.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc3\x03\n\x07Version\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1b\n\x0eversion_number\x18\x03 \x01(\x05\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x06status\x18\x06 \x01(\x0e\x32\x31.google.cloud.dialogflow.v2.Version.VersionStatusB\x03\xe0\x41\x03\"W\n\rVersionStatus\x12\x1e\n\x1aVERSION_STATUS_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\t\n\x05READY\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03:\x96\x01\xea\x41\x92\x01\n!dialogflow.googleapis.com/Version\x12+projects/{project}/agent/versions/{version}\x12@projects/{project}/locations/{location}/agent/versions/{version}\"\x81\x01\n\x13ListVersionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Version\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\"f\n\x14ListVersionsResponse\x12\x35\n\x08versions\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Version\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"L\n\x11GetVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version\"\x8c\x01\n\x14\x43reateVersionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!dialogflow.googleapis.com/Version\x12\x39\n\x07version\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.v2.VersionB\x03\xe0\x41\x02\"\x87\x01\n\x14UpdateVersionRequest\x12\x39\n\x07version\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.v2.VersionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"O\n\x14\x44\x65leteVersionRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!dialogflow.googleapis.com/Version2\xfc\t\n\x08Versions\x12\xe0\x01\n\x0cListVersions\x12/.google.cloud.dialogflow.v2.ListVersionsRequest\x1a\x30.google.cloud.dialogflow.v2.ListVersionsResponse\"m\xda\x41\x06parent\x82\xd3\xe4\x93\x02^\x12&/v2/{parent=projects/*/agent}/versionsZ4\x12\x32/v2/{parent=projects/*/locations/*/agent}/versions\x12\xcd\x01\n\nGetVersion\x12-.google.cloud.dialogflow.v2.GetVersionRequest\x1a#.google.cloud.dialogflow.v2.Version\"k\xda\x41\x04name\x82\xd3\xe4\x93\x02^\x12&/v2/{name=projects/*/agent/versions/*}Z4\x12\x32/v2/{name=projects/*/locations/*/agent/versions/*}\x12\xf0\x01\n\rCreateVersion\x12\x30.google.cloud.dialogflow.v2.CreateVersionRequest\x1a#.google.cloud.dialogflow.v2.Version\"\x87\x01\xda\x41\x0eparent,version\x82\xd3\xe4\x93\x02p\"&/v2/{parent=projects/*/agent}/versions:\x07versionZ=\"2/v2/{parent=projects/*/locations/*/agent}/versions:\x07version\x12\x86\x02\n\rUpdateVersion\x12\x30.google.cloud.dialogflow.v2.UpdateVersionRequest\x1a#.google.cloud.dialogflow.v2.Version\"\x9d\x01\xda\x41\x13version,update_mask\x82\xd3\xe4\x93\x02\x80\x01\x32./v2/{version.name=projects/*/agent/versions/*}:\x07versionZE2:/v2/{version.name=projects/*/locations/*/agent/versions/*}:\x07version\x12\xc6\x01\n\rDeleteVersion\x12\x30.google.cloud.dialogflow.v2.DeleteVersionRequest\x1a\x16.google.protobuf.Empty\"k\xda\x41\x04name\x82\xd3\xe4\x93\x02^*&/v2/{name=projects/*/agent/versions/*}Z4*2/v2/{name=projects/*/locations/*/agent/versions/*}\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\x92\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cVersionProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Version").msgclass - Version::VersionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Version.VersionStatus").enummodule - ListVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListVersionsRequest").msgclass - ListVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListVersionsResponse").msgclass - GetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetVersionRequest").msgclass - CreateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateVersionRequest").msgclass - UpdateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateVersionRequest").msgclass - DeleteVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteVersionRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_services_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_services_pb.rb deleted file mode 100644 index bc4784362d51..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version_services_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/dialogflow/v2/version.proto for package 'google.cloud.dialogflow.v2' -# 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/dialogflow/v2/version_pb' - -module Google - module Cloud - module Dialogflow - module V2 - module Versions - # Service for managing [Versions][google.cloud.dialogflow.v2.Version]. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.dialogflow.v2.Versions' - - # Returns the list of all versions of the specified agent. - rpc :ListVersions, ::Google::Cloud::Dialogflow::V2::ListVersionsRequest, ::Google::Cloud::Dialogflow::V2::ListVersionsResponse - # Retrieves the specified agent version. - rpc :GetVersion, ::Google::Cloud::Dialogflow::V2::GetVersionRequest, ::Google::Cloud::Dialogflow::V2::Version - # Creates an agent version. - # - # The new version points to the agent instance in the "default" environment. - rpc :CreateVersion, ::Google::Cloud::Dialogflow::V2::CreateVersionRequest, ::Google::Cloud::Dialogflow::V2::Version - # Updates the specified agent version. - # - # Note that this method does not allow you to update the state of the agent - # the given version points to. It allows you to update only mutable - # properties of the version resource. - rpc :UpdateVersion, ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, ::Google::Cloud::Dialogflow::V2::Version - # Delete the specified agent version. - rpc :DeleteVersion, ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, ::Google::Protobuf::Empty - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions.rb deleted file mode 100644 index 4bf615cef351..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions.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/dialogflow/v2/version" - -require "google/cloud/dialogflow/v2/versions/credentials" -require "google/cloud/dialogflow/v2/versions/paths" -require "google/cloud/dialogflow/v2/versions/client" -require "google/cloud/dialogflow/v2/versions/rest" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/dialogflow/v2/versions" - # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/dialogflow/v2/versions/rest" - # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new - # - module Versions - end - end - end - end -end - -helper_path = ::File.join __dir__, "versions", "helpers.rb" -require "google/cloud/dialogflow/v2/versions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb deleted file mode 100644 index ede3695513d9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/client.rb +++ /dev/null @@ -1,909 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/version_pb" -require "google/cloud/location" - -module Google - module Cloud - module Dialogflow - module V2 - module Versions - ## - # Client for the Versions service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :versions_stub - - ## - # Configure the Versions Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Versions::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Versions clients - # ::Google::Cloud::Dialogflow::V2::Versions::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Versions 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::Dialogflow::V2::Versions::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 - @versions_stub.universe_domain - end - - ## - # Create a new Versions client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Versions 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/dialogflow/v2/version_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 - - @versions_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Dialogflow::V2::Versions::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 - ) - - @versions_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 = @versions_stub.endpoint - config.universe_domain = @versions_stub.universe_domain - config.logger = @versions_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 - @versions_stub.logger - end - - # Service calls - - ## - # Returns the list of all versions of the specified agent. - # - # @overload list_versions(request, options = nil) - # Pass arguments to `list_versions` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_versions(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_versions` via keyword arguments. Note that at - # least one keyword argument is 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 agent to list all versions from. - # Supported formats: - # - # - `projects//agent` - # - `projects//locations//agent` - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListVersionsRequest.new - # - # # Call the list_versions method. - # result = client.list_versions 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::Dialogflow::V2::Version. - # p item - # end - # - def list_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListVersionsRequest - - # Converts hash and nil to 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_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.call_rpc :list_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @versions_stub, :list_versions, 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 - - ## - # Retrieves the specified agent version. - # - # @overload get_version(request, options = nil) - # Pass arguments to `get_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_version(name: nil) - # Pass arguments to `get_version` via keyword arguments. Note that at - # least one keyword argument is required. To 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 version. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Version] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Version] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetVersionRequest.new - # - # # Call the get_version method. - # result = client.get_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. - # p result - # - def get_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetVersionRequest - - # Converts hash and nil to 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_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.call_rpc :get_version, 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 an agent version. - # - # The new version points to the agent instance in the "default" environment. - # - # @overload create_version(request, options = nil) - # Pass arguments to `create_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_version(parent: nil, version: nil) - # Pass arguments to `create_version` via keyword arguments. Note that at - # least one keyword argument is 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 agent to create a version for. - # Supported formats: - # - # - `projects//agent` - # - `projects//locations//agent` - # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash] - # Required. The version to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Version] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Version] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateVersionRequest.new - # - # # Call the create_version method. - # result = client.create_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. - # p result - # - def create_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateVersionRequest - - # Converts hash and nil to 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_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.call_rpc :create_version, 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 the specified agent version. - # - # Note that this method does not allow you to update the state of the agent - # the given version points to. It allows you to update only mutable - # properties of the version resource. - # - # @overload update_version(request, options = nil) - # Pass arguments to `update_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_version(version: nil, update_mask: nil) - # Pass arguments to `update_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash] - # Required. The version to update. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Dialogflow::V2::Version] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Dialogflow::V2::Version] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new - # - # # Call the update_version method. - # result = client.update_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. - # p result - # - def update_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest - - # Converts hash and nil to 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_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.version&.name - header_params["version.name"] = request.version.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_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.call_rpc :update_version, 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 - - ## - # Delete the specified agent version. - # - # @overload delete_version(request, options = nil) - # Pass arguments to `delete_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_version(name: nil) - # Pass arguments to `delete_version` via keyword arguments. Note that at - # least one keyword argument is required. To 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 version to delete. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - # - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new - # - # # Call the delete_version method. - # result = client.delete_version request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest - - # Converts hash and nil to 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_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION - metadata[:"x-goog-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_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.call_rpc :delete_version, 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 Versions API. - # - # This class represents the configuration for Versions, - # 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::Dialogflow::V2::Versions::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_versions to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Versions::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_versions.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_versions.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::Dialogflow::V2::Versions::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 Versions 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_versions - ## - # RPC-specific configuration for `get_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_version - ## - # RPC-specific configuration for `create_version` - # @return [::Gapic::Config::Method] - # - attr_reader :create_version - ## - # RPC-specific configuration for `update_version` - # @return [::Gapic::Config::Method] - # - attr_reader :update_version - ## - # RPC-specific configuration for `delete_version` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_version - - # @private - def initialize parent_rpcs = nil - list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions - @list_versions = ::Gapic::Config::Method.new list_versions_config - get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version - @get_version = ::Gapic::Config::Method.new get_version_config - create_version_config = parent_rpcs.create_version if parent_rpcs.respond_to? :create_version - @create_version = ::Gapic::Config::Method.new create_version_config - update_version_config = parent_rpcs.update_version if parent_rpcs.respond_to? :update_version - @update_version = ::Gapic::Config::Method.new update_version_config - delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version - @delete_version = ::Gapic::Config::Method.new delete_version_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/credentials.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/credentials.rb deleted file mode 100644 index fbb76520093c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/credentials.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 "googleauth" - -module Google - module Cloud - module Dialogflow - module V2 - module Versions - # Credentials for the Versions API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/dialogflow" - ] - self.env_vars = [ - "DIALOGFLOW_CREDENTIALS", - "DIALOGFLOW_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "DIALOGFLOW_CREDENTIALS_JSON", - "DIALOGFLOW_KEYFILE_JSON", - "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-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/paths.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/paths.rb deleted file mode 100644 index 12e1ff30d50f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/paths.rb +++ /dev/null @@ -1,110 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - module Versions - # Path helper methods for the Versions API. - module Paths - ## - # Create a fully-qualified Agent resource string. - # - # @overload agent_path(project:) - # The resource will be in the following format: - # - # `projects/{project}/agent` - # - # @param project [String] - # - # @overload agent_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def agent_path **args - resources = { - "project" => (proc do |project:| - "projects/#{project}/agent" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent" - 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 Version resource string. - # - # @overload version_path(project:, version:) - # The resource will be in the following format: - # - # `projects/{project}/agent/versions/{version}` - # - # @param project [String] - # @param version [String] - # - # @overload version_path(project:, location:, version:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/agent/versions/{version}` - # - # @param project [String] - # @param location [String] - # @param version [String] - # - # @return [::String] - def version_path **args - resources = { - "project:version" => (proc do |project:, version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/agent/versions/#{version}" - end), - "location:project:version" => (proc do |project:, location:, version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/agent/versions/#{version}" - 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-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest.rb deleted file mode 100644 index 818e626fa76b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/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/dialogflow/v2/version" -require "google/cloud/dialogflow/v2/bindings_override" - -require "google/cloud/dialogflow/v2/versions/credentials" -require "google/cloud/dialogflow/v2/versions/paths" -require "google/cloud/dialogflow/v2/versions/rest/client" - -module Google - module Cloud - module Dialogflow - module V2 - ## - # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/dialogflow/v2/versions/rest" - # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new - # - module Versions - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/dialogflow/v2/versions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb deleted file mode 100644 index c75bf3b1900b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +++ /dev/null @@ -1,839 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/version_pb" -require "google/cloud/dialogflow/v2/versions/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Dialogflow - module V2 - module Versions - module Rest - ## - # REST client for the Versions service. - # - # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :versions_stub - - ## - # Configure the Versions Client class. - # - # See {::Google::Cloud::Dialogflow::V2::Versions::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Versions clients - # ::Google::Cloud::Dialogflow::V2::Versions::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", "Dialogflow", "V2"] - 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 = 60.0 - default_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Versions 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::Dialogflow::V2::Versions::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 - @versions_stub.universe_domain - end - - ## - # Create a new Versions REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Versions 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 - - @versions_stub = ::Google::Cloud::Dialogflow::V2::Versions::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @versions_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 = @versions_stub.endpoint - config.universe_domain = @versions_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @versions_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 - @versions_stub.logger - end - - # Service calls - - ## - # Returns the list of all versions of the specified agent. - # - # @overload list_versions(request, options = nil) - # Pass arguments to `list_versions` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::ListVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::ListVersionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_versions(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_versions` via keyword arguments. Note that at - # least one keyword argument is 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 agent to list all versions from. - # Supported formats: - # - # - `projects//agent` - # - `projects//locations//agent` - # @param page_size [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @param page_token [::String] - # Optional. The next_page_token value returned from a previous list request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::ListVersionsRequest.new - # - # # Call the list_versions method. - # result = client.list_versions 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::Dialogflow::V2::Version. - # p item - # end - # - def list_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListVersionsRequest - - # Converts hash and nil to an 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_versions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_versions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.list_versions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @versions_stub, :list_versions, "versions", 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 - - ## - # Retrieves the specified agent version. - # - # @overload get_version(request, options = nil) - # Pass arguments to `get_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::GetVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::GetVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_version(name: nil) - # Pass arguments to `get_version` via keyword arguments. Note that at - # least one keyword argument is required. To 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 version. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Version] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::GetVersionRequest.new - # - # # Call the get_version method. - # result = client.get_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. - # p result - # - def get_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetVersionRequest - - # Converts hash and nil to an 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_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.get_version 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 an agent version. - # - # The new version points to the agent instance in the "default" environment. - # - # @overload create_version(request, options = nil) - # Pass arguments to `create_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::CreateVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::CreateVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_version(parent: nil, version: nil) - # Pass arguments to `create_version` via keyword arguments. Note that at - # least one keyword argument is 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 agent to create a version for. - # Supported formats: - # - # - `projects//agent` - # - `projects//locations//agent` - # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash] - # Required. The version to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Version] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::CreateVersionRequest.new - # - # # Call the create_version method. - # result = client.create_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. - # p result - # - def create_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateVersionRequest - - # Converts hash and nil to an 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_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.create_version 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 the specified agent version. - # - # Note that this method does not allow you to update the state of the agent - # the given version points to. It allows you to update only mutable - # properties of the version resource. - # - # @overload update_version(request, options = nil) - # Pass arguments to `update_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::UpdateVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_version(version: nil, update_mask: nil) - # Pass arguments to `update_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash] - # Required. The version to update. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to control which fields get updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Dialogflow::V2::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Version] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new - # - # # Call the update_version method. - # result = client.update_version request - # - # # The returned object is of type Google::Cloud::Dialogflow::V2::Version. - # p result - # - def update_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest - - # Converts hash and nil to an 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_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.update_version 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 - - ## - # Delete the specified agent version. - # - # @overload delete_version(request, options = nil) - # Pass arguments to `delete_version` via a request object, either of type - # {::Google::Cloud::Dialogflow::V2::DeleteVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_version(name: nil) - # Pass arguments to `delete_version` via keyword arguments. Note that at - # least one keyword argument is required. To 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 version to delete. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - # @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/dialogflow/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new - # - # # Call the delete_version method. - # result = client.delete_version request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest - - # Converts hash and nil to an 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_version.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_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_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @versions_stub.delete_version 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 Versions REST API. - # - # This class represents the configuration for Versions 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::Dialogflow::V2::Versions::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_versions to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_versions.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_versions.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "dialogflow.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, 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 Versions 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_versions - ## - # RPC-specific configuration for `get_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_version - ## - # RPC-specific configuration for `create_version` - # @return [::Gapic::Config::Method] - # - attr_reader :create_version - ## - # RPC-specific configuration for `update_version` - # @return [::Gapic::Config::Method] - # - attr_reader :update_version - ## - # RPC-specific configuration for `delete_version` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_version - - # @private - def initialize parent_rpcs = nil - list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions - @list_versions = ::Gapic::Config::Method.new list_versions_config - get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version - @get_version = ::Gapic::Config::Method.new get_version_config - create_version_config = parent_rpcs.create_version if parent_rpcs.respond_to? :create_version - @create_version = ::Gapic::Config::Method.new create_version_config - update_version_config = parent_rpcs.update_version if parent_rpcs.respond_to? :update_version - @update_version = ::Gapic::Config::Method.new update_version_config - delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version - @delete_version = ::Gapic::Config::Method.new delete_version_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb deleted file mode 100644 index ded9b924bc8c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/versions/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/dialogflow/v2/version_pb" - -module Google - module Cloud - module Dialogflow - module V2 - module Versions - module Rest - ## - # REST service stub for the Versions 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_versions REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListVersionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::ListVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::ListVersionsResponse] - # A result object deserialized from the server's reply - def list_versions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_versions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_versions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::ListVersionsResponse.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_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Version] - # A result object deserialized from the server's reply - def get_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Version.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_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Version] - # A result object deserialized from the server's reply - def create_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Version.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_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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::Dialogflow::V2::Version] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Dialogflow::V2::Version] - # A result object deserialized from the server's reply - def update_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Dialogflow::V2::Version.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_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteVersionRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default 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_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_version_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_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_version", - 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_versions REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::ListVersionsRequest] - # 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_versions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::GetVersionRequest] - # 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_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::CreateVersionRequest] - # 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_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/versions", - body: "version", - matches: [ - ["parent", %r{^projects/[^/]+/agent/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}/versions", - body: "version", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/agent/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::UpdateVersionRequest] - # 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_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{version.name}", - body: "version", - matches: [ - ["version.name", %r{^projects/[^/]+/agent/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{version.name}", - body: "version", - matches: [ - ["version.name", %r{^projects/[^/]+/locations/[^/]+/agent/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_version REST call - # - # @param request_pb [::Google::Cloud::Dialogflow::V2::DeleteVersionRequest] - # 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_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/agent/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/agent/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/webhook_pb.rb b/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/webhook_pb.rb deleted file mode 100644 index b8f8c8e35938..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/webhook_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/dialogflow/v2/webhook.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/dialogflow/v2/context_pb' -require 'google/cloud/dialogflow/v2/intent_pb' -require 'google/cloud/dialogflow/v2/session_pb' -require 'google/cloud/dialogflow/v2/session_entity_type_pb' -require 'google/protobuf/struct_pb' - - -descriptor_data = "\n(google/cloud/dialogflow/v2/webhook.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x19google/api/resource.proto\x1a(google/cloud/dialogflow/v2/context.proto\x1a\'google/cloud/dialogflow/v2/intent.proto\x1a(google/cloud/dialogflow/v2/session.proto\x1a\x34google/cloud/dialogflow/v2/session_entity_type.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xd6\x01\n\x0eWebhookRequest\x12\x0f\n\x07session\x18\x04 \x01(\t\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12=\n\x0cquery_result\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResult\x12_\n\x1eoriginal_detect_intent_request\x18\x03 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.OriginalDetectIntentRequest\"\x80\x03\n\x0fWebhookResponse\x12\x18\n\x10\x66ulfillment_text\x18\x01 \x01(\t\x12H\n\x14\x66ulfillment_messages\x18\x02 \x03(\x0b\x32*.google.cloud.dialogflow.v2.Intent.Message\x12\x0e\n\x06source\x18\x03 \x01(\t\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12<\n\x0foutput_contexts\x18\x05 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x44\n\x14\x66ollowup_event_input\x18\x06 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInput\x12K\n\x14session_entity_types\x18\n \x03(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\"h\n\x1bOriginalDetectIntentRequest\x12\x0e\n\x06source\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12(\n\x07payload\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x91\x02\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cWebhookProtoP\x01Z>cloud.google.com/go/dialogflow/apiv2/dialogflowpb;dialogflowpb\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Dialogflow - module V2 - WebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.WebhookRequest").msgclass - WebhookResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.WebhookResponse").msgclass - OriginalDetectIntentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OriginalDetectIntentRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/README.md deleted file mode 100644 index fa2293e709ea..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Dialogflow V2 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-dialogflow-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent.rb deleted file mode 100644 index fdc6b6706f55..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent.rb +++ /dev/null @@ -1,338 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # A Dialogflow agent is a virtual agent that handles conversations with your - # end-users. It is a natural language understanding module that understands the - # nuances of human language. Dialogflow translates end-user text or audio - # during a conversation to structured data that your apps and services can - # understand. You design and build a Dialogflow agent to handle the types of - # conversations required for your system. - # - # For more information about agents, see the - # [Agent guide](https://cloud.google.com/dialogflow/docs/agents-overview). - # @!attribute [rw] parent - # @return [::String] - # Required. The project of this agent. - # Format: `projects/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The name of this agent. - # @!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. This field cannot be - # set by the `Update` method. - # @!attribute [rw] supported_language_codes - # @return [::Array<::String>] - # Optional. The list of all languages supported by this agent (except for the - # `default_language_code`). - # @!attribute [rw] time_zone - # @return [::String] - # Required. The time zone of this agent from the - # [time zone database](https://www.iana.org/time-zones), e.g., - # America/New_York, Europe/Paris. - # @!attribute [rw] description - # @return [::String] - # Optional. The description of this agent. - # The maximum length is 500 characters. If exceeded, the request is rejected. - # @!attribute [rw] avatar_uri - # @return [::String] - # Optional. The URI of the agent's avatar. - # Avatars are used throughout the Dialogflow console and in the self-hosted - # [Web - # Demo](https://cloud.google.com/dialogflow/docs/integrations/web-demo) - # integration. - # @!attribute [rw] enable_logging - # @return [::Boolean] - # Optional. Determines whether this agent should log conversation queries. - # @!attribute [rw] match_mode - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Dialogflow::V2::Agent::MatchMode] - # Optional. Determines how intents are detected from user queries. - # @!attribute [rw] classification_threshold - # @return [::Float] - # Optional. To filter out false positive results and still get variety in - # matched natural language inputs for your agent, you can tune the machine - # learning classification threshold. If the returned score value is less than - # the threshold value, then a fallback intent will be triggered or, if there - # are no fallback intents defined, no intent will be triggered. The score - # values range from 0.0 (completely uncertain) to 1.0 (completely certain). - # If set to 0.0, the default of 0.3 is used. - # @!attribute [rw] api_version - # @return [::Google::Cloud::Dialogflow::V2::Agent::ApiVersion] - # Optional. API version displayed in Dialogflow console. If not specified, - # V2 API is assumed. Clients are free to query different service endpoints - # for different API versions. However, bots connectors and webhook calls will - # follow the specified API version. - # @!attribute [rw] tier - # @return [::Google::Cloud::Dialogflow::V2::Agent::Tier] - # Optional. The agent tier. If not specified, TIER_STANDARD is assumed. - class Agent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Match mode determines how intents are detected from user queries. - module MatchMode - # Not specified. - MATCH_MODE_UNSPECIFIED = 0 - - # Best for agents with a small number of examples in intents and/or wide - # use of templates syntax and composite entities. - MATCH_MODE_HYBRID = 1 - - # Can be used for agents with a large number of examples in intents, - # especially the ones using @sys.any or very large custom entities. - MATCH_MODE_ML_ONLY = 2 - end - - # API version for the agent. - module ApiVersion - # Not specified. - API_VERSION_UNSPECIFIED = 0 - - # Legacy V1 API. - API_VERSION_V1 = 1 - - # V2 API. - API_VERSION_V2 = 2 - - # V2beta1 API. - API_VERSION_V2_BETA_1 = 3 - end - - # Represents the agent tier. - module Tier - # Not specified. This value should never be used. - TIER_UNSPECIFIED = 0 - - # Trial Edition, previously known as Standard Edition. - TIER_STANDARD = 1 - - # Essentials Edition, previously known as Enterprise Essential Edition. - TIER_ENTERPRISE = 2 - - # Essentials Edition (same as TIER_ENTERPRISE), previously known as - # Enterprise Plus Edition. - TIER_ENTERPRISE_PLUS = 3 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#get_agent Agents.GetAgent}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project that the agent to fetch is associated with. - # Format: `projects/`. - class GetAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#set_agent Agents.SetAgent}. - # @!attribute [rw] agent - # @return [::Google::Cloud::Dialogflow::V2::Agent] - # Required. The agent to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields get updated. - class SetAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#delete_agent Agents.DeleteAgent}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project that the agent to delete is associated with. - # Format: `projects/`. - class DeleteAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#search_agents Agents.SearchAgents}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project to list agents from. - # Format: `projects/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous list request. - class SearchAgentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#search_agents Agents.SearchAgents}. - # @!attribute [rw] agents - # @return [::Array<::Google::Cloud::Dialogflow::V2::Agent>] - # The list of agents. There will be a maximum number of items returned based - # on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class SearchAgentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent Agents.TrainAgent}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project that the agent to train is associated with. - # Format: `projects/`. - class TrainAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#export_agent Agents.ExportAgent}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project that the agent to export is associated with. - # Format: `projects/`. - # @!attribute [rw] agent_uri - # @return [::String] - # Required. The [Google Cloud - # Storage](https://cloud.google.com/storage/docs/) URI to export the agent - # to. The format of this URI must be `gs:///`. If - # left unspecified, the serialized agent is returned inline. - # - # Dialogflow performs a write operation for the Cloud Storage object - # on the caller's behalf, so your request authentication must - # have write permissions for the object. For more information, see - # [Dialogflow access - # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). - class ExportAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#export_agent Agents.ExportAgent}. - # @!attribute [rw] agent_uri - # @return [::String] - # The URI to a file containing the exported agent. This field is populated - # only if `agent_uri` is specified in `ExportAgentRequest`. - # - # Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] agent_content - # @return [::String] - # Zip compressed raw byte content for agent. - # - # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ExportAgentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#import_agent Agents.ImportAgent}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project that the agent to import is associated with. - # Format: `projects/`. - # @!attribute [rw] agent_uri - # @return [::String] - # The URI to a Google Cloud Storage file containing the agent to import. - # Note: The URI must start with "gs://". - # - # Dialogflow performs a read operation for the Cloud Storage object - # on the caller's behalf, so your request authentication must - # have read permissions for the object. For more information, see - # [Dialogflow access - # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). - # - # Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] agent_content - # @return [::String] - # Zip compressed raw byte content for agent. - # - # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ImportAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#restore_agent Agents.RestoreAgent}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project that the agent to restore is associated with. - # Format: `projects/`. - # @!attribute [rw] agent_uri - # @return [::String] - # The URI to a Google Cloud Storage file containing the agent to restore. - # Note: The URI must start with "gs://". - # - # Dialogflow performs a read operation for the Cloud Storage object - # on the caller's behalf, so your request authentication must - # have read permissions for the object. For more information, see - # [Dialogflow access - # control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage). - # - # Note: The following fields are mutually exclusive: `agent_uri`, `agent_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] agent_content - # @return [::String] - # Zip compressed raw byte content for agent. - # - # Note: The following fields are mutually exclusive: `agent_content`, `agent_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class RestoreAgentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Agents::Client#get_validation_result Agents.GetValidationResult}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project that the agent is associated with. - # Format: `projects/`. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language for which you want a validation result. If not - # specified, the agent's default language is used. [Many - # languages](https://cloud.google.com/dialogflow/docs/reference/language) - # are supported. Note: languages must be enabled in the agent before they can - # be used. - class GetValidationResultRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent_coaching_instruction.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent_coaching_instruction.rb deleted file mode 100644 index 1700c7870d25..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/agent_coaching_instruction.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! - - -module Google - module Cloud - module Dialogflow - module V2 - # Agent Coaching instructions that customer can configure. - # @!attribute [rw] display_name - # @return [::String] - # Optional. Display name for the instruction. - # @!attribute [rw] display_details - # @return [::String] - # Optional. The detailed description of this instruction. - # @!attribute [rw] condition - # @return [::String] - # Optional. The condition of the instruction. For example, "the customer - # wants to cancel an order". If the users want the instruction to be - # triggered unconditionally, the condition can be empty. - # @!attribute [rw] agent_action - # @return [::String] - # Optional. The action that human agent should take. For example, "apologize - # for the slow shipping". If the users only want to use agent coaching for - # intent detection, agent_action can be empty - # @!attribute [rw] system_action - # @return [::String] - # Optional. The action that system should take. For example, - # "call GetOrderTime with order_number={order number provided by the - # customer}". If the users don't have plugins or don't want to trigger - # plugins, the system_action can be empty - # @!attribute [r] duplicate_check_result - # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction::DuplicateCheckResult] - # Output only. Duplication check for the AgentCoachingInstruction. - # @!attribute [rw] triggering_event - # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction::TriggerEvent] - # Optional. The event that should trigger this instruction. - # If UNSPECIFIED, the instruction triggering will be same as the generator's - # trigger_event. - class AgentCoachingInstruction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Duplication check for the suggestion. - # @!attribute [r] duplicate_suggestions - # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction::DuplicateCheckResult::DuplicateSuggestion>] - # Output only. The duplicate suggestions. - class DuplicateCheckResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The duplicate suggestion details. - # @!attribute [r] answer_record - # @return [::String] - # Output only. The answer record id of the past duplicate suggestion. - # @!attribute [r] suggestion_index - # @return [::Integer] - # Output only. The index of the duplicate suggestion in the past - # suggestion list. - # @!attribute [r] similarity_score - # @return [::Float] - # Output only. The similarity score of between the past and current - # suggestion. - class DuplicateSuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The event that should trigger this instruction. - module TriggerEvent - # Default value for TriggerEvent. - TRIGGER_EVENT_UNSPECIFIED = 0 - - # Triggers when each chat message or voice utterance ends. - END_OF_UTTERANCE = 1 - - # Triggers on the conversation manually by API calls. - MANUAL_CALL = 2 - - # Triggers after each customer message. - CUSTOMER_MESSAGE = 3 - - # Triggers after each agent message. - AGENT_MESSAGE = 4 - - # Triggers on tool call completion. - TOOL_CALL_COMPLETION = 5 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/answer_record.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/answer_record.rb deleted file mode 100644 index 0cad197bb7eb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +++ /dev/null @@ -1,360 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Answer records are records to manage answer history and feedbacks for - # Dialogflow. - # - # Currently, answer record includes: - # - # - human agent assistant article suggestion - # - human agent assistant faq article - # - # It doesn't include: - # - # - `DetectIntent` intent matching - # - `DetectIntent` knowledge - # - # Answer records are not related to the conversation history in the - # Dialogflow Console. A Record is generated even when the end-user disables - # conversation history in the console. Records are created when there's a human - # agent assistant suggestion generated. - # - # A typical workflow for customers provide feedback to an answer is: - # - # 1. For human agent assistant, customers get suggestion via ListSuggestions - # API. Together with the answers, - # {::Google::Cloud::Dialogflow::V2::AnswerRecord#name AnswerRecord.name} are - # returned to the customers. - # 2. The customer uses the - # {::Google::Cloud::Dialogflow::V2::AnswerRecord#name AnswerRecord.name} to call the - # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record AnswerRecords.UpdateAnswerRecord} - # method to send feedback about a specific answer that they believe is - # wrong. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of this answer record. - # Format: `projects//locations//answerRecords/`. - # @!attribute [rw] answer_feedback - # @return [::Google::Cloud::Dialogflow::V2::AnswerFeedback] - # Required. The AnswerFeedback for this record. You can set this with - # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record AnswerRecords.UpdateAnswerRecord} - # in order to give us feedback about this answer. - # @!attribute [r] agent_assistant_record - # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantRecord] - # Output only. The record for human agent assistant. - class AnswerRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records AnswerRecords.ListAnswerRecords}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project to list all answer records for in reverse - # chronological order. Format: `projects//locations/`. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filters to restrict results to specific answer records. The - # expression has the following syntax: - # - # [AND ] ... - # - # The following fields and operators are supported: - # * conversation_id with equals(=) operator - # - # Examples: - # - # * `conversation_id=bar` matches answer records in the - # `projects/foo/locations/global/conversations/bar` conversation - # (assuming the parent is `projects/foo/locations/global`). - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of records to return in a single page. - # The server may return fewer records than this. If unspecified, we use 10. - # The maximum is 100. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The - # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse#next_page_token ListAnswerRecordsResponse.next_page_token} - # value returned from a previous list request used to continue listing on - # the next page. - class ListAnswerRecordsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records AnswerRecords.ListAnswerRecords}. - # @!attribute [rw] answer_records - # @return [::Array<::Google::Cloud::Dialogflow::V2::AnswerRecord>] - # The list of answer records. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. Or empty if there are no more - # results. - # Pass this value in the - # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest#page_token ListAnswerRecordsRequest.page_token} - # field in the subsequent call to `ListAnswerRecords` method to retrieve the - # next page of results. - class ListAnswerRecordsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record AnswerRecords.UpdateAnswerRecord}. - # @!attribute [rw] answer_record - # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord] - # Required. Answer record to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to control which fields get updated. - class UpdateAnswerRecordRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents feedback the customer has about the quality & correctness of a - # certain answer in a conversation. - # @!attribute [rw] correctness_level - # @return [::Google::Cloud::Dialogflow::V2::AnswerFeedback::CorrectnessLevel] - # The correctness level of the specific answer. - # @!attribute [rw] agent_assistant_detail_feedback - # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback] - # Detail feedback of agent assist suggestions. - # @!attribute [rw] clicked - # @return [::Boolean] - # Indicates whether the answer/item was clicked by the human agent - # or not. Default to false. - # For knowledge search and knowledge assist, the answer record is considered - # to be clicked if the answer was copied or any URI was clicked. - # @!attribute [rw] click_time - # @return [::Google::Protobuf::Timestamp] - # Time when the answer/item was clicked. - # @!attribute [rw] displayed - # @return [::Boolean] - # Indicates whether the answer/item was displayed to the human - # agent in the agent desktop UI. Default to false. - # @!attribute [rw] display_time - # @return [::Google::Protobuf::Timestamp] - # Time when the answer/item was displayed. - class AnswerFeedback - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The correctness level of an answer. - module CorrectnessLevel - # Correctness level unspecified. - CORRECTNESS_LEVEL_UNSPECIFIED = 0 - - # Answer is totally wrong. - NOT_CORRECT = 1 - - # Answer is partially correct. - PARTIALLY_CORRECT = 2 - - # Answer is fully correct. - FULLY_CORRECT = 3 - end - end - - # Detail feedback of Agent Assist result. - # @!attribute [rw] answer_relevance - # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::AnswerRelevance] - # Optional. Whether or not the suggested answer is relevant. - # - # For example: - # - # * Query: "Can I change my mailing address?" - # * Suggested document says: "Items must be returned/exchanged within 60 - # days of the purchase date." - # * {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback#answer_relevance answer_relevance}: {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::AnswerRelevance::IRRELEVANT AnswerRelevance.IRRELEVANT} - # @!attribute [rw] document_correctness - # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentCorrectness] - # Optional. Whether or not the information in the document is correct. - # - # For example: - # - # * Query: "Can I return the package in 2 days once received?" - # * Suggested document says: "Items must be returned/exchanged within 60 - # days of the purchase date." - # * Ground truth: "No return or exchange is allowed." - # * {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback#document_correctness document_correctness}: {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentCorrectness::INCORRECT INCORRECT} - # @!attribute [rw] document_efficiency - # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentEfficiency] - # Optional. Whether or not the suggested document is efficient. For example, - # if the document is poorly written, hard to understand, hard to use or - # too long to find useful information, - # {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback#document_efficiency document_efficiency} - # is - # {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentEfficiency::INEFFICIENT DocumentEfficiency.INEFFICIENT}. - # @!attribute [rw] summarization_feedback - # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::SummarizationFeedback] - # Optional. Feedback for conversation summarization. - # @!attribute [rw] knowledge_search_feedback - # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::KnowledgeSearchFeedback] - # Optional. Feedback for knowledge search. - # @!attribute [rw] knowledge_assist_feedback - # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::KnowledgeAssistFeedback] - # Optional. Feedback for knowledge assist. - class AgentAssistantFeedback - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Feedback for conversation summarization. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when composing of the summary starts. - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when the summary was submitted. - # @!attribute [rw] summary_text - # @return [::String] - # Text of actual submitted summary. - # @!attribute [rw] text_sections - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Actual text sections of submitted summary. - class SummarizationFeedback - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TextSectionsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Feedback for knowledge search. - # @!attribute [rw] answer_copied - # @return [::Boolean] - # Whether the answer was copied by the human agent or not. - # If the value is set to be true, - # {::Google::Cloud::Dialogflow::V2::AnswerFeedback#clicked AnswerFeedback.clicked} - # will be updated to be true. - # @!attribute [rw] clicked_uris - # @return [::Array<::String>] - # The URIs clicked by the human agent. The value is appended for each - # {::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest UpdateAnswerRecordRequest}. - # If the value is not empty, - # {::Google::Cloud::Dialogflow::V2::AnswerFeedback#clicked AnswerFeedback.clicked} - # will be updated to be true. - class KnowledgeSearchFeedback - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Feedback for knowledge assist. - # @!attribute [rw] answer_copied - # @return [::Boolean] - # Whether the suggested answer was copied by the human agent. - # If the value is set to be true, - # {::Google::Cloud::Dialogflow::V2::AnswerFeedback#clicked AnswerFeedback.clicked} - # will be updated to be true. - # @!attribute [rw] clicked_uris - # @return [::Array<::String>] - # The URIs clicked by the human agent. The value is appended for each - # UpdateAnswerRecordRequest. - # If the value is not empty, - # {::Google::Cloud::Dialogflow::V2::AnswerFeedback#clicked AnswerFeedback.clicked} - # will be updated to be true. - class KnowledgeAssistFeedback - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Relevance of an answer. - module AnswerRelevance - # Answer relevance unspecified. - ANSWER_RELEVANCE_UNSPECIFIED = 0 - - # Answer is irrelevant to query. - IRRELEVANT = 1 - - # Answer is relevant to query. - RELEVANT = 2 - end - - # Correctness of document. - module DocumentCorrectness - # Document correctness unspecified. - DOCUMENT_CORRECTNESS_UNSPECIFIED = 0 - - # Information in document is incorrect. - INCORRECT = 1 - - # Information in document is correct. - CORRECT = 2 - end - - # Efficiency of document. - module DocumentEfficiency - # Document efficiency unspecified. - DOCUMENT_EFFICIENCY_UNSPECIFIED = 0 - - # Document is inefficient. - INEFFICIENT = 1 - - # Document is efficient. - EFFICIENT = 2 - end - end - - # Represents a record of a human agent assist answer. - # @!attribute [r] article_suggestion_answer - # @return [::Google::Cloud::Dialogflow::V2::ArticleAnswer] - # Output only. The article suggestion answer. - # - # Note: The following fields are mutually exclusive: `article_suggestion_answer`, `faq_answer`, `dialogflow_assist_answer`, `generator_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] faq_answer - # @return [::Google::Cloud::Dialogflow::V2::FaqAnswer] - # Output only. The FAQ answer. - # - # Note: The following fields are mutually exclusive: `faq_answer`, `article_suggestion_answer`, `dialogflow_assist_answer`, `generator_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] dialogflow_assist_answer - # @return [::Google::Cloud::Dialogflow::V2::DialogflowAssistAnswer] - # Output only. Dialogflow assist answer. - # - # Note: The following fields are mutually exclusive: `dialogflow_assist_answer`, `article_suggestion_answer`, `faq_answer`, `generator_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] generator_suggestion - # @return [::Google::Cloud::Dialogflow::V2::GeneratorSuggestion] - # Output only. The generator suggestion. - # - # Note: The following fields are mutually exclusive: `generator_suggestion`, `article_suggestion_answer`, `faq_answer`, `dialogflow_assist_answer`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AgentAssistantRecord - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb deleted file mode 100644 index 8c2ab31aa3a2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +++ /dev/null @@ -1,573 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Hints for the speech recognizer to help with recognition in a specific - # conversation state. - # @!attribute [rw] phrases - # @return [::Array<::String>] - # Optional. A list of strings containing words and phrases that the speech - # recognizer should recognize with higher likelihood. - # - # This list can be used to: - # - # * improve accuracy for words and phrases you expect the user to say, - # e.g. typical commands for your Dialogflow agent - # * add additional words to the speech recognizer vocabulary - # * ... - # - # See the [Cloud Speech - # documentation](https://cloud.google.com/speech-to-text/quotas) for usage - # limits. - # @!attribute [rw] boost - # @return [::Float] - # Optional. Boost for this context compared to other contexts: - # - # * If the boost is positive, Dialogflow will increase the probability that - # the phrases in this context are recognized over similar sounding phrases. - # * If the boost is unspecified or non-positive, Dialogflow will not apply - # any boost. - # - # Dialogflow recommends that you use boosts in the range (0, 20] and that you - # find a value that fits your use case with binary search. - class SpeechContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information for a word recognized by the speech recognizer. - # @!attribute [rw] word - # @return [::String] - # The word this info is for. - # @!attribute [rw] start_offset - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio that corresponds to the - # start of the spoken word. This is an experimental feature and the accuracy - # of the time offset can vary. - # @!attribute [rw] end_offset - # @return [::Google::Protobuf::Duration] - # Time offset relative to the beginning of the audio that corresponds to the - # end of the spoken word. This is an experimental feature and the accuracy of - # the time offset can vary. - # @!attribute [rw] confidence - # @return [::Float] - # The Speech confidence between 0.0 and 1.0 for this word. A higher number - # indicates an estimated greater likelihood that the recognized word is - # correct. The default of 0.0 is a sentinel value indicating that confidence - # was not set. - # - # This field is not guaranteed to be fully stable over time for the same - # audio input. Users should also not rely on it to always be provided. - class SpeechWordInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Instructs the speech recognizer how to process the audio content. - # @!attribute [rw] audio_encoding - # @return [::Google::Cloud::Dialogflow::V2::AudioEncoding] - # Required. Audio encoding of the audio content to process. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Required. Sample rate (in Hertz) of the audio content sent in the query. - # Refer to [Cloud Speech API - # documentation](https://cloud.google.com/speech-to-text/docs/basics) for - # more details. - # @!attribute [rw] language_code - # @return [::String] - # Required. The language of the supplied audio. Dialogflow does not do - # translations. See [Language - # Support](https://cloud.google.com/dialogflow/docs/reference/language) - # for a list of the currently supported language codes. Note that queries in - # the same session do not necessarily need to specify the same language. - # If not set, the language is inferred from the - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#stt_config ConversationProfile.stt_config}. - # @!attribute [rw] enable_word_info - # @return [::Boolean] - # If `true`, Dialogflow returns - # {::Google::Cloud::Dialogflow::V2::SpeechWordInfo SpeechWordInfo} in - # {::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult StreamingRecognitionResult} - # with information about the recognized speech words, e.g. start and end time - # offsets. If false or unspecified, Speech doesn't return any word-level - # information. - # @!attribute [rw] phrase_hints - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # A list of strings containing words and phrases that the speech - # recognizer should recognize with higher likelihood. - # - # See [the Cloud Speech - # documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) - # for more details. - # - # This field is deprecated. Please use [`speech_contexts`]() instead. If you - # specify both [`phrase_hints`]() and [`speech_contexts`](), Dialogflow will - # treat the [`phrase_hints`]() as a single additional [`SpeechContext`](). - # @!attribute [rw] speech_contexts - # @return [::Array<::Google::Cloud::Dialogflow::V2::SpeechContext>] - # Context information to assist speech recognition. - # - # See [the Cloud Speech - # documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) - # for more details. - # @!attribute [rw] model - # @return [::String] - # Optional. Which Speech model to select for the given request. - # For more information, see - # [Speech models](https://cloud.google.com/dialogflow/es/docs/speech-models). - # @!attribute [rw] model_variant - # @return [::Google::Cloud::Dialogflow::V2::SpeechModelVariant] - # Which variant of the [Speech - # model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. - # @!attribute [rw] single_utterance - # @return [::Boolean] - # If `false` (default), recognition does not cease until the - # client closes the stream. - # If `true`, the recognizer will detect a single spoken utterance in input - # audio. Recognition ceases when it detects the audio's voice has - # stopped or paused. In this case, once a detected intent is received, the - # client should close the stream and start a new request with a new stream as - # needed. - # Note: This setting is relevant only for streaming methods. - # Note: When specified, InputAudioConfig.single_utterance takes precedence - # over StreamingDetectIntentRequest.single_utterance. - # @!attribute [rw] disable_no_speech_recognized_event - # @return [::Boolean] - # Only used in - # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} - # and - # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent}. - # If `false` and recognition doesn't return any result, trigger - # `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. - # @!attribute [rw] enable_automatic_punctuation - # @return [::Boolean] - # Enable automatic punctuation option at the speech backend. - # @!attribute [rw] phrase_sets - # @return [::Array<::String>] - # A collection of phrase set resources to use for speech adaptation. - # @!attribute [rw] opt_out_conformer_model_migration - # @return [::Boolean] - # If `true`, the request will opt out for STT conformer model migration. - # This field will be deprecated once force migration takes place in June - # 2024. Please refer to [Dialogflow ES Speech model - # migration](https://cloud.google.com/dialogflow/es/docs/speech-model-migration). - class InputAudioConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Description of which voice to use for speech synthesis. - # @!attribute [rw] name - # @return [::String] - # Optional. The name of the voice. If not set, the service will choose a - # voice based on the other parameters such as language_code and - # {::Google::Cloud::Dialogflow::V2::VoiceSelectionParams#ssml_gender ssml_gender}. - # @!attribute [rw] ssml_gender - # @return [::Google::Cloud::Dialogflow::V2::SsmlVoiceGender] - # Optional. The preferred gender of the voice. If not set, the service will - # choose a voice based on the other parameters such as language_code and - # {::Google::Cloud::Dialogflow::V2::VoiceSelectionParams#name name}. Note that - # this is only a preference, not requirement. If a voice of the appropriate - # gender is not available, the synthesizer should substitute a voice with a - # different gender rather than failing the request. - class VoiceSelectionParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of how speech should be synthesized. - # @!attribute [rw] speaking_rate - # @return [::Float] - # Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal - # native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 - # is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other - # values < 0.25 or > 4.0 will return an error. - # @!attribute [rw] pitch - # @return [::Float] - # Optional. Speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 - # semitones from the original pitch. -20 means decrease 20 semitones from the - # original pitch. - # @!attribute [rw] volume_gain_db - # @return [::Float] - # Optional. Volume gain (in dB) of the normal native volume supported by the - # specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of - # 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - # will play at approximately half the amplitude of the normal native signal - # amplitude. A value of +6.0 (dB) will play at approximately twice the - # amplitude of the normal native signal amplitude. We strongly recommend not - # to exceed +10 (dB) as there's usually no effective increase in loudness for - # any value greater than that. - # @!attribute [rw] effects_profile_id - # @return [::Array<::String>] - # Optional. An identifier which selects 'audio effects' profiles that are - # applied on (post synthesized) text to speech. Effects are applied on top of - # each other in the order they are given. - # @!attribute [rw] voice - # @return [::Google::Cloud::Dialogflow::V2::VoiceSelectionParams] - # Optional. The desired voice of the synthesized audio. - # @!attribute [rw] pronunciations - # @return [::Array<::Google::Cloud::Dialogflow::V2::CustomPronunciationParams>] - # Optional. The custom pronunciations for the synthesized audio. - class SynthesizeSpeechConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Pronunciation customization for a phrase. - # @!attribute [rw] phrase - # @return [::String] - # The phrase to which the customization is applied. - # The phrase can be multiple words, such as proper nouns, but shouldn't span - # the length of the sentence. - # @!attribute [rw] phonetic_encoding - # @return [::Google::Cloud::Dialogflow::V2::CustomPronunciationParams::PhoneticEncoding] - # The phonetic encoding of the phrase. - # @!attribute [rw] pronunciation - # @return [::String] - # The pronunciation of the phrase. This must be in the phonetic encoding - # specified above. - class CustomPronunciationParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The phonetic encoding of the phrase. - module PhoneticEncoding - # Not specified. - PHONETIC_ENCODING_UNSPECIFIED = 0 - - # IPA, such as apple -> ˈæpəl. - # https://en.wikipedia.org/wiki/International_Phonetic_Alphabet - PHONETIC_ENCODING_IPA = 1 - - # X-SAMPA, such as apple -> "{p@l". - # https://en.wikipedia.org/wiki/X-SAMPA - PHONETIC_ENCODING_X_SAMPA = 2 - end - end - - # Instructs the speech synthesizer on how to generate the output audio content. - # If this audio config is supplied in a request, it overrides all existing - # text-to-speech settings applied to the agent. - # @!attribute [rw] audio_encoding - # @return [::Google::Cloud::Dialogflow::V2::OutputAudioEncoding] - # Required. Audio encoding of the synthesized audio content. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # The synthesis sample rate (in hertz) for this audio. If not - # provided, then the synthesizer will use the default sample rate based on - # the audio encoding. If this is different from the voice's natural sample - # rate, then the synthesizer will honor this request by converting to the - # desired sample rate (which might result in worse audio quality). - # @!attribute [rw] synthesize_speech_config - # @return [::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig] - # Configuration of how speech should be synthesized. - class OutputAudioConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A wrapper of repeated TelephonyDtmf digits. - # @!attribute [rw] dtmf_events - # @return [::Array<::Google::Cloud::Dialogflow::V2::TelephonyDtmf>] - # A sequence of TelephonyDtmf digits. - class TelephonyDtmfEvents - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configures speech transcription for - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile}. - # @!attribute [rw] speech_model_variant - # @return [::Google::Cloud::Dialogflow::V2::SpeechModelVariant] - # The speech model used in speech to text. - # `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as - # `USE_ENHANCED`. It can be overridden in - # {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest AnalyzeContentRequest} - # and - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest StreamingAnalyzeContentRequest} - # request. If enhanced model variant is specified and an enhanced version of - # the specified model for the language does not exist, then it would emit an - # error. - # @!attribute [rw] model - # @return [::String] - # Which Speech model to select. Select the - # model best suited to your domain to get best results. If a model is not - # explicitly specified, then Dialogflow auto-selects a model based on other - # parameters in the SpeechToTextConfig and Agent settings. - # If enhanced speech model is enabled for the agent and an enhanced - # version of the specified model for the language does not exist, then the - # speech is recognized using the standard version of the specified model. - # Refer to - # [Cloud Speech API - # documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) - # for more details. - # If you specify a model, the following models typically have the best - # performance: - # - # - phone_call (best for Agent Assist and telephony) - # - latest_short (best for Dialogflow non-telephony) - # - command_and_search - # - # Leave this field unspecified to use - # [Agent Speech - # settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) - # for model selection. - # @!attribute [rw] phrase_sets - # @return [::Array<::String>] - # List of names of Cloud Speech phrase sets that are used for transcription. - # For phrase set limitations, please refer to [Cloud Speech API quotas and - # limits](https://cloud.google.com/speech-to-text/quotas#content). - # @!attribute [rw] audio_encoding - # @return [::Google::Cloud::Dialogflow::V2::AudioEncoding] - # Audio encoding of the audio content to process. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Sample rate (in Hertz) of the audio content sent in the query. - # Refer to [Cloud Speech API - # documentation](https://cloud.google.com/speech-to-text/docs/basics) for - # more details. - # @!attribute [rw] language_code - # @return [::String] - # The language of the supplied audio. Dialogflow does not do - # translations. See [Language - # Support](https://cloud.google.com/dialogflow/docs/reference/language) - # for a list of the currently supported language codes. Note that queries in - # the same session do not necessarily need to specify the same language. - # If not specified, the default language configured at - # {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile} is - # used. - # @!attribute [rw] enable_word_info - # @return [::Boolean] - # If `true`, Dialogflow returns - # {::Google::Cloud::Dialogflow::V2::SpeechWordInfo SpeechWordInfo} in - # {::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult StreamingRecognitionResult} - # with information about the recognized speech words, e.g. start and end time - # offsets. If false or unspecified, Speech doesn't return any word-level - # information. - # @!attribute [rw] use_timeout_based_endpointing - # @return [::Boolean] - # Use timeout based endpointing, interpreting endpointer sensitivity as - # seconds of timeout value. - class SpeechToTextConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling) - # digit in Telephony Gateway. - module TelephonyDtmf - # Not specified. This value may be used to indicate an absent digit. - TELEPHONY_DTMF_UNSPECIFIED = 0 - - # Number: '1'. - DTMF_ONE = 1 - - # Number: '2'. - DTMF_TWO = 2 - - # Number: '3'. - DTMF_THREE = 3 - - # Number: '4'. - DTMF_FOUR = 4 - - # Number: '5'. - DTMF_FIVE = 5 - - # Number: '6'. - DTMF_SIX = 6 - - # Number: '7'. - DTMF_SEVEN = 7 - - # Number: '8'. - DTMF_EIGHT = 8 - - # Number: '9'. - DTMF_NINE = 9 - - # Number: '0'. - DTMF_ZERO = 10 - - # Letter: 'A'. - DTMF_A = 11 - - # Letter: 'B'. - DTMF_B = 12 - - # Letter: 'C'. - DTMF_C = 13 - - # Letter: 'D'. - DTMF_D = 14 - - # Asterisk/star: '*'. - DTMF_STAR = 15 - - # Pound/diamond/hash/square/gate/octothorpe: '#'. - DTMF_POUND = 16 - end - - # Audio encoding of the audio content sent in the conversational query request. - # Refer to the - # [Cloud Speech API - # documentation](https://cloud.google.com/speech-to-text/docs/basics) for more - # details. - module AudioEncoding - # Not specified. - AUDIO_ENCODING_UNSPECIFIED = 0 - - # Uncompressed 16-bit signed little-endian samples (Linear PCM). - AUDIO_ENCODING_LINEAR_16 = 1 - - # [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio - # Codec) is the recommended encoding because it is lossless (therefore - # recognition is not compromised) and requires only about half the - # bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and - # 24-bit samples, however, not all fields in `STREAMINFO` are supported. - AUDIO_ENCODING_FLAC = 2 - - # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - AUDIO_ENCODING_MULAW = 3 - - # Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. - AUDIO_ENCODING_AMR = 4 - - # Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. - AUDIO_ENCODING_AMR_WB = 5 - - # Opus encoded audio frames in Ogg container - # ([OggOpus](https://wiki.xiph.org/OggOpus)). - # `sample_rate_hertz` must be 16000. - AUDIO_ENCODING_OGG_OPUS = 6 - - # Although the use of lossy encodings is not recommended, if a very low - # bitrate encoding is required, `OGG_OPUS` is highly preferred over - # Speex encoding. The [Speex](https://speex.org/) encoding supported by - # Dialogflow API has a header byte in each block, as in MIME type - # `audio/x-speex-with-header-byte`. - # It is a variant of the RTP Speex encoding defined in - # [RFC 5574](https://tools.ietf.org/html/rfc5574). - # The stream is a sequence of blocks, one block per RTP packet. Each block - # starts with a byte containing the length of the block, in bytes, followed - # by one or more frames of Speex data, padded to an integral number of - # bytes (octets) as specified in RFC 5574. In other words, each RTP header - # is replaced with a single byte containing the block length. Only Speex - # wideband is supported. `sample_rate_hertz` must be 16000. - AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 - - # 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. - AUDIO_ENCODING_ALAW = 8 - end - - # Variant of the specified [Speech - # model][google.cloud.dialogflow.v2.InputAudioConfig.model] to use. - # - # See the [Cloud Speech - # documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) - # for which models have different variants. For example, the "phone_call" model - # has both a standard and an enhanced variant. When you use an enhanced model, - # you will generally receive higher quality results than for a standard model. - module SpeechModelVariant - # No model variant specified. In this case Dialogflow defaults to - # USE_BEST_AVAILABLE. - SPEECH_MODEL_VARIANT_UNSPECIFIED = 0 - - # Use the best available variant of the [Speech model][model] that the caller - # is eligible for. - # - # Please see the [Dialogflow - # docs](https://cloud.google.com/dialogflow/docs/data-logging) for - # how to make your project eligible for enhanced models. - USE_BEST_AVAILABLE = 1 - - # Use standard model variant even if an enhanced model is available. See the - # [Cloud Speech - # documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) - # for details about enhanced models. - USE_STANDARD = 2 - - # Use an enhanced model variant: - # - # * If an enhanced variant does not exist for the given - # {::Google::Cloud::Dialogflow::V2::InputAudioConfig#model model} and request - # language, Dialogflow falls back to the standard variant. - # - # The [Cloud Speech - # documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models) - # describes which models have enhanced variants. - # - # * If the API caller isn't eligible for enhanced models, Dialogflow returns - # an error. Please see the [Dialogflow - # docs](https://cloud.google.com/dialogflow/docs/data-logging) - # for how to make your project eligible. - USE_ENHANCED = 3 - end - - # Gender of the voice as described in - # [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). - module SsmlVoiceGender - # An unspecified gender, which means that the client doesn't care which - # gender the selected voice will have. - SSML_VOICE_GENDER_UNSPECIFIED = 0 - - # A male voice. - SSML_VOICE_GENDER_MALE = 1 - - # A female voice. - SSML_VOICE_GENDER_FEMALE = 2 - - # A gender-neutral voice. - SSML_VOICE_GENDER_NEUTRAL = 3 - end - - # Audio encoding of the output audio format in Text-To-Speech. - module OutputAudioEncoding - # Not specified. - OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0 - - # Uncompressed 16-bit signed little-endian samples (Linear PCM). - # Audio content returned as LINEAR16 also contains a WAV header. - OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1 - - # MP3 audio at 64kbps. - OUTPUT_AUDIO_ENCODING_MP3 = 2 - - # MP3 audio at 64kbps. - OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4 - - # Opus encoded audio wrapped in an ogg container. The result will be a - # file which can be played natively on Android, and in browsers (at least - # Chrome and Firefox). The quality of the encoding is considerably higher - # than MP3 while using approximately the same bitrate. - OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3 - - # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - OUTPUT_AUDIO_ENCODING_MULAW = 5 - - # 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law. - OUTPUT_AUDIO_ENCODING_ALAW = 6 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.rb deleted file mode 100644 index 4ca1b2a80b54..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_app.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! - - -module Google - module Cloud - module Dialogflow - module V2 - # Spec of CES app that the generator can choose from. - # @!attribute [rw] ces_app - # @return [::String] - # Optional. Format: `projects//locations//apps/`. - # @!attribute [rw] confirmation_requirement - # @return [::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement] - # Optional. Indicates whether the app requires human confirmation. - # @!attribute [rw] proactive_enabled - # @return [::Boolean] - # Optional. Only applicable for CompanionAgent. - # Indicates whether the ces app is enabled in proactive mode. - # At least one of `proactive_enabled` or `reactive_enabled` should be - # true; otherwise, the ces app will be ignored. - # @!attribute [rw] reactive_enabled - # @return [::Boolean] - # Optional. Only applicable for CompanionAgent. - # Indicates whether the ces app is enabled in reactive mode. - # At least one of `proactive_enabled` or `reactive_enabled` should be - # true; otherwise, the ces app will be ignored. - class CesAppSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_tool.rb deleted file mode 100644 index 6919735037fb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/ces_tool.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 Dialogflow - module V2 - # Spec of CES tool that the generator can choose from. - # @!attribute [rw] ces_tool - # @return [::String] - # Optional. Format: `projects//locations//apps//tools/`. - # @!attribute [rw] confirmation_requirement - # @return [::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement] - # Optional. Indicates whether the tool requires human confirmation. - class CesToolSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/context.rb deleted file mode 100644 index 5efa6c079177..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/context.rb +++ /dev/null @@ -1,200 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Dialogflow contexts are similar to natural language context. If a person says - # to you "they are orange", you need context in order to understand what "they" - # is referring to. Similarly, for Dialogflow to handle an end-user expression - # like that, it needs to be provided with context in order to correctly match - # an intent. - # - # Using contexts, you can control the flow of a conversation. You can configure - # contexts for an intent by setting input and output contexts, which are - # identified by string names. When an intent is matched, any configured output - # contexts for that intent become active. While any contexts are active, - # Dialogflow is more likely to match intents that are configured with input - # contexts that correspond to the currently active contexts. - # - # For more information about context, see the - # [Contexts guide](https://cloud.google.com/dialogflow/docs/contexts-overview). - # @!attribute [rw] name - # @return [::String] - # Required. The unique identifier of the context. Format: - # `projects//agent/sessions//contexts/`, - # or `projects//agent/environments//users//sessions//contexts/`. - # - # The `Context ID` is always converted to lowercase, may only contain - # characters in `a-zA-Z0-9_-%` and may be at most 250 bytes long. - # - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # - # The following context names are reserved for internal use by Dialogflow. - # You should not use these contexts or create contexts with these names: - # - # * `__system_counters__` - # * `*_id_dialog_context` - # * `*_dialog_params_size` - # @!attribute [rw] lifespan_count - # @return [::Integer] - # Optional. The number of conversational query requests after which the - # context expires. The default is `0`. If set to `0`, the context expires - # immediately. Contexts expire automatically after 20 minutes if there - # are no matching queries. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Struct] - # Optional. The collection of parameters associated with this context. - # - # Depending on your protocol or client library language, this is a - # map, associative array, symbol table, dictionary, or JSON object - # composed of a collection of (MapKey, MapValue) pairs: - # - # * MapKey type: string - # * MapKey value: parameter name - # * MapValue type: If parameter's entity type is a composite entity then use - # map, otherwise, depending on the parameter value type, it could be one of - # string, number, boolean, null, list or map. - # * MapValue value: If parameter's entity type is a composite entity then use - # map from composite entity property names to property values, otherwise, - # use parameter value. - class Context - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Contexts::Client#list_contexts Contexts.ListContexts}. - # @!attribute [rw] parent - # @return [::String] - # Required. The session to list all contexts from. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListContextsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Contexts::Client#list_contexts Contexts.ListContexts}. - # @!attribute [rw] contexts - # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] - # The list of contexts. There will be a maximum number of items - # returned based on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListContextsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Contexts::Client#get_context Contexts.GetContext}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the context. Format: - # `projects//agent/sessions//contexts/` - # or `projects//agent/environments//users//sessions//contexts/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - class GetContextRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Contexts::Client#create_context Contexts.CreateContext}. - # @!attribute [rw] parent - # @return [::String] - # Required. The session to create a context for. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users//sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @!attribute [rw] context - # @return [::Google::Cloud::Dialogflow::V2::Context] - # Required. The context to create. - class CreateContextRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Contexts::Client#update_context Contexts.UpdateContext}. - # @!attribute [rw] context - # @return [::Google::Cloud::Dialogflow::V2::Context] - # Required. The context to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields get updated. - class UpdateContextRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Contexts::Client#delete_context Contexts.DeleteContext}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the context to delete. Format: - # `projects//agent/sessions//contexts/` - # or `projects//agent/environments//users//sessions//contexts/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - class DeleteContextRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Contexts::Client#delete_all_contexts Contexts.DeleteAllContexts}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the session to delete all contexts from. Format: - # `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. - # If `Environment ID` is not specified we assume default 'draft' environment. - # If `User ID` is not specified, we assume default '-' user. - class DeleteAllContextsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb deleted file mode 100644 index 31e89b56d0a8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation.rb +++ /dev/null @@ -1,1150 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Represents a conversation. - # A conversation is an interaction between an agent, including live agents - # and Dialogflow agents, and a support customer. Conversations can - # include phone calls and text-based chat sessions. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The unique identifier of this conversation. - # Format: `projects//locations//conversations/`. - # @!attribute [r] lifecycle_state - # @return [::Google::Cloud::Dialogflow::V2::Conversation::LifecycleState] - # Output only. The current state of the Conversation. - # @!attribute [rw] conversation_profile - # @return [::String] - # Required. The Conversation Profile to be used to configure this - # Conversation. This field cannot be updated. - # Format: `projects//locations//conversationProfiles/`. - # @!attribute [r] phone_number - # @return [::Google::Cloud::Dialogflow::V2::ConversationPhoneNumber] - # Output only. It will not be empty if the conversation is to be connected - # over telephony. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the conversation was started. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the conversation was finished. - # @!attribute [rw] conversation_stage - # @return [::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage] - # Optional. The stage of a conversation. It indicates whether the virtual - # agent or a human agent is handling the conversation. - # - # If the conversation is created with the conversation profile that has - # Dialogflow config set, defaults to - # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::VIRTUAL_AGENT_STAGE ConversationStage.VIRTUAL_AGENT_STAGE}; - # Otherwise, defaults to - # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::HUMAN_ASSIST_STAGE ConversationStage.HUMAN_ASSIST_STAGE}. - # - # If the conversation is created with the conversation profile that has - # Dialogflow config set but explicitly sets conversation_stage to - # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::HUMAN_ASSIST_STAGE ConversationStage.HUMAN_ASSIST_STAGE}, - # it skips - # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::VIRTUAL_AGENT_STAGE ConversationStage.VIRTUAL_AGENT_STAGE} - # stage and directly goes to - # {::Google::Cloud::Dialogflow::V2::Conversation::ConversationStage::HUMAN_ASSIST_STAGE ConversationStage.HUMAN_ASSIST_STAGE}. - # @!attribute [r] telephony_connection_info - # @return [::Google::Cloud::Dialogflow::V2::Conversation::TelephonyConnectionInfo] - # Output only. The telephony connection information. - # @!attribute [r] initial_conversation_profile - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # Optional. Output only. The initial conversation profile to be used to - # configure this conversation, which is a copy of the conversation profile - # config read at conversation creation time. - # @!attribute [r] ingested_context_references - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference}] - # Output only. The context reference updates provided by external systems. - # @!attribute [r] initial_generator_contexts - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::GeneratorContext}] - # Output only. A map with generator name as key and generator context as - # value. - class Conversation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The information about phone calls connected via phone gateway to the - # conversation. - # @!attribute [r] dialed_number - # @return [::String] - # Output only. The number dialed to connect this call in E.164 format. - # @!attribute [rw] sdp - # @return [::String] - # Optional. SDP of the call. It's initially the SDP answer to the incoming - # call, but maybe later updated for the purpose of making the link active, - # etc. - # @!attribute [r] sip_headers - # @return [::Array<::Google::Cloud::Dialogflow::V2::Conversation::TelephonyConnectionInfo::SipHeader>] - # Output only. The SIP headers from the initial SIP INVITE. - # @!attribute [r] extra_mime_contents - # @return [::Array<::Google::Cloud::Dialogflow::V2::Conversation::TelephonyConnectionInfo::MimeContent>] - # Output only. The mime content from the initial SIP INVITE. - class TelephonyConnectionInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The SIP headers from the initial SIP INVITE. - # @!attribute [rw] name - # @return [::String] - # Optional. The name of the header. - # @!attribute [rw] value - # @return [::String] - # Optional. The value of the header. - class SipHeader - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The mime content from the initial SIP INVITE. - # @!attribute [rw] mime_type - # @return [::String] - # Optional. The mime type of the content. - # @!attribute [rw] content - # @return [::String] - # Optional. The content payload. - class MimeContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents a section of ingested context information. - # @!attribute [rw] context_contents - # @return [::Array<::Google::Cloud::Dialogflow::V2::Conversation::ContextReference::ContextContent>] - # Required. The list of content updates for a context reference. - # @!attribute [rw] update_mode - # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference::UpdateMode] - # Required. The mode in which context reference contents are updated. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language of the information ingested, defaults to "en-US" - # if not set. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the context reference was first created. - class ContextReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contents ingested. - # @!attribute [rw] content - # @return [::String] - # Required. The information ingested in a single request. - # @!attribute [rw] content_format - # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference::ContextContent::ContentFormat] - # Required. The format of the ingested string. - # @!attribute [r] ingestion_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when this information was incorporated into the - # relevant context reference. - # @!attribute [rw] answer_record - # @return [::String] - # If the context content was generated from a tool call, specify the - # answer record associated with the tool call. - # Format: `projects//locations//answerRecords/`. - class ContextContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the format of the ingested string. - module ContentFormat - # Unspecified content format. - CONTENT_FORMAT_UNSPECIFIED = 0 - - # Content was provided in JSON format. - JSON = 1 - - # Content was provided as plain text. - PLAIN_TEXT = 2 - end - end - - # Represents the mode in which context reference contents are updated. - module UpdateMode - # Unspecified update mode. - UPDATE_MODE_UNSPECIFIED = 0 - - # Context content updates are applied in append mode. - APPEND = 1 - - # Context content updates are applied in overwrite mode. - OVERWRITE = 2 - end - end - - # Represents the context of a generator. - # @!attribute [r] generator_type - # @return [::Google::Cloud::Dialogflow::V2::Conversation::GeneratorContext::GeneratorType] - # Output only. The type of the generator. - class GeneratorContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The available generator types. - module GeneratorType - # Unspecified generator type. - GENERATOR_TYPE_UNSPECIFIED = 0 - - # Free form generator type. - FREE_FORM = 1 - - # Agent coaching generator type. - AGENT_COACHING = 2 - - # Summarization generator type. - SUMMARIZATION = 3 - - # Translation generator type. - TRANSLATION = 4 - - # Agent feedback generator type. - AGENT_FEEDBACK = 5 - - # Customer message generation generator type. - CUSTOMER_MESSAGE_GENERATION = 6 - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference] - class IngestedContextReferencesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::V2::Conversation::GeneratorContext] - class InitialGeneratorContextsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enumeration of the completion status of the conversation. - module LifecycleState - # Unknown. - LIFECYCLE_STATE_UNSPECIFIED = 0 - - # Conversation is currently open for media analysis. - IN_PROGRESS = 1 - - # Conversation has been completed. - COMPLETED = 2 - end - - # Enumeration of the different conversation stages a conversation can be in. - # Reference: - # https://cloud.google.com/agent-assist/docs/basics#conversation_stages - module ConversationStage - # Unknown. Should never be used after a conversation is successfully - # created. - CONVERSATION_STAGE_UNSPECIFIED = 0 - - # The conversation should return virtual agent responses into the - # conversation. - VIRTUAL_AGENT_STAGE = 1 - - # The conversation should not provide responses, just listen and provide - # suggestions. - HUMAN_ASSIST_STAGE = 2 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#create_conversation Conversations.CreateConversation}. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource identifier of the project creating the conversation. - # Format: `projects//locations/`. - # @!attribute [rw] conversation - # @return [::Google::Cloud::Dialogflow::V2::Conversation] - # Required. The conversation to create. - # @!attribute [rw] conversation_id - # @return [::String] - # Optional. Identifier of the conversation. Generally it's auto generated by - # Google. Only set it if you cannot wait for the response to return a - # auto-generated one to you. - # - # The conversation ID must be compliant with the regression formula - # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - # If the field is provided, the caller is responsible for - # 1. the uniqueness of the ID, otherwise the request will be rejected. - # 2. the consistency for whether to use custom ID or not under a project to - # better ensure uniqueness. - class CreateConversationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_conversations Conversations.ListConversations}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project from which to list all conversation. - # Format: `projects//locations/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - # @!attribute [rw] filter - # @return [::String] - # Optional. A filter expression that filters conversations listed in the - # response. Only `lifecycle_state` can be filtered on in this way. For - # example, the following expression only returns `COMPLETED` conversations: - # - # `lifecycle_state = "COMPLETED"` - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - class ListConversationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_conversations Conversations.ListConversations}. - # @!attribute [rw] conversations - # @return [::Array<::Google::Cloud::Dialogflow::V2::Conversation>] - # The list of conversations. There will be a maximum number of items - # returned based on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListConversationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#get_conversation Conversations.GetConversation}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the conversation. Format: - # `projects//locations//conversations/`. - class GetConversationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#complete_conversation Conversations.CompleteConversation}. - # @!attribute [rw] name - # @return [::String] - # Required. Resource identifier of the conversation to close. - # Format: `projects//locations//conversations/`. - class CompleteConversationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the conversation to list messages for. - # Format: `projects//locations//conversations/` - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter on message fields. Currently predicates on `create_time` - # and `create_time_epoch_microseconds` are supported. `create_time` only - # support milliseconds accuracy. E.g., - # `create_time_epoch_microseconds > 1551790877964485` or - # `create_time > 2017-01-15T01:30:15.01Z`. - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListMessagesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages}. - # @!attribute [rw] messages - # @return [::Array<::Google::Cloud::Dialogflow::V2::Message>] - # The list of messages. There will be a maximum number of items - # returned based on the page_size field in the request. - # `messages` is sorted by `create_time` in descending order. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are - # no more results in the list. - class ListMessagesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a phone number for telephony integration. It allows for connecting - # a particular conversation over telephony. - # @!attribute [r] country_code - # @return [::Integer] - # Output only. Desired country code for the phone number. - # @!attribute [r] phone_number - # @return [::String] - # Output only. The phone number to connect to this conversation. - class ConversationPhoneNumber - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for [ConversationsService.IngestContextReferences][]. - # @!attribute [rw] conversation - # @return [::String] - # Required. Resource identifier of the conversation to ingest context - # information for. Format: `projects//locations//conversations/`. - # @!attribute [rw] context_references - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference}] - # Required. The context references to ingest. The key is the name of the - # context reference and the value contains the contents of the context - # reference. The key is used to incorporate ingested context references to - # enhance the generator. - class IngestContextReferencesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference] - class ContextReferencesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response message for [ConversationsService.IngestContextReferences][]. - # @!attribute [rw] ingested_context_references - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference}] - # All context references ingested. - class IngestContextReferencesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference] - class IngestedContextReferencesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#suggest_conversation_summary Conversations.SuggestConversationSummary}. - # @!attribute [rw] conversation - # @return [::String] - # Required. The conversation to fetch suggestion for. - # Format: `projects//locations//conversations/`. - # @!attribute [rw] latest_message - # @return [::String] - # Optional. The name of the latest conversation message used as context for - # compiling suggestion. If empty, the latest message of the conversation will - # be used. - # - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Optional. Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 500 and at most 1000. - # @!attribute [rw] assist_query_params - # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] - # Optional. Parameters for a human assist query. Only used for POC/demo - # purpose. - class SuggestConversationSummaryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#suggest_conversation_summary Conversations.SuggestConversationSummary}. - # @!attribute [rw] summary - # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse::Summary] - # Generated summary. - # @!attribute [rw] latest_message - # @return [::String] - # The name of the latest conversation message used as context for - # compiling suggestion. - # - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse#latest_message latest_message} - # used to compile the suggestion. It may be smaller than the - # {::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest#context_size SuggestConversationSummaryRequest.context_size} - # field in the request if there weren't that many messages in the - # conversation. - class SuggestConversationSummaryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Generated summary for a conversation. - # @!attribute [rw] text - # @return [::String] - # The summary content that is concatenated into one string. - # @!attribute [rw] text_sections - # @return [::Google::Protobuf::Map{::String => ::String}] - # The summary content that is divided into sections. The key is the - # section's name and the value is the section's content. There is no - # specific format for the key or value. - # @!attribute [rw] sorted_text_sections - # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse::Summary::SummarySection>] - # Same as text_sections, but in an order that is consistent with the order - # of the sections in the generator. - # @!attribute [rw] answer_record - # @return [::String] - # The name of the answer record. Format: - # "projects//answerRecords/" - # @!attribute [rw] baseline_model_version - # @return [::String] - # The baseline model version used to generate this summary. It is empty if - # a baseline model was not used to generate this summary. - class Summary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A component of the generated summary. - # @!attribute [r] section - # @return [::String] - # Output only. Name of the section. - # @!attribute [r] summary - # @return [::String] - # Output only. Summary text for the section. - class SummarySection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TextSectionsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_summary Conversations.GenerateStatelessSummary}. - # @!attribute [rw] stateless_conversation - # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest::MinimalConversation] - # Required. The conversation to suggest a summary for. - # @!attribute [rw] conversation_profile - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # Required. A ConversationProfile containing information required for Summary - # generation. - # Required fields: \\{language_code, security_settings} - # Optional fields: \\{agent_assistant_config} - # @!attribute [rw] latest_message - # @return [::String] - # Optional. The name of the latest conversation message used as context for - # generating a Summary. If empty, the latest message of the conversation will - # be used. The format is specific to the user and the names of the messages - # provided. - # @!attribute [rw] max_context_size - # @return [::Integer] - # Optional. Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 500 and at most 1000. - class GenerateStatelessSummaryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The minimum amount of information required to generate a Summary without - # having a Conversation resource created. - # @!attribute [rw] messages - # @return [::Array<::Google::Cloud::Dialogflow::V2::Message>] - # Required. The messages that the Summary will be generated from. It is - # expected that this message content is already redacted and does not - # contain any PII. Required fields: {content, language_code, participant, - # participant_role} Optional fields: \\{send_time} If send_time is not - # provided, then the messages must be provided in chronological order. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource to charge for the Summary's generation. - # Format: `projects//locations/`. - class MinimalConversation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_summary Conversations.GenerateStatelessSummary}. - # @!attribute [rw] summary - # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse::Summary] - # Generated summary. - # @!attribute [rw] latest_message - # @return [::String] - # The name of the latest conversation message used as context for - # compiling suggestion. The format is specific to the user and the names of - # the messages provided. - # @!attribute [rw] context_size - # @return [::Integer] - # Number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse#latest_message latest_message} - # used to compile the suggestion. It may be smaller than the - # {::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest#max_context_size GenerateStatelessSummaryRequest.max_context_size} - # field in the request if there weren't that many messages in the - # conversation. - class GenerateStatelessSummaryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Generated summary for a conversation. - # @!attribute [rw] text - # @return [::String] - # The summary content that is concatenated into one string. - # @!attribute [rw] text_sections - # @return [::Google::Protobuf::Map{::String => ::String}] - # The summary content that is divided into sections. The key is the - # section's name and the value is the section's content. There is no - # specific format for the key or value. - # @!attribute [rw] baseline_model_version - # @return [::String] - # The baseline model version used to generate this summary. It is empty if - # a baseline model was not used to generate this summary. - class Summary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TextSectionsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion Conversations.GenerateStatelessSuggestion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource to charge for the Suggestion's generation. - # Format: `projects//locations/`. - # @!attribute [rw] generator - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # Uncreated generator. It should be a complete generator that includes all - # information about the generator. - # - # Note: The following fields are mutually exclusive: `generator`, `generator_name`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] generator_name - # @return [::String] - # The resource name of the existing created generator. Format: - # `projects//locations//generators/` - # - # Note: The following fields are mutually exclusive: `generator_name`, `generator`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] context_references - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Conversation::ContextReference}] - # Optional. A section of ingested context information. The key is the name of - # the context reference and the value contains the contents of the context - # reference. The key is used to incorporate ingested context references to - # enhance the generator. - # @!attribute [rw] conversation_context - # @return [::Google::Cloud::Dialogflow::V2::ConversationContext] - # Optional. Context of the conversation, including transcripts. - # @!attribute [rw] trigger_events - # @return [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] - # Optional. A list of trigger events. Generator will be triggered only if - # it's trigger event is included here. - # @!attribute [rw] security_settings - # @return [::String] - # Optional. Name of the CX SecuritySettings which is used to redact generated - # response. If this field is empty, try to fetch v2 security_settings, which - # is a project level setting. If this field is empty and no v2 - # security_settings set up in this project, no redaction will be done. - # - # Format: - # `projects//locations//securitySettings/`. - class GenerateStatelessSuggestionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::V2::Conversation::ContextReference] - class ContextReferencesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion Conversations.GenerateStatelessSuggestion}. - # @!attribute [rw] generator_suggestion - # @return [::Google::Cloud::Dialogflow::V2::GeneratorSuggestion] - # Required. Generated suggestion for a conversation. - class GenerateStatelessSuggestionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#search_knowledge Conversations.SearchKnowledge}. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource contains the conversation profile - # Format: 'projects/' or `projects//locations/`. - # @!attribute [rw] query - # @return [::Google::Cloud::Dialogflow::V2::TextInput] - # Required. The natural language text query for knowledge search. - # @!attribute [rw] conversation_profile - # @return [::String] - # Required. The conversation profile used to configure the search. - # Format: `projects//locations//conversationProfiles/`. - # @!attribute [rw] session_id - # @return [::String] - # Required. The ID of the search session. - # The session_id can be combined with Dialogflow V3 Agent ID retrieved from - # conversation profile or on its own to identify a search session. The search - # history of the same session will impact the search result. It's up to the - # API caller to choose an appropriate `Session ID`. It can be a random number - # or some type of session identifiers (preferably hashed). The length must - # not exceed 36 characters. - # @!attribute [rw] conversation - # @return [::String] - # Optional. The conversation (between human agent and end user) where the - # search request is triggered. Format: `projects//locations//conversations/`. - # @!attribute [rw] latest_message - # @return [::String] - # Optional. The name of the latest conversation message when the request is - # triggered. - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] query_source - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::QuerySource] - # Optional. The source of the query in the request. - # @!attribute [rw] end_user_metadata - # @return [::Google::Protobuf::Struct] - # Optional. Information about the end-user to improve the relevance and - # accuracy of generative answers. - # - # This will be interpreted and used by a language model, so, for good - # results, the data should be self-descriptive, and in a simple structure. - # - # Example: - # - # ```json - # { - # "subscription plan": "Business Premium Plus", - # "devices owned": [ - # \\{"model": "Google Pixel 7"}, - # \\{"model": "Google Pixel Tablet"} - # ] - # } - # ``` - # @!attribute [rw] search_config - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig] - # Optional. Configuration specific to search queries with data stores. - # @!attribute [rw] exact_search - # @return [::Boolean] - # Optional. Whether to search the query exactly without query rewrite. - class SearchKnowledgeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration specific to search queries with data stores. - # @!attribute [rw] boost_specs - # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs>] - # Optional. Boost specifications for data stores. - # - # Maps from datastore name to their boost configuration. Do not specify - # more than one BoostSpecs for each datastore name. If multiple BoostSpecs - # are provided for the same datastore name, the behavior is undefined. - # @!attribute [rw] filter_specs - # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::FilterSpecs>] - # Optional. Filter specification for data store queries. - # - # TMaps from datastore name to the filter expression for that datastore. Do - # not specify more than one FilterSpecs for each datastore name. If - # multiple FilterSpecs are provided for the same datastore name, the - # behavior is undefined. - class SearchConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Boost specifications for data stores. - # @!attribute [rw] data_stores - # @return [::Array<::String>] - # Optional. Data Stores where the boosting configuration is applied. The - # full names of the referenced data stores. Formats: - # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}` - # `projects/{project}/locations/{location}/dataStores/{data_store}` - # @!attribute [rw] spec - # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec>] - # Optional. A list of boosting specifications. - class BoostSpecs - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Boost specification to boost certain documents. - # A copy of google.cloud.discoveryengine.v1main.BoostSpec, field - # documentation is available at - # https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1alpha/BoostSpec - # @!attribute [rw] condition_boost_specs - # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec>] - # Optional. 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] - # Optional. An expression which specifies a boost condition. The - # syntax and supported fields are the same as a filter expression. - # Examples: - # - # * To boost documents with document ID "doc_1" or "doc_2", and - # color - # "Red" or "Blue": - # * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue")) - # @!attribute [rw] boost - # @return [::Float] - # Optional. 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. - # @!attribute [rw] boost_control_spec - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec] - # Optional. 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] - # Optional. The name of the field whose value will be used to - # determine the boost amount. - # @!attribute [rw] attribute_type - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::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::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::InterpolationType] - # Optional. The interpolation type to be applied to connect the - # control points listed below. - # @!attribute [rw] control_points - # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig::BoostSpecs::BoostSpec::ConditionBoostSpec::BoostControlSpec::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 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] - # 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]]`. E.g. `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 - end - - # Filter specification for data store queries. - # @!attribute [rw] data_stores - # @return [::Array<::String>] - # Optional. The data store where the filter configuration is applied. - # Full resource name of data store, such as - # projects/\\{project}/locations/\\{location}/collections/\\{collectionId}/ - # dataStores/\\{dataStoreId}. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter expression to be applied. - # Expression syntax is documented at - # https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax - class FilterSpecs - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The source of the query. We use QuerySource to distinguish queries directly - # entered by agents and suggested queries from - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist Participants.SuggestKnowledgeAssist}. - # If SUGGESTED_QUERY source is specified, we will treat it as a continuation - # of a SuggestKnowledgeAssist call. - module QuerySource - # Unknown query source. - QUERY_SOURCE_UNSPECIFIED = 0 - - # The query is from agents. - AGENT_QUERY = 1 - - # The query is a suggested query from - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist Participants.SuggestKnowledgeAssist}. - SUGGESTED_QUERY = 2 - end - end - - # Debug information related to SearchKnowledge feature. - # @!attribute [rw] datastore_response_reason - # @return [::Google::Cloud::Dialogflow::V2::DatastoreResponseReason] - # Response reason from datastore which indicates data serving status or - # answer quality degradation. - # @!attribute [rw] search_knowledge_behavior - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeDebugInfo::SearchKnowledgeBehavior] - # Configured behaviors for SearchKnowledge. - # @!attribute [rw] ingested_context_reference_debug_info - # @return [::Google::Cloud::Dialogflow::V2::IngestedContextReferenceDebugInfo] - # Information about parameters ingested for search knowledge. - # @!attribute [rw] service_latency - # @return [::Google::Cloud::Dialogflow::V2::ServiceLatency] - # The latency of the service. - class SearchKnowledgeDebugInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configured behaviors for SearchKnowledge. - # @!attribute [rw] answer_generation_rewriter_on - # @return [::Boolean] - # Whether data store agent rewriter was turned on for the request. - # @!attribute [rw] end_user_metadata_included - # @return [::Boolean] - # Whether end_user_metadata is included in the data store agent call. - # @!attribute [rw] third_party_connector_allowed - # @return [::Boolean] - # This field indicates whether third party connectors are enabled for the - # project. Note that this field only indicates if the project is - # allowlisted for connectors. - class SearchKnowledgeBehavior - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#search_knowledge Conversations.SearchKnowledge}. - # @!attribute [rw] answers - # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeAnswer>] - # Most relevant snippets extracted from articles in the given knowledge base, - # ordered by confidence. - # @!attribute [rw] rewritten_query - # @return [::String] - # The rewritten query used to search knowledge. - # @!attribute [rw] search_knowledge_debug_info - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeDebugInfo] - # Debug info for SearchKnowledge. - class SearchKnowledgeResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a SearchKnowledge answer. - # @!attribute [rw] answer - # @return [::String] - # The piece of text from the knowledge base documents that answers - # the search query - # @!attribute [rw] answer_type - # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeAnswer::AnswerType] - # The type of the answer. - # @!attribute [rw] answer_sources - # @return [::Array<::Google::Cloud::Dialogflow::V2::SearchKnowledgeAnswer::AnswerSource>] - # All sources used to generate the answer. - # @!attribute [rw] answer_record - # @return [::String] - # The name of the answer record. - # Format: `projects//locations//answer - # Records/` - class SearchKnowledgeAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The sources of the answers. - # @!attribute [rw] title - # @return [::String] - # The title of the article. - # @!attribute [rw] uri - # @return [::String] - # The URI of the article. - # @!attribute [rw] snippet - # @return [::String] - # The relevant snippet of the article. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Struct] - # Metadata associated with the article. - class AnswerSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of the answer. - module AnswerType - # The answer has a unspecified type. - ANSWER_TYPE_UNSPECIFIED = 0 - - # The answer is from FAQ documents. - FAQ = 1 - - # The answer is from generative model. - GENERATIVE = 2 - - # The answer is from intent matching. - INTENT = 3 - - # The answer is from Playbook. - PLAYBOOK = 4 - - # The answer is from event. - EVENT = 5 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_suggestions Conversations.GenerateSuggestions}. - # @!attribute [rw] conversation - # @return [::String] - # Required. The conversation for which the suggestions are generated. Format: - # `projects//locations//conversations/`. - # - # The conversation must be created with a conversation profile which has - # generators configured in it to be able to get suggestions. - # @!attribute [rw] latest_message - # @return [::String] - # Optional. The name of the latest conversation message for which the request - # is triggered. Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] trigger_events - # @return [::Array<::Google::Cloud::Dialogflow::V2::TriggerEvent>] - # Optional. A list of trigger events. Only generators configured in the - # conversation_profile whose trigger_event is listed here will be triggered. - class GenerateSuggestionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_dataset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_dataset.rb deleted file mode 100644 index c419964fcac4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_dataset.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 Cloud - module Dialogflow - module V2 - # Represents metadata of a conversation. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language code of the conversation data within this dataset. - # See https://cloud.google.com/apis/design/standard_fields for more - # information. Supports all UTF-8 languages. - class ConversationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the configuration of importing a set of conversation files in - # Google Cloud Storage. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Dialogflow::V2::GcsSources] - # The Cloud Storage URI has the form gs:////agent*.json. Wildcards are allowed and will be expanded into all - # matched JSON files, which will be read as one conversation per file. - class InputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a conversation dataset that a user imports raw data into. - # The data inside ConversationDataset can not be changed after - # ImportConversationData finishes (and calling ImportConversationData on a - # dataset that already has data is not allowed). - # @!attribute [r] name - # @return [::String] - # Output only. ConversationDataset resource name. Format: - # `projects//locations//conversationDatasets/` - # @!attribute [rw] display_name - # @return [::String] - # Required. The display name of the dataset. Maximum of 64 bytes. - # @!attribute [rw] description - # @return [::String] - # Optional. The description of the dataset. Maximum of 10000 bytes. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this dataset. - # @!attribute [r] input_config - # @return [::Google::Cloud::Dialogflow::V2::InputConfig] - # Output only. Input configurations set during conversation data import. - # @!attribute [r] conversation_info - # @return [::Google::Cloud::Dialogflow::V2::ConversationInfo] - # Output only. Metadata set during conversation data import. - # @!attribute [r] conversation_count - # @return [::Integer] - # Output only. The number of conversations this conversation dataset - # contains. - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Output only. A read only boolean field reflecting Zone Isolation status of - # the dataset. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. A read only boolean field reflecting Zone Separation status of - # the dataset. - class ConversationDataset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#create_conversation_dataset ConversationDatasets.CreateConversationDataset}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project to create conversation dataset for. Format: - # `projects//locations/` - # @!attribute [rw] conversation_dataset - # @return [::Google::Cloud::Dialogflow::V2::ConversationDataset] - # Required. The conversation dataset to create. - class CreateConversationDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#get_conversation_dataset ConversationDatasets.GetConversationDataset}. - # @!attribute [rw] name - # @return [::String] - # Required. The conversation dataset to retrieve. Format: - # `projects//locations//conversationDatasets/` - class GetConversationDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets ConversationDatasets.ListConversationDatasets}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location name to list all conversation datasets - # for. Format: `projects//locations/` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of conversation datasets to return in a single - # page. By default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListConversationDatasetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets ConversationDatasets.ListConversationDatasets}. - # @!attribute [rw] conversation_datasets - # @return [::Array<::Google::Cloud::Dialogflow::V2::ConversationDataset>] - # The list of datasets to return. - # @!attribute [rw] next_page_token - # @return [::String] - # The token to use to retrieve the next page of results, or empty if there - # are no more results in the list. - class ListConversationDatasetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#delete_conversation_dataset ConversationDatasets.DeleteConversationDataset}. - # @!attribute [rw] name - # @return [::String] - # Required. The conversation dataset to delete. Format: - # `projects//locations//conversationDatasets/` - class DeleteConversationDatasetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data ConversationDatasets.ImportConversationData}. - # @!attribute [rw] name - # @return [::String] - # Required. Dataset resource name. Format: - # `projects//locations//conversationDatasets/` - # @!attribute [rw] input_config - # @return [::Google::Cloud::Dialogflow::V2::InputConfig] - # Required. Configuration describing where to import data from. - class ImportConversationDataRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for a - # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data ConversationDatasets.ImportConversationData} - # operation. - # @!attribute [rw] conversation_dataset - # @return [::String] - # The resource name of the imported conversation dataset. Format: - # `projects//locations//conversationDatasets/` - # @!attribute [rw] partial_failures - # @return [::Array<::Google::Rpc::Status>] - # Partial failures are failures that don't fail the whole long running - # operation, e.g. single files that couldn't be read. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when import conversation data request was created. The time is - # measured on server side. - class ImportConversationDataOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response used for - # {::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data ConversationDatasets.ImportConversationData} - # long running operation. - # @!attribute [rw] conversation_dataset - # @return [::String] - # The resource name of the imported conversation dataset. Format: - # `projects//locations//conversationDatasets/` - # @!attribute [rw] import_count - # @return [::Integer] - # Number of conversations imported successfully. - class ImportConversationDataOperationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for [CreateConversationDataset][]. - # @!attribute [rw] conversation_dataset - # @return [::String] - # The resource name of the conversation dataset that will be created. Format: - # `projects//locations//conversationDatasets/` - class CreateConversationDatasetOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for [DeleteConversationDataset][]. - class DeleteConversationDatasetOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb deleted file mode 100644 index 4efde0548bbf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_event.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 Cloud - module Dialogflow - module V2 - # Represents a notification sent to Pub/Sub subscribers for conversation - # lifecycle events. - # @!attribute [rw] conversation - # @return [::String] - # The unique identifier of the conversation this notification - # refers to. - # Format: `projects//conversations/`. - # @!attribute [rw] type - # @return [::Google::Cloud::Dialogflow::V2::ConversationEvent::Type] - # The type of the event that this notification refers to. - # @!attribute [rw] error_status - # @return [::Google::Rpc::Status] - # More detailed information about an error. Only set for type - # UNRECOVERABLE_ERROR_IN_PHONE_CALL. - # @!attribute [rw] new_message_payload - # @return [::Google::Cloud::Dialogflow::V2::Message] - # Payload of NEW_MESSAGE event. - # - # Note: The following fields are mutually exclusive: `new_message_payload`, `new_recognition_result_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] new_recognition_result_payload - # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult] - # Payload of NEW_RECOGNITION_RESULT event. - # - # Note: The following fields are mutually exclusive: `new_recognition_result_payload`, `new_message_payload`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ConversationEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumeration of the types of events available. - module Type - # Type not set. - TYPE_UNSPECIFIED = 0 - - # A new conversation has been opened. This is fired when a telephone call - # is answered, or a conversation is created via the API. - CONVERSATION_STARTED = 1 - - # An existing conversation has closed. This is fired when a telephone call - # is terminated, or a conversation is closed via the API. - # The event is fired for every CompleteConversation call, even if the - # conversation is already closed. - CONVERSATION_FINISHED = 2 - - # An existing conversation has received notification from Dialogflow that - # human intervention is required. - HUMAN_INTERVENTION_NEEDED = 3 - - # An existing conversation has received a new message, either from API or - # telephony. It is configured in - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#new_message_event_notification_config ConversationProfile.new_message_event_notification_config} - NEW_MESSAGE = 5 - - # An existing conversation has received a new speech recognition result. - # This is mainly for delivering intermediate transcripts. The notification - # is configured in - # [ConversationProfile.new_recognition_event_notification_config][]. - NEW_RECOGNITION_RESULT = 7 - - # Unrecoverable error during a telephone call. - # - # In general non-recoverable errors only occur if something was - # misconfigured in the ConversationProfile corresponding to the call. After - # a non-recoverable error, Dialogflow may stop responding. - # - # We don't fire this event: - # - # * in an API call because we can directly return the error, or, - # * when we can recover from an error. - UNRECOVERABLE_ERROR = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_model.rb deleted file mode 100644 index cd1b6212e069..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_model.rb +++ /dev/null @@ -1,577 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Represents a conversation model. - # @!attribute [rw] name - # @return [::String] - # ConversationModel resource name. Format: - # `projects//conversationModels/` - # @!attribute [rw] display_name - # @return [::String] - # Required. The display name of the model. At most 64 bytes long. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this model. - # @!attribute [rw] datasets - # @return [::Array<::Google::Cloud::Dialogflow::V2::InputDataset>] - # Required. Datasets used to create model. - # @!attribute [r] state - # @return [::Google::Cloud::Dialogflow::V2::ConversationModel::State] - # Output only. State of the model. A model can only serve prediction requests - # after it gets deployed. - # @!attribute [rw] language_code - # @return [::String] - # Language code for the conversation model. If not specified, the language - # is en-US. Language at ConversationModel should be set for all non en-us - # languages. - # This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag. Example: "en-US". - # @!attribute [rw] article_suggestion_model_metadata - # @return [::Google::Cloud::Dialogflow::V2::ArticleSuggestionModelMetadata] - # Metadata for article suggestion models. - # - # Note: The following fields are mutually exclusive: `article_suggestion_model_metadata`, `smart_reply_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] smart_reply_model_metadata - # @return [::Google::Cloud::Dialogflow::V2::SmartReplyModelMetadata] - # Metadata for smart reply models. - # - # Note: The following fields are mutually exclusive: `smart_reply_model_metadata`, `article_suggestion_model_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. A read only boolean field reflecting Zone Separation - # status of the model. - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Output only. A read only boolean field reflecting Zone Isolation status - # of the model. - class ConversationModel - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the model. - module State - # Should not be used, an un-set enum has this value by default. - STATE_UNSPECIFIED = 0 - - # Model being created. - CREATING = 1 - - # Model is not deployed but ready to deploy. - UNDEPLOYED = 2 - - # Model is deploying. - DEPLOYING = 3 - - # Model is deployed and ready to use. - DEPLOYED = 4 - - # Model is undeploying. - UNDEPLOYING = 5 - - # Model is deleting. - DELETING = 6 - - # Model is in error state. Not ready to deploy and use. - FAILED = 7 - - # Model is being created but the training has not started, - # The model may remain in this state until there is enough capacity to - # start training. - PENDING = 8 - end - - # Model type. - module ModelType - # ModelType unspecified. - MODEL_TYPE_UNSPECIFIED = 0 - - # ModelType smart reply dual encoder model. - SMART_REPLY_DUAL_ENCODER_MODEL = 2 - - # ModelType smart reply bert model. - SMART_REPLY_BERT_MODEL = 6 - end - end - - # Represents evaluation result of a conversation model. - # @!attribute [rw] name - # @return [::String] - # The resource name of the evaluation. Format: - # `projects//conversationModels//evaluations/` - # @!attribute [rw] display_name - # @return [::String] - # Optional. The display name of the model evaluation. At most 64 bytes long. - # @!attribute [rw] evaluation_config - # @return [::Google::Cloud::Dialogflow::V2::EvaluationConfig] - # Optional. The configuration of the evaluation task. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this model. - # @!attribute [r] smart_reply_metrics - # @return [::Google::Cloud::Dialogflow::V2::SmartReplyMetrics] - # Output only. Only available when model is for smart reply. - # @!attribute [r] raw_human_eval_template_csv - # @return [::String] - # Output only. Human eval template in csv format. - # It takes real-world conversations provided through input dataset, generates - # example suggestions for customer to verify quality of the model. - # For Smart Reply, the generated csv file contains columns of - # Context, (Suggestions,Q1,Q2)*3, Actual reply. - # Context contains at most 10 latest messages in the conversation prior to - # the current suggestion. - # Q1: "Would you send it as the next message of agent?" - # Evaluated based on whether the suggest is appropriate to be sent by - # agent in current context. - # Q2: "Does the suggestion move the conversation closer to resolution?" - # Evaluated based on whether the suggestion provide solutions, or answers - # customer's question or collect information from customer to resolve the - # customer's issue. - # Actual reply column contains the actual agent reply sent in the context. - class ConversationModelEvaluation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The configuration for model evaluation. - # @!attribute [rw] datasets - # @return [::Array<::Google::Cloud::Dialogflow::V2::InputDataset>] - # Required. Datasets used for evaluation. - # @!attribute [rw] smart_reply_config - # @return [::Google::Cloud::Dialogflow::V2::EvaluationConfig::SmartReplyConfig] - # Configuration for smart reply model evaluation. - # - # Note: The following fields are mutually exclusive: `smart_reply_config`, `smart_compose_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] smart_compose_config - # @return [::Google::Cloud::Dialogflow::V2::EvaluationConfig::SmartComposeConfig] - # Configuration for smart compose model evaluation. - # - # Note: The following fields are mutually exclusive: `smart_compose_config`, `smart_reply_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class EvaluationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Smart reply specific configuration for evaluation job. - # @!attribute [rw] allowlist_document - # @return [::String] - # The allowlist document resource name. - # Format: `projects//knowledgeBases//documents/`. Only used for smart reply model. - # @!attribute [rw] max_result_count - # @return [::Integer] - # Required. The model to be evaluated can return multiple results with - # confidence score on each query. These results will be sorted by the - # descending order of the scores and we only keep the first - # max_result_count results as the final results to evaluate. - class SmartReplyConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Smart compose specific configuration for evaluation job. - # @!attribute [rw] allowlist_document - # @return [::String] - # The allowlist document resource name. - # Format: `projects//knowledgeBases//documents/`. Only used for smart compose model. - # @!attribute [rw] max_result_count - # @return [::Integer] - # Required. The model to be evaluated can return multiple results with - # confidence score on each query. These results will be sorted by the - # descending order of the scores and we only keep the first - # max_result_count results as the final results to evaluate. - class SmartComposeConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # InputDataset used to create model or do evaluation. - # NextID:5 - # @!attribute [rw] dataset - # @return [::String] - # Required. ConversationDataset resource name. Format: - # `projects//locations//conversationDatasets/` - class InputDataset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for article suggestion models. - # @!attribute [rw] training_model_type - # @return [::Google::Cloud::Dialogflow::V2::ConversationModel::ModelType] - # Optional. Type of the article suggestion model. If not provided, model_type - # is used. - class ArticleSuggestionModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for smart reply models. - # @!attribute [rw] training_model_type - # @return [::Google::Cloud::Dialogflow::V2::ConversationModel::ModelType] - # Optional. Type of the smart reply model. If not provided, model_type is - # used. - class SmartReplyModelMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The evaluation metrics for smart reply model. - # @!attribute [rw] allowlist_coverage - # @return [::Float] - # Percentage of target participant messages in the evaluation dataset for - # which similar messages have appeared at least once in the allowlist. Should - # be [0, 1]. - # @!attribute [rw] top_n_metrics - # @return [::Array<::Google::Cloud::Dialogflow::V2::SmartReplyMetrics::TopNMetrics>] - # Metrics of top n smart replies, sorted by [TopNMetric.n][]. - # @!attribute [rw] conversation_count - # @return [::Integer] - # Total number of conversations used to generate this metric. - class SmartReplyMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Evaluation metrics when retrieving `n` smart replies with the model. - # @!attribute [rw] n - # @return [::Integer] - # Number of retrieved smart replies. For example, when `n` is 3, this - # evaluation contains metrics for when Dialogflow retrieves 3 smart replies - # with the model. - # @!attribute [rw] recall - # @return [::Float] - # Defined as `number of queries whose top n smart replies have at least one - # similar (token match similarity above the defined threshold) reply as the - # real reply` divided by `number of queries with at least one smart reply`. - # Value ranges from 0.0 to 1.0 inclusive. - class TopNMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model ConversationModels.CreateConversationModel} - # @!attribute [rw] parent - # @return [::String] - # The project to create conversation model for. Format: - # `projects/` - # @!attribute [rw] conversation_model - # @return [::Google::Cloud::Dialogflow::V2::ConversationModel] - # Required. The conversation model to create. - class CreateConversationModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model ConversationModels.GetConversationModel} - # @!attribute [rw] name - # @return [::String] - # Required. The conversation model to retrieve. Format: - # `projects//conversationModels/` - class GetConversationModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_models ConversationModels.ListConversationModels} - # @!attribute [rw] parent - # @return [::String] - # Required. The project to list all conversation models for. - # Format: `projects/` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of conversation models to return in a single - # page. By default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListConversationModelsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_models ConversationModels.ListConversationModels} - # @!attribute [rw] conversation_models - # @return [::Array<::Google::Cloud::Dialogflow::V2::ConversationModel>] - # The list of models to return. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListConversationModelsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#delete_conversation_model ConversationModels.DeleteConversationModel} - # @!attribute [rw] name - # @return [::String] - # Required. The conversation model to delete. Format: - # `projects//conversationModels/` - class DeleteConversationModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model ConversationModels.DeployConversationModel} - # @!attribute [rw] name - # @return [::String] - # Required. The conversation model to deploy. Format: - # `projects//conversationModels/` - class DeployConversationModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model ConversationModels.UndeployConversationModel} - # @!attribute [rw] name - # @return [::String] - # Required. The conversation model to undeploy. Format: - # `projects//conversationModels/` - class UndeployConversationModelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model_evaluation ConversationModels.GetConversationModelEvaluation} - # @!attribute [rw] name - # @return [::String] - # Required. The conversation model evaluation resource name. Format: - # `projects//conversationModels//evaluations/` - class GetConversationModelEvaluationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations ConversationModels.ListConversationModelEvaluations} - # @!attribute [rw] parent - # @return [::String] - # Required. The conversation model resource name. Format: - # `projects//conversationModels/` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of evaluations to return in a - # single page. By default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListConversationModelEvaluationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations ConversationModels.ListConversationModelEvaluations} - # @!attribute [rw] conversation_model_evaluations - # @return [::Array<::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation>] - # The list of evaluations to return. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListConversationModelEvaluationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation ConversationModels.CreateConversationModelEvaluation} - # @!attribute [rw] parent - # @return [::String] - # Required. The conversation model resource name. Format: - # `projects//locations//conversationModels/` - # @!attribute [rw] conversation_model_evaluation - # @return [::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation] - # Required. The conversation model evaluation to be created. - class CreateConversationModelEvaluationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for a - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model ConversationModels.CreateConversationModel} - # operation. - # @!attribute [rw] conversation_model - # @return [::String] - # The resource name of the conversation model. Format: - # `projects//conversationModels/` - # @!attribute [rw] state - # @return [::Google::Cloud::Dialogflow::V2::CreateConversationModelOperationMetadata::State] - # State of CreateConversationModel operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when the request to create conversation model is submitted. The - # time is measured on server side. - # @!attribute [rw] done_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation finished. - class CreateConversationModelOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of CreateConversationModel operation. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is submitted, but training has not started yet. - # The model may remain in this state until there is enough capacity to - # start training. - PENDING = 1 - - # The training has succeeded. - SUCCEEDED = 2 - - # The training has succeeded. - FAILED = 3 - - # The training has been cancelled. - CANCELLED = 4 - - # The training is in cancelling state. - CANCELLING = 5 - - # Custom model is training. - TRAINING = 6 - end - end - - # Metadata for a - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model ConversationModels.DeployConversationModel} - # operation. - # @!attribute [rw] conversation_model - # @return [::String] - # The resource name of the conversation model. Format: - # `projects//conversationModels/` - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when request to deploy conversation model was submitted. The time - # is measured on server side. - # @!attribute [rw] done_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation finished. - class DeployConversationModelOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for a - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model ConversationModels.UndeployConversationModel} - # operation. - # @!attribute [rw] conversation_model - # @return [::String] - # The resource name of the conversation model. Format: - # `projects//conversationModels/` - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when the request to undeploy conversation model was submitted. - # The time is measured on server side. - # @!attribute [rw] done_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation finished. - class UndeployConversationModelOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for a - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#delete_conversation_model ConversationModels.DeleteConversationModel} - # operation. - # @!attribute [rw] conversation_model - # @return [::String] - # The resource name of the conversation model. Format: - # `projects//conversationModels/` - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when delete conversation model request was created. The time is - # measured on server side. - # @!attribute [rw] done_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation finished. - class DeleteConversationModelOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for a - # {::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation ConversationModels.CreateConversationModelEvaluation} - # operation. - # @!attribute [rw] conversation_model_evaluation - # @return [::String] - # The resource name of the conversation model. Format: - # `projects//locations//conversationModels//evaluations/` - # @!attribute [rw] conversation_model - # @return [::String] - # The resource name of the conversation model. Format: - # `projects//locations//conversationModels/` - # @!attribute [rw] state - # @return [::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationOperationMetadata::State] - # State of CreateConversationModel operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when the request to create conversation model was submitted. The - # time is measured on server side. - class CreateConversationModelEvaluationOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of CreateConversationModel operation. - module State - # Operation status not specified. - STATE_UNSPECIFIED = 0 - - # The operation is being prepared. - INITIALIZING = 1 - - # The operation is running. - RUNNING = 2 - - # The operation is cancelled. - CANCELLED = 3 - - # The operation has succeeded. - SUCCEEDED = 4 - - # The operation has failed. - FAILED = 5 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb deleted file mode 100644 index b539f225fc25..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +++ /dev/null @@ -1,923 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Defines the services to connect to incoming Dialogflow conversations. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of this conversation profile. - # Format: `projects//locations//conversationProfiles/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. Human readable name for this profile. Max length 1024 bytes. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time of the conversation profile. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time of the conversation profile. - # @!attribute [rw] automated_agent_config - # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentConfig] - # Configuration for an automated agent to use with this profile. - # @!attribute [rw] human_agent_assistant_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig] - # Configuration for agent assistance to use with this profile. - # @!attribute [rw] human_agent_handoff_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentHandoffConfig] - # Configuration for connecting to a live agent. - # - # Currently, this feature is not general available, please contact Google - # to get access. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig] - # Configuration for publishing conversation lifecycle events. - # @!attribute [rw] logging_config - # @return [::Google::Cloud::Dialogflow::V2::LoggingConfig] - # Configuration for logging conversation lifecycle events. - # @!attribute [rw] new_message_event_notification_config - # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig] - # Configuration for publishing new message events. Event will be sent in - # format of {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent} - # @!attribute [rw] new_recognition_result_notification_config - # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig] - # Optional. Configuration for publishing transcription intermediate results. - # Event will be sent in format of - # {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent}. If - # configured, the following information will be populated as - # {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent} Pub/Sub - # message attributes: - # - "participant_id" - # - "participant_role" - # - "message_id" - # @!attribute [rw] stt_config - # @return [::Google::Cloud::Dialogflow::V2::SpeechToTextConfig] - # Settings for speech transcription. - # @!attribute [rw] language_code - # @return [::String] - # Language code for the conversation profile. If not specified, the language - # is en-US. Language at ConversationProfile should be set for all non en-US - # languages. - # This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag. Example: "en-US". - # @!attribute [rw] sip_config - # @return [::Google::Cloud::Dialogflow::V2::SipConfig] - # Optional. Configuration for SIP connections. - # @!attribute [rw] time_zone - # @return [::String] - # The time zone of this conversational profile from the - # [time zone database](https://www.iana.org/time-zones), e.g., - # America/New_York, Europe/Paris. Defaults to America/New_York. - # @!attribute [rw] security_settings - # @return [::String] - # Name of the CX SecuritySettings reference for the agent. - # Format: `projects//locations//securitySettings/`. - # @!attribute [rw] tts_config - # @return [::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig] - # Configuration for Text-to-Speech synthesization. - # - # Used by Phone Gateway to specify synthesization options. If agent defines - # synthesization options as well, agent settings overrides the option here. - class ConversationProfile - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles ConversationProfiles.ListConversationProfiles}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project to list all conversation profiles from. - # Format: `projects//locations/`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous list request. - class ListConversationProfilesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles ConversationProfiles.ListConversationProfiles}. - # @!attribute [rw] conversation_profiles - # @return [::Array<::Google::Cloud::Dialogflow::V2::ConversationProfile>] - # The list of project conversation profiles. There is a maximum number - # of items returned based on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListConversationProfilesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile ConversationProfiles.GetConversationProfile}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the conversation profile. - # Format: `projects//locations//conversationProfiles/`. - class GetConversationProfileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#create_conversation_profile ConversationProfiles.CreateConversationProfile}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project to create a conversation profile for. - # Format: `projects//locations/`. - # @!attribute [rw] conversation_profile - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # Required. The conversation profile to create. - class CreateConversationProfileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#update_conversation_profile ConversationProfiles.UpdateConversationProfile}. - # @!attribute [rw] conversation_profile - # @return [::Google::Cloud::Dialogflow::V2::ConversationProfile] - # Required. The conversation profile to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to control which fields to update. - class UpdateConversationProfileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#delete_conversation_profile ConversationProfiles.DeleteConversationProfile}. - # - # This operation fails if the conversation profile is still referenced from - # a phone number. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the conversation profile to delete. - # Format: `projects//locations//conversationProfiles/`. - class DeleteConversationProfileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines the Automated Agent to connect to a conversation. - # @!attribute [rw] agent - # @return [::String] - # Required. ID of the Dialogflow agent environment to use. - # - # This project needs to either be the same project as the conversation or you - # need to grant `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow API - # Service Agent` role in this project. - # - # - For ES agents, use format: `projects//locations//agent/environments/`. If environment is not - # specified, the default `draft` environment is used. Refer to - # [DetectIntentRequest](/dialogflow/docs/reference/rpc/google.cloud.dialogflow.v2#google.cloud.dialogflow.v2.DetectIntentRequest) - # for more details. - # - # - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment - # is used. - # @!attribute [rw] session_ttl - # @return [::Google::Protobuf::Duration] - # Optional. Configure lifetime of the Dialogflow session. - # By default, a Dialogflow CX session remains active and its data is stored - # for 30 minutes after the last request is sent for the session. - # This value should be no longer than 1 day. - class AutomatedAgentConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines the Human Agent Assist to connect to a conversation. - # @!attribute [rw] notification_config - # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig] - # Pub/Sub topic on which to publish new agent assistant events. - # @!attribute [rw] human_agent_suggestion_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig] - # Configuration for agent assistance of human agent participant. - # @!attribute [rw] end_user_suggestion_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig] - # Configuration for agent assistance of end user participant. - # - # Currently, this feature is not general available, please contact Google - # to get access. - # @!attribute [rw] message_analysis_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::MessageAnalysisConfig] - # Configuration for message analysis. - class HumanAgentAssistantConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Settings of suggestion trigger. - # @!attribute [rw] no_smalltalk - # @return [::Boolean] - # Do not trigger if last utterance is small talk. - # @!attribute [rw] only_end_user - # @return [::Boolean] - # Only trigger suggestion if participant role of last utterance is - # END_USER. - class SuggestionTriggerSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Config for suggestion features. - # @!attribute [rw] suggestion_feature - # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature] - # The suggestion feature. - # @!attribute [rw] enable_event_based_suggestion - # @return [::Boolean] - # Automatically iterates all participants and tries to compile - # suggestions. - # - # Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST, - # KNOWLEDGE_ASSIST. - # @!attribute [rw] disable_agent_query_logging - # @return [::Boolean] - # Optional. Disable the logging of search queries sent by human agents. It - # can prevent those queries from being stored at answer records. - # - # Supported features: KNOWLEDGE_SEARCH. - # @!attribute [rw] enable_query_suggestion_when_no_answer - # @return [::Boolean] - # Optional. Enable query suggestion even if we can't find its answer. - # By default, queries are suggested only if we find its answer. - # Supported features: KNOWLEDGE_ASSIST - # @!attribute [rw] enable_conversation_augmented_query - # @return [::Boolean] - # Optional. Enable including conversation context during query answer - # generation. Supported features: KNOWLEDGE_SEARCH. - # @!attribute [rw] enable_query_suggestion_only - # @return [::Boolean] - # Optional. Enable query suggestion only. - # Supported features: KNOWLEDGE_ASSIST - # @!attribute [rw] enable_response_debug_info - # @return [::Boolean] - # Optional. Enable returning detailed reasons for suggestion results. - # - # For example, with this field disabled, Knowledge Search feature returns - # NotFound error when no answer is found for the input query. Enabling this - # field will change the behavior to return an OK response with - # detailed information indicating the lack of results. - # - # Supported features: KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST - # @!attribute [rw] rai_settings - # @return [::Google::Cloud::Dialogflow::V2::RaiSettings] - # Optional. Settings for Responsible AI checks. - # Supported features: KNOWLEDGE_ASSIST - # @!attribute [rw] suggestion_trigger_event - # @return [::Google::Cloud::Dialogflow::V2::TriggerEvent] - # Optional. The trigger event for suggestion. - # If unspecified, it will be `CUSTOMER_MESSAGE`. - # Supported features: KNOWLEDGE_ASSIST - # For KNOWLEDGE_ASSIST, these four trigger events are supported: - # 1. TRIGGER_EVENT_UNSPECIFIED - # 2. END_OF_UTTERANCE - # 3. CUSTOMER_MESSAGE - # 4. AGENT_MESSAGE - # @!attribute [rw] disable_query_search_context - # @return [::Boolean] - # Optional. If true, disable appending available search context to the - # search query. Supported features: KNOWLEDGE_ASSIST - # @!attribute [rw] suggestion_trigger_settings - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionTriggerSettings] - # Settings of suggestion trigger. - # - # Currently, only ARTICLE_SUGGESTION and FAQ will use this field. - # @!attribute [rw] query_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig] - # Configs of query. - # @!attribute [rw] conversation_model_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::ConversationModelConfig] - # Configs of custom conversation model. - # @!attribute [rw] conversation_process_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::ConversationProcessConfig] - # Configs for processing conversation. - class SuggestionFeatureConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detail human agent assistant config. - # @!attribute [rw] feature_configs - # @return [::Array<::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig>] - # Configuration of different suggestion features. One feature can have only - # one config. - # @!attribute [rw] group_suggestion_responses - # @return [::Boolean] - # If `group_suggestion_responses` is false, and there are multiple - # `feature_configs` in `event based suggestion` or - # StreamingAnalyzeContent, we will try to deliver suggestions to customers - # as soon as we get new suggestion. Different type of suggestions based on - # the same context will be in separate Pub/Sub event or - # `StreamingAnalyzeContentResponse`. - # - # If `group_suggestion_responses` set to true. All the suggestions to the - # same participant based on the same context will be grouped into a single - # Pub/Sub event or StreamingAnalyzeContentResponse. - # @!attribute [rw] generators - # @return [::Array<::String>] - # Optional. List of various generator resource names used in the - # conversation profile. - # @!attribute [rw] disable_high_latency_features_sync_delivery - # @return [::Boolean] - # Optional. When disable_high_latency_features_sync_delivery is true and - # using the AnalyzeContent API, we will not deliver the responses from high - # latency features in the API response. The - # human_agent_assistant_config.notification_config must be configured and - # enable_event_based_suggestion must be set to true to receive the - # responses from high latency features in Pub/Sub. High latency feature(s): - # KNOWLEDGE_ASSIST - # @!attribute [rw] skip_empty_event_based_suggestion - # @return [::Boolean] - # Optional. Enable skipping event based suggestion if the suggestion is - # empty. - # - # For example, with this field disabled, Knowledge Assist feature sends - # a Pub/Sub message when there are no suggestions. Enabling this field - # will change the behavior to skip the Pub/Sub message in this situation. - # @!attribute [rw] use_unredacted_conversation_data - # @return [::Boolean] - # Optional. If true, - # use unredacted transcript data (Supported features: AI_COACH) and - # use unredacted ingested context (Supported features: All Agent Assist - # features) - # @!attribute [rw] enable_async_tool_call - # @return [::Boolean] - # Optional. If true, enable asynchronous execution of tools. - class SuggestionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Config for suggestion query. - # @!attribute [rw] knowledge_base_query_source - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::KnowledgeBaseQuerySource] - # Query from knowledgebase. It is used by: - # ARTICLE_SUGGESTION, FAQ. - # - # Note: The following fields are mutually exclusive: `knowledge_base_query_source`, `document_query_source`, `dialogflow_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] document_query_source - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::DocumentQuerySource] - # Query from knowledge base document. It is used by: - # SMART_REPLY, SMART_COMPOSE. - # - # Note: The following fields are mutually exclusive: `document_query_source`, `knowledge_base_query_source`, `dialogflow_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] dialogflow_query_source - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::DialogflowQuerySource] - # Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. - # - # Note: The following fields are mutually exclusive: `dialogflow_query_source`, `knowledge_base_query_source`, `document_query_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] max_results - # @return [::Integer] - # Maximum number of results to return. Currently, if unset, defaults to 10. - # And the max number is 20. - # @!attribute [rw] confidence_threshold - # @return [::Float] - # Confidence threshold of query result. - # - # Agent Assist gives each suggestion a score in the range [0.0, 1.0], based - # on the relevance between the suggestion and the current conversation - # context. A score of 0.0 has no relevance, while a score of 1.0 has high - # relevance. Only suggestions with a score greater than or equal to the - # value of this field are included in the results. - # - # For a baseline model (the default), the recommended value is in the range - # [0.05, 0.1]. - # - # For a custom model, there is no recommended value. Tune this value by - # starting from a very low value and slowly increasing until you have - # desired results. - # - # If this field is not set, it defaults to 0.0, which means that all - # suggestions are returned. - # - # Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE, - # KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST, ENTITY_EXTRACTION. - # @!attribute [rw] context_filter_settings - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::ContextFilterSettings] - # Determines how recent conversation context is filtered when generating - # suggestions. If unspecified, no messages will be dropped. - # @!attribute [rw] sections - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::Sections] - # Optional. The customized sections chosen to return when requesting a - # summary of a conversation. - # @!attribute [rw] context_size - # @return [::Integer] - # Optional. The number of recent messages to include in the context. - # Supported features: KNOWLEDGE_ASSIST. - class SuggestionQueryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Knowledge base source settings. - # - # Supported features: ARTICLE_SUGGESTION, FAQ. - # @!attribute [rw] knowledge_bases - # @return [::Array<::String>] - # Required. Knowledge bases to query. Format: - # `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge - # bases are supported. - class KnowledgeBaseQuerySource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Document source settings. - # - # Supported features: SMART_REPLY, SMART_COMPOSE. - # @!attribute [rw] documents - # @return [::Array<::String>] - # Required. Knowledge documents to query from. Format: - # `projects//locations//knowledgeBases//documents/`. - # Currently, at most 5 documents are supported. - class DocumentQuerySource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Dialogflow source setting. - # - # Supported feature: DIALOGFLOW_ASSIST. - # @!attribute [rw] agent - # @return [::String] - # Required. The name of a Dialogflow virtual agent used for end user side - # intent detection and suggestion. Format: `projects//locations//agent`. When multiple agents are allowed in - # the same Dialogflow project. - # @!attribute [rw] human_agent_side_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::DialogflowQuerySource::HumanAgentSideConfig] - # Optional. The Dialogflow assist configuration for human agent. - class DialogflowQuerySource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The configuration used for human agent side Dialogflow assist - # suggestion. - # @!attribute [rw] agent - # @return [::String] - # Optional. The name of a dialogflow virtual agent used for intent - # detection and suggestion triggered by human agent. - # Format: `projects//locations//agent`. - class HumanAgentSideConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings that determine how to filter recent conversation context when - # generating suggestions. - # @!attribute [rw] drop_handoff_messages - # @return [::Boolean] - # If set to true, the last message from virtual agent (hand off message) - # and the message before it (trigger message of hand off) are dropped. - # @!attribute [rw] drop_virtual_agent_messages - # @return [::Boolean] - # If set to true, all messages from virtual agent are dropped. - # @!attribute [rw] drop_ivr_messages - # @return [::Boolean] - # If set to true, all messages from ivr stage are dropped. - class ContextFilterSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Custom sections to return when requesting a summary of a conversation. - # This is only supported when `baseline_model_version` == '2.0'. - # - # Supported features: CONVERSATION_SUMMARIZATION, - # CONVERSATION_SUMMARIZATION_VOICE. - # @!attribute [rw] section_types - # @return [::Array<::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionQueryConfig::Sections::SectionType>] - # The selected sections chosen to return when requesting a summary of a - # conversation. A duplicate selected section will be treated as a single - # selected section. If section types are not provided, the default will - # be \\{SITUATION, ACTION, RESULT}. - class Sections - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Selectable sections to return when requesting a summary of a - # conversation. - module SectionType - # Undefined section type, does not return anything. - SECTION_TYPE_UNSPECIFIED = 0 - - # What the customer needs help with or has question about. - # Section name: "situation". - SITUATION = 1 - - # What the agent does to help the customer. - # Section name: "action". - ACTION = 2 - - # Result of the customer service. A single word describing the result - # of the conversation. - # Section name: "resolution". - RESOLUTION = 3 - - # Reason for cancellation if the customer requests for a cancellation. - # "N/A" otherwise. - # Section name: "reason_for_cancellation". - REASON_FOR_CANCELLATION = 4 - - # "Unsatisfied" or "Satisfied" depending on the customer's feelings at - # the end of the conversation. - # Section name: "customer_satisfaction". - CUSTOMER_SATISFACTION = 5 - - # Key entities extracted from the conversation, such as ticket number, - # order number, dollar amount, etc. - # Section names are prefixed by "entities/". - ENTITIES = 6 - end - end - end - - # Custom conversation models used in agent assist feature. - # - # Supported feature: ARTICLE_SUGGESTION, SMART_COMPOSE, SMART_REPLY, - # CONVERSATION_SUMMARIZATION - # @!attribute [rw] model - # @return [::String] - # Conversation model resource name. Format: `projects//conversationModels/`. - # @!attribute [rw] baseline_model_version - # @return [::String] - # Version of current baseline model. It will be ignored if - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::ConversationModelConfig#model model} - # is set. Valid versions are: - # - # - Article Suggestion baseline model: - # - 0.9 - # - 1.0 (default) - # - Summarization baseline model: - # - 1.0 - class ConversationModelConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Config to process conversation. - # @!attribute [rw] recent_sentences_count - # @return [::Integer] - # Number of recent non-small-talk sentences to use as context for article - # and FAQ suggestion - class ConversationProcessConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for analyses to run on each conversation message. - # @!attribute [rw] enable_entity_extraction - # @return [::Boolean] - # Enable entity extraction in conversation messages on [agent assist - # stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). - # If unspecified, defaults to false. - # - # Currently, this feature is not general available, please contact Google - # to get access. - # @!attribute [rw] enable_sentiment_analysis - # @return [::Boolean] - # Enable sentiment analysis in conversation messages on [agent assist - # stage](https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages). - # If unspecified, defaults to false. Sentiment analysis inspects user input - # and identifies the prevailing subjective opinion, especially to determine - # a user's attitude as positive, negative, or neutral: - # https://cloud.google.com/natural-language/docs/basics#sentiment_analysis - # For - # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} - # method, result will be in - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#message StreamingAnalyzeContentResponse.message.SentimentAnalysisResult}. - # For - # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} - # method, result will be in - # {::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse#message AnalyzeContentResponse.message.SentimentAnalysisResult} - # For - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages} - # method, result will be in - # {::Google::Cloud::Dialogflow::V2::ListMessagesResponse#messages ListMessagesResponse.messages.SentimentAnalysisResult} - # If Pub/Sub notification is configured, result will be in - # {::Google::Cloud::Dialogflow::V2::ConversationEvent#new_message_payload ConversationEvent.new_message_payload.SentimentAnalysisResult}. - # @!attribute [rw] enable_sentiment_analysis_v3 - # @return [::Boolean] - # Optional. Enables sentiment analysis for audio input and conversation - # messages. If unspecified, defaults to false. If this flag is set to true, - # other 'enable_sentiment_analysis' fields will be ignored. - # - # Sentiment analysis inspects user input and identifies the prevailing - # subjective opinion, especially to determine a user's attitude as - # positive, negative, or neutral. - # https://cloud.google.com/natural-language/docs/basics#sentiment_analysis - # For - # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} - # method, result will be in - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#message StreamingAnalyzeContentResponse.message.SentimentAnalysisResult}. - # For - # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} - # method, result will be in - # {::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse#message AnalyzeContentResponse.message.SentimentAnalysisResult} - # For - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages} - # method, result will be in - # {::Google::Cloud::Dialogflow::V2::ListMessagesResponse#messages ListMessagesResponse.messages.SentimentAnalysisResult} - # If Pub/Sub notification is configured, result will be in - # {::Google::Cloud::Dialogflow::V2::ConversationEvent#new_message_payload ConversationEvent.new_message_payload.SentimentAnalysisResult}. - class MessageAnalysisConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Defines the hand off to a live agent, typically on which external agent - # service provider to connect to a conversation. - # - # Currently, this feature is not general available, please contact Google - # to get access. - # @!attribute [rw] live_person_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentHandoffConfig::LivePersonConfig] - # Uses [LivePerson](https://www.liveperson.com). - # - # Note: The following fields are mutually exclusive: `live_person_config`, `salesforce_live_agent_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] salesforce_live_agent_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentHandoffConfig::SalesforceLiveAgentConfig] - # Uses Salesforce Live Agent. - # - # Note: The following fields are mutually exclusive: `salesforce_live_agent_config`, `live_person_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class HumanAgentHandoffConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration specific to [LivePerson](https://www.liveperson.com). - # @!attribute [rw] account_number - # @return [::String] - # Required. Account number of the LivePerson account to connect. This is - # the account number you input at the login page. - class LivePersonConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration specific to Salesforce Live Agent. - # @!attribute [rw] organization_id - # @return [::String] - # Required. The organization ID of the Salesforce account. - # @!attribute [rw] deployment_id - # @return [::String] - # Required. Live Agent deployment ID. - # @!attribute [rw] button_id - # @return [::String] - # Required. Live Agent chat button ID. - # @!attribute [rw] endpoint_domain - # @return [::String] - # Required. Domain of the Live Agent endpoint for this agent. You can find - # the endpoint URL in the `Live Agent settings` page. For example if URL - # has the form https://d.la4-c2-phx.salesforceliveagent.com/..., - # you should fill in d.la4-c2-phx.salesforceliveagent.com. - class SalesforceLiveAgentConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Defines notification behavior. - # @!attribute [rw] topic - # @return [::String] - # Name of the Pub/Sub topic to publish conversation - # events like - # {::Google::Cloud::Dialogflow::V2::ConversationEvent::Type::CONVERSATION_STARTED CONVERSATION_STARTED} - # as serialized - # {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent} protos. - # - # For telephony integration to receive notification, make sure either this - # topic is in the same project as the conversation or you grant - # `service-@gcp-sa-dialogflow.iam.gserviceaccount.com` the `Dialogflow Service - # Agent` role in the topic project. - # - # For chat integration to receive notification, make sure API caller has been - # granted the `Dialogflow Service Agent` role for the topic. - # - # Format: `projects//locations//topics/`. - # @!attribute [rw] message_format - # @return [::Google::Cloud::Dialogflow::V2::NotificationConfig::MessageFormat] - # Format of message. - class NotificationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Format of cloud pub/sub message. - module MessageFormat - # If it is unspecified, PROTO will be used. - MESSAGE_FORMAT_UNSPECIFIED = 0 - - # Pub/Sub message will be serialized proto. - PROTO = 1 - - # Pub/Sub message will be json. - JSON = 2 - end - end - - # Defines logging behavior for conversation lifecycle events. - # @!attribute [rw] enable_stackdriver_logging - # @return [::Boolean] - # Whether to log conversation events like - # {::Google::Cloud::Dialogflow::V2::ConversationEvent::Type::CONVERSATION_STARTED CONVERSATION_STARTED} - # to Stackdriver in the conversation project as JSON format - # {::Google::Cloud::Dialogflow::V2::ConversationEvent ConversationEvent} protos. - class LoggingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines the SIP configuration. - # @!attribute [rw] create_conversation_on_the_fly - # @return [::Boolean] - # Asks Dialogflow Telephony to create the conversation provided in the SIP - # header on the fly when the call comes in. - # @!attribute [rw] inactive_start - # @return [::Boolean] - # Starts the conversation with inactive SDP directives - # @!attribute [rw] max_audio_recording_duration - # @return [::Google::Protobuf::Duration] - # Max duration for audio recording. - # Overrides the default value of 15 min. - # Max value is 8 hours. - # @!attribute [rw] allow_virtual_agent_interaction - # @return [::Boolean] - # Allows interactions with a Dialogflow virtual agent even if the call is - # connected for SIPREC purposes. - # @!attribute [rw] keep_conversation_running - # @return [::Boolean] - # Keeps the conversation running even if the call is disconnected. - # @!attribute [rw] copy_inbound_call_leg_headers - # @return [::Array<::String>] - # List of inbound call leg headers to be copied to outbound call legs created - # later. - # @!attribute [rw] ignore_reinvite_media_direction - # @return [::Boolean] - # Ignores any media direction in the reINVITE SDP offer. Reuse the previous - # media direction. - class SipConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of Human Agent Assistant API suggestion to perform, and the maximum - # number of results to return for that type. Multiple `Feature` objects can - # be specified in the `features` list. - # @!attribute [rw] type - # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] - # Type of Human Agent Assistant API feature to request. - class SuggestionFeature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines the type of Human Agent Assistant feature. - module Type - # Unspecified feature type. - TYPE_UNSPECIFIED = 0 - - # Run article suggestion model for chat. - ARTICLE_SUGGESTION = 1 - - # Run FAQ model for chat. - FAQ = 2 - - # Run smart reply model for chat. - SMART_REPLY = 3 - - # Run conversation summarization model for chat. - CONVERSATION_SUMMARIZATION = 8 - - # Run knowledge search with text input from agent or text generated query. - KNOWLEDGE_SEARCH = 14 - - # Run knowledge assist with automatic query generation. - KNOWLEDGE_ASSIST = 15 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config ConversationProfiles.SetSuggestionFeatureConfig}. - # @!attribute [rw] conversation_profile - # @return [::String] - # Required. The Conversation Profile to add or update the suggestion feature - # config. Format: `projects//locations//conversationProfiles/`. - # @!attribute [rw] participant_role - # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Required. The participant role to add or update the suggestion feature - # config. Only HUMAN_AGENT or END_USER can be used. - # @!attribute [rw] suggestion_feature_config - # @return [::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig] - # Required. The suggestion feature config to add or update. - class SetSuggestionFeatureConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config ConversationProfiles.ClearSuggestionFeatureConfig}. - # @!attribute [rw] conversation_profile - # @return [::String] - # Required. The Conversation Profile to add or update the suggestion feature - # config. Format: `projects//locations//conversationProfiles/`. - # @!attribute [rw] participant_role - # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Required. The participant role to remove the suggestion feature - # config. Only HUMAN_AGENT or END_USER can be used. - # @!attribute [rw] suggestion_feature_type - # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] - # Required. The type of the suggestion feature to remove. - class ClearSuggestionFeatureConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for a - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config ConversationProfiles.SetSuggestionFeatureConfig} - # operation. - # @!attribute [rw] conversation_profile - # @return [::String] - # The resource name of the conversation profile. Format: - # `projects//locations//conversationProfiles/` - # @!attribute [rw] participant_role - # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Required. The participant role to add or update the suggestion feature - # config. Only HUMAN_AGENT or END_USER can be used. - # @!attribute [rw] suggestion_feature_type - # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] - # Required. The type of the suggestion feature to add or update. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp whe the request was created. The time is measured on server side. - class SetSuggestionFeatureConfigOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for a - # {::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config ConversationProfiles.ClearSuggestionFeatureConfig} - # operation. - # @!attribute [rw] conversation_profile - # @return [::String] - # The resource name of the conversation profile. Format: - # `projects//locations//conversationProfiles/` - # @!attribute [rw] participant_role - # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Required. The participant role to remove the suggestion feature - # config. Only HUMAN_AGENT or END_USER can be used. - # @!attribute [rw] suggestion_feature_type - # @return [::Google::Cloud::Dialogflow::V2::SuggestionFeature::Type] - # Required. The type of the suggestion feature to remove. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp whe the request was created. The time is measured on server side. - class ClearSuggestionFeatureConfigOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/document.rb deleted file mode 100644 index 7221bf0ccc7e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/document.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! - - -module Google - module Cloud - module Dialogflow - module V2 - # A knowledge document to be used by a - # {::Google::Cloud::Dialogflow::V2::KnowledgeBase KnowledgeBase}. - # - # For more information, see the [knowledge base - # guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). - # - # Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - # only use `projects.knowledgeBases.documents`. - # @!attribute [rw] name - # @return [::String] - # Optional. The document resource name. - # The name must be empty when creating a document. - # Format: `projects//locations//knowledgeBases//documents/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The display name of the document. The name must be 1024 bytes or - # less; otherwise, the creation request fails. - # @!attribute [rw] mime_type - # @return [::String] - # Required. The MIME type of this document. - # @!attribute [rw] knowledge_types - # @return [::Array<::Google::Cloud::Dialogflow::V2::Document::KnowledgeType>] - # Required. The knowledge type of document content. - # @!attribute [rw] content_uri - # @return [::String] - # The URI where the file content is located. - # - # For documents stored in Google Cloud Storage, these URIs must have - # the form `gs:///`. - # - # NOTE: External URLs must correspond to public webpages, i.e., they must - # be indexed by Google Search. In particular, URLs for showing documents in - # Google Cloud Storage (i.e. the URL in your browser) are not supported. - # Instead use the `gs://` format URI described above. - # - # Note: The following fields are mutually exclusive: `content_uri`, `raw_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] raw_content - # @return [::String] - # The raw content of the document. This field is only permitted for - # EXTRACTIVE_QA and FAQ knowledge types. - # - # Note: The following fields are mutually exclusive: `raw_content`, `content_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] enable_auto_reload - # @return [::Boolean] - # Optional. If true, we try to automatically reload the document every day - # (at a time picked by the system). If false or unspecified, we don't try - # to automatically reload the document. - # - # Currently you can only enable automatic reload for documents sourced from - # a public url, see `source` field for the source types. - # - # Reload status can be tracked in `latest_reload_status`. If a reload - # fails, we will keep the document unchanged. - # - # If a reload fails with internal errors, the system will try to reload the - # document on the next day. - # If a reload fails with non-retriable errors (e.g. PERMISSION_DENIED), the - # system will not try to reload the document anymore. You need to manually - # reload the document successfully by calling `ReloadDocument` and clear the - # errors. - # @!attribute [r] latest_reload_status - # @return [::Google::Cloud::Dialogflow::V2::Document::ReloadStatus] - # Output only. The time and status of the latest reload. - # This reload may have been triggered automatically or manually - # and may not have succeeded. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Metadata for the document. The metadata supports arbitrary - # key-value pairs. Suggested use cases include storing a document's title, - # an external URL distinct from the document's content_uri, etc. - # The max size of a `key` or a `value` of the metadata is 1024 bytes. - # @!attribute [r] state - # @return [::Google::Cloud::Dialogflow::V2::Document::State] - # Output only. The current state of the document. - class Document - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of a reload attempt. - # @!attribute [rw] time - # @return [::Google::Protobuf::Timestamp] - # The time of a reload attempt. - # This reload may have been triggered automatically or manually and may - # not have succeeded. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # The status of a reload attempt or the initial load. - class ReloadStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The knowledge type of document content. - module KnowledgeType - # The type is unspecified or arbitrary. - KNOWLEDGE_TYPE_UNSPECIFIED = 0 - - # The document content contains question and answer pairs as either HTML or - # CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats - # may fail to be parsed. - # - # CSV must have questions in the first column and answers in the second, - # with no header. Because of this explicit format, they are always parsed - # accurately. - FAQ = 1 - - # Documents for which unstructured text is extracted and used for - # question answering. - EXTRACTIVE_QA = 2 - - # The entire document content as a whole can be used for query results. - # Only for Contact Center Solutions on Dialogflow. - ARTICLE_SUGGESTION = 3 - - # The document contains agent-facing Smart Reply entries. - AGENT_FACING_SMART_REPLY = 4 - end - - # Possible states of the document - module State - # The document state is unspecified. - STATE_UNSPECIFIED = 0 - - # The document creation is in progress. - CREATING = 1 - - # The document is active and ready to use. - ACTIVE = 2 - - # The document updation is in progress. - UPDATING = 3 - - # The document is reloading. - RELOADING = 4 - - # The document deletion is in progress. - DELETING = 5 - end - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#get_document Documents.GetDocument}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the document to retrieve. - # Format `projects//locations//knowledgeBases//documents/`. - class GetDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#list_documents Documents.ListDocuments}. - # @!attribute [rw] parent - # @return [::String] - # Required. The knowledge base to list all documents for. - # Format: `projects//locations//knowledgeBases/`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return in a single page. By - # default 10 and at most 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous list request. - # @!attribute [rw] filter - # @return [::String] - # The filter expression used to filter documents returned by the list method. - # The expression has the following syntax: - # - # [AND ] ... - # - # The following fields and operators are supported: - # - # * knowledge_types with has(:) operator - # * display_name with has(:) operator - # * state with equals(=) operator - # - # Examples: - # - # * "knowledge_types:FAQ" matches documents with FAQ knowledge type. - # * "display_name:customer" matches documents whose display name contains - # "customer". - # * "state=ACTIVE" matches documents with ACTIVE state. - # * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - class ListDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#list_documents Documents.ListDocuments}. - # @!attribute [rw] documents - # @return [::Array<::Google::Cloud::Dialogflow::V2::Document>] - # The list of documents. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#create_document Documents.CreateDocument}. - # @!attribute [rw] parent - # @return [::String] - # Required. The knowledge base to create a document for. - # Format: `projects//locations//knowledgeBases/`. - # @!attribute [rw] document - # @return [::Google::Cloud::Dialogflow::V2::Document] - # Required. The document to create. - class CreateDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#import_documents Documents.ImportDocuments}. - # @!attribute [rw] parent - # @return [::String] - # Required. The knowledge base to import documents into. - # Format: `projects//locations//knowledgeBases/`. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Dialogflow::V2::GcsSources] - # Optional. The Google Cloud Storage location for the documents. - # The path can include a wildcard. - # - # These URIs may have the forms - # `gs:///`. - # `gs:////*.`. - # @!attribute [rw] document_template - # @return [::Google::Cloud::Dialogflow::V2::ImportDocumentTemplate] - # Required. Document template used for importing all the documents. - # @!attribute [rw] import_gcs_custom_metadata - # @return [::Boolean] - # Whether to import custom metadata from Google Cloud Storage. - # Only valid when the document source is Google Cloud Storage URI. - class ImportDocumentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The template used for importing documents. - # @!attribute [rw] mime_type - # @return [::String] - # Required. The MIME type of the document. - # @!attribute [rw] knowledge_types - # @return [::Array<::Google::Cloud::Dialogflow::V2::Document::KnowledgeType>] - # Required. The knowledge type of document content. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Metadata for the document. The metadata supports arbitrary - # key-value pairs. Suggested use cases include storing a document's title, - # an external URL distinct from the document's content_uri, etc. - # The max size of a `key` or a `value` of the metadata is 1024 bytes. - class ImportDocumentTemplate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#import_documents Documents.ImportDocuments}. - # @!attribute [rw] warnings - # @return [::Array<::Google::Rpc::Status>] - # Includes details about skipped documents or any other warnings. - class ImportDocumentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#delete_document Documents.DeleteDocument}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the document to delete. - # Format: `projects//locations//knowledgeBases//documents/`. - class DeleteDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#update_document Documents.UpdateDocument}. - # @!attribute [rw] document - # @return [::Google::Cloud::Dialogflow::V2::Document] - # Required. The document to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Not specified means `update all`. - # Currently, only `display_name` can be updated, an InvalidArgument will be - # returned for attempting to update other fields. - class UpdateDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#reload_document Documents.ReloadDocument}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the document to reload. - # Format: `projects//locations//knowledgeBases//documents/` - # @!attribute [rw] content_uri - # @return [::String] - # Optional. The path of gcs source file for reloading document content. For - # now, only gcs uri is supported. - # - # For documents stored in Google Cloud Storage, these URIs must have - # the form `gs:///`. - # @!attribute [rw] import_gcs_custom_metadata - # @return [::Boolean] - # Optional. Whether to import custom metadata from Google Cloud Storage. - # Only valid when the document source is Google Cloud Storage URI. - # @!attribute [rw] smart_messaging_partial_update - # @return [::Boolean] - # Optional. When enabled, the reload request is to apply partial update to - # the smart messaging allowlist. - class ReloadDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::Documents::Client#export_document Documents.ExportDocument}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the document to export. - # Format: `projects//locations//knowledgeBases//documents/`. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Dialogflow::V2::GcsDestination] - # Cloud Storage file path to export the document. - # @!attribute [rw] export_full_content - # @return [::Boolean] - # When enabled, export the full content of the document including empirical - # probability. - # @!attribute [rw] smart_messaging_partial_update - # @return [::Boolean] - # When enabled, export the smart messaging allowlist document for partial - # update. - class ExportDocumentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata related to the Export Data Operations (e.g. ExportDocument). - # @!attribute [rw] exported_gcs_destination - # @return [::Google::Cloud::Dialogflow::V2::GcsDestination] - # Cloud Storage file path of the exported data. - class ExportOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata in google::longrunning::Operation for Knowledge operations. - # @!attribute [r] state - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeOperationMetadata::State] - # Output only. The current state of this operation. - # @!attribute [rw] knowledge_base - # @return [::String] - # The name of the knowledge base interacted with during the operation. - # @!attribute [rw] export_operation_metadata - # @return [::Google::Cloud::Dialogflow::V2::ExportOperationMetadata] - # Metadata for the Export Data Operation such as the destination of export. - # @!attribute [rw] done_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation finished. - class KnowledgeOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # States of the operation. - module State - # State unspecified. - STATE_UNSPECIFIED = 0 - - # The operation has been created. - PENDING = 1 - - # The operation is currently running. - RUNNING = 2 - - # The operation is done, either cancelled or completed. - DONE = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/encryption_spec.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/encryption_spec.rb deleted file mode 100644 index 36bb0b039413..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/encryption_spec.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 Dialogflow - module V2 - # The request to get location-level encryption specification. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the encryption spec resource to get. - class GetEncryptionSpecRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A customer-managed encryption key specification that can be applied to all - # created resources (e.g. Conversation). - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name of the encryption key specification resource. - # Format: - # projects/\\{project}/locations/\\{location}/encryptionSpec - # @!attribute [rw] kms_key - # @return [::String] - # Required. The name of customer-managed encryption key that is used to - # secure a resource and its sub-resources. If empty, the resource is secured - # by the default Google encryption key. Only the key in the same location as - # this resource is allowed to be used for encryption. Format: - # `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` - class EncryptionSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request to initialize a location-level encryption specification. - # @!attribute [rw] encryption_spec - # @return [::Google::Cloud::Dialogflow::V2::EncryptionSpec] - # Required. The encryption spec used for CMEK encryption. It is required that - # the kms key is in the same region as the endpoint. The same key will be - # used for all provisioned resources, if encryption is available. If the - # kms_key_name is left empty, no encryption will be enforced. - class InitializeEncryptionSpecRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response to initialize a location-level encryption specification. - class InitializeEncryptionSpecResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for initializing a location-level encryption specification. - # @!attribute [r] request - # @return [::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest] - # Output only. The original request for initialization. - class InitializeEncryptionSpecMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/entity_type.rb deleted file mode 100644 index 54d6bdf8d324..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/entity_type.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! - - -module Google - module Cloud - module Dialogflow - module V2 - # Each intent parameter has a type, called the entity type, which dictates - # exactly how data from an end-user expression is extracted. - # - # Dialogflow provides predefined system entities that can match many common - # types of data. For example, there are system entities for matching dates, - # times, colors, email addresses, and so on. You can also create your own - # custom entities for matching custom data. For example, you could define a - # vegetable entity that can match the types of vegetables available for - # purchase with a grocery store agent. - # - # For more information, see the - # [Entity guide](https://cloud.google.com/dialogflow/docs/entities-overview). - # @!attribute [rw] name - # @return [::String] - # The unique identifier of the entity type. - # Required for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#update_entity_type EntityTypes.UpdateEntityType} - # and - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types EntityTypes.BatchUpdateEntityTypes} - # methods. Format: `projects//agent/entityTypes/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The name of the entity type. - # @!attribute [rw] kind - # @return [::Google::Cloud::Dialogflow::V2::EntityType::Kind] - # Required. Indicates the kind of entity type. - # @!attribute [rw] auto_expansion_mode - # @return [::Google::Cloud::Dialogflow::V2::EntityType::AutoExpansionMode] - # Optional. Indicates whether the entity type can be automatically - # expanded. - # @!attribute [rw] entities - # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity>] - # Optional. The collection of entity entries associated with the entity type. - # @!attribute [rw] enable_fuzzy_extraction - # @return [::Boolean] - # Optional. Enables fuzzy entity extraction during classification. - class EntityType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An **entity entry** for an associated entity type. - # @!attribute [rw] value - # @return [::String] - # Required. The primary value associated with this entity entry. - # For example, if the entity type is *vegetable*, the value could be - # *scallions*. - # - # For `KIND_MAP` entity types: - # - # * A reference value to be used in place of synonyms. - # - # For `KIND_LIST` entity types: - # - # * A string that can contain references to other entity types (with or - # without aliases). - # @!attribute [rw] synonyms - # @return [::Array<::String>] - # Required. A collection of value synonyms. For example, if the entity type - # is *vegetable*, and `value` is *scallions*, a synonym could be *green - # onions*. - # - # For `KIND_LIST` entity types: - # - # * This collection must contain exactly one synonym equal to `value`. - class Entity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents kinds of entities. - module Kind - # Not specified. This value should be never used. - KIND_UNSPECIFIED = 0 - - # Map entity types allow mapping of a group of synonyms to a reference - # value. - KIND_MAP = 1 - - # List entity types contain a set of entries that do not map to reference - # values. However, list entity types can contain references to other entity - # types (with or without aliases). - KIND_LIST = 2 - - # Regexp entity types allow to specify regular expressions in entries - # values. - KIND_REGEXP = 3 - end - - # Represents different entity type expansion modes. Automated expansion - # allows an agent to recognize values that have not been explicitly listed in - # the entity (for example, new kinds of shopping list items). - module AutoExpansionMode - # Auto expansion disabled for the entity. - AUTO_EXPANSION_MODE_UNSPECIFIED = 0 - - # Allows an agent to recognize values that have not been explicitly - # listed in the entity. - AUTO_EXPANSION_MODE_DEFAULT = 1 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#list_entity_types EntityTypes.ListEntityTypes}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to list all entity types from. - # Format: `projects//agent`. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListEntityTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#list_entity_types EntityTypes.ListEntityTypes}. - # @!attribute [rw] entity_types - # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType>] - # The list of agent entity types. There will be a maximum number of items - # returned based on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListEntityTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#get_entity_type EntityTypes.GetEntityType}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the entity type. - # Format: `projects//agent/entityTypes/`. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - class GetEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#create_entity_type EntityTypes.CreateEntityType}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create a entity type for. - # Format: `projects//agent`. - # @!attribute [rw] entity_type - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # Required. The entity type to create. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - class CreateEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#update_entity_type EntityTypes.UpdateEntityType}. - # @!attribute [rw] entity_type - # @return [::Google::Cloud::Dialogflow::V2::EntityType] - # Required. The entity type to update. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields get updated. - class UpdateEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#delete_entity_type EntityTypes.DeleteEntityType}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the entity type to delete. - # Format: `projects//agent/entityTypes/`. - class DeleteEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types EntityTypes.BatchUpdateEntityTypes}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the agent to update or create entity types in. - # Format: `projects//agent`. - # @!attribute [rw] entity_type_batch_uri - # @return [::String] - # The URI to a Google Cloud Storage file containing entity types to update - # or create. The file format can either be a serialized proto (of - # EntityBatch type) or a JSON object. Note: The URI must start with - # "gs://". - # - # Note: The following fields are mutually exclusive: `entity_type_batch_uri`, `entity_type_batch_inline`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] entity_type_batch_inline - # @return [::Google::Cloud::Dialogflow::V2::EntityTypeBatch] - # The collection of entity types to update or create. - # - # Note: The following fields are mutually exclusive: `entity_type_batch_inline`, `entity_type_batch_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields get updated. - class BatchUpdateEntityTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types EntityTypes.BatchUpdateEntityTypes}. - # @!attribute [rw] entity_types - # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType>] - # The collection of updated or created entity types. - class BatchUpdateEntityTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entity_types EntityTypes.BatchDeleteEntityTypes}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the agent to delete all entities types for. Format: - # `projects//agent`. - # @!attribute [rw] entity_type_names - # @return [::Array<::String>] - # Required. The names entity types to delete. All names must point to the - # same agent as `parent`. - class BatchDeleteEntityTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_create_entities EntityTypes.BatchCreateEntities}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the entity type to create entities in. Format: - # `projects//agent/entityTypes/`. - # @!attribute [rw] entities - # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity>] - # Required. The entities to create. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - class BatchCreateEntitiesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entities EntityTypes.BatchUpdateEntities}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the entity type to update or create entities in. - # Format: `projects//agent/entityTypes/`. - # @!attribute [rw] entities - # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity>] - # Required. The entities to update or create. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields get updated. - class BatchUpdateEntitiesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entities EntityTypes.BatchDeleteEntities}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the entity type to delete entries for. Format: - # `projects//agent/entityTypes/`. - # @!attribute [rw] entity_values - # @return [::Array<::String>] - # Required. The reference `values` of the entities to delete. Note that - # these are not fully-qualified names, i.e. they don't start with - # `projects/`. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - class BatchDeleteEntitiesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message is a wrapper around a collection of entity types. - # @!attribute [rw] entity_types - # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType>] - # A collection of entity types. - class EntityTypeBatch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/environment.rb deleted file mode 100644 index 42133bbd059d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/environment.rb +++ /dev/null @@ -1,311 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # You can create multiple versions of your agent and publish them to separate - # environments. - # - # When you edit an agent, you are editing the draft agent. At any point, you - # can save the draft agent as an agent version, which is an immutable snapshot - # of your agent. - # - # When you save the draft agent, it is published to the default environment. - # When you create agent versions, you can publish them to custom environments. - # You can create a variety of custom environments for: - # - # - testing - # - development - # - production - # - etc. - # - # For more information, see the [versions and environments - # guide](https://cloud.google.com/dialogflow/docs/agents-versions). - # @!attribute [r] name - # @return [::String] - # Output only. The unique identifier of this agent environment. - # Supported formats: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - # @!attribute [rw] description - # @return [::String] - # Optional. The developer-provided description for this environment. - # The maximum length is 500 characters. If exceeded, the request is rejected. - # @!attribute [rw] agent_version - # @return [::String] - # Optional. The agent version loaded into this environment. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - # @!attribute [r] state - # @return [::Google::Cloud::Dialogflow::V2::Environment::State] - # Output only. The state of this environment. This field is read-only, i.e., - # it cannot be set by create and update methods. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last update time of this environment. This field is - # read-only, i.e., it cannot be set by create and update methods. - # @!attribute [rw] text_to_speech_settings - # @return [::Google::Cloud::Dialogflow::V2::TextToSpeechSettings] - # Optional. Text to speech settings for this environment. - # @!attribute [rw] fulfillment - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] - # Optional. The fulfillment settings to use for this environment. - class Environment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents an environment state. When an environment is pointed to a new - # agent version, the environment is temporarily set to the `LOADING` state. - # During that time, the environment keeps on serving the previous version of - # the agent. After the new agent version is done loading, the environment is - # set back to the `RUNNING` state. - module State - # Not specified. This value is not used. - STATE_UNSPECIFIED = 0 - - # Stopped. - STOPPED = 1 - - # Loading. - LOADING = 2 - - # Running. - RUNNING = 3 - end - end - - # Instructs the speech synthesizer on how to generate the output audio content. - # @!attribute [rw] enable_text_to_speech - # @return [::Boolean] - # Optional. Indicates whether text to speech is enabled. Even when this field - # is false, other settings in this proto are still retained. - # @!attribute [rw] output_audio_encoding - # @return [::Google::Cloud::Dialogflow::V2::OutputAudioEncoding] - # Required. Audio encoding of the synthesized audio content. - # @!attribute [rw] sample_rate_hertz - # @return [::Integer] - # Optional. The synthesis sample rate (in hertz) for this audio. If not - # provided, then the synthesizer will use the default sample rate based on - # the audio encoding. If this is different from the voice's natural sample - # rate, then the synthesizer will honor this request by converting to the - # desired sample rate (which might result in worse audio quality). - # @!attribute [rw] synthesize_speech_configs - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig}] - # Optional. Configuration of how speech should be synthesized, mapping from - # language (https://cloud.google.com/dialogflow/docs/reference/language) to - # SynthesizeSpeechConfig. - class TextToSpeechSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::V2::SynthesizeSpeechConfig] - class SynthesizeSpeechConfigsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Environments::Client#list_environments Environments.ListEnvironments}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to list all environments from. - # Format: - # - # - `projects//agent` - # - `projects//locations//agent` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListEnvironmentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Environments::Client#list_environments Environments.ListEnvironments}. - # @!attribute [rw] environments - # @return [::Array<::Google::Cloud::Dialogflow::V2::Environment>] - # The list of agent environments. There will be a maximum number of items - # returned based on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListEnvironmentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment Environments.GetEnvironment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the environment. - # Supported formats: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - class GetEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Environments::Client#create_environment Environments.CreateEnvironment}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create an environment for. - # Supported formats: - # - # - `projects//agent` - # - `projects//locations//agent` - # @!attribute [rw] environment - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # Required. The environment to create. - # @!attribute [rw] environment_id - # @return [::String] - # Required. The unique id of the new environment. - class CreateEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Environments::Client#update_environment Environments.UpdateEnvironment}. - # @!attribute [rw] environment - # @return [::Google::Cloud::Dialogflow::V2::Environment] - # Required. The environment to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to control which fields get updated. - # @!attribute [rw] allow_load_to_draft_and_discard_changes - # @return [::Boolean] - # Optional. This field is used to prevent accidental overwrite of the default - # environment, which is an operation that cannot be undone. To confirm that - # the caller desires this overwrite, this field must be explicitly set to - # true when updating the default environment (environment ID = `-`). - class UpdateEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Environments::Client#delete_environment Environments.DeleteEnvironment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the environment to delete. - # / Format: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - class DeleteEnvironmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment_history Environments.GetEnvironmentHistory}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the environment to retrieve history for. - # Supported formats: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class GetEnvironmentHistoryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment_history Environments.GetEnvironmentHistory}. - # @!attribute [r] parent - # @return [::String] - # Output only. The name of the environment this history is for. - # Supported formats: - # - # - `projects//agent/environments/` - # - `projects//locations//agent/environments/` - # - # The environment ID for the default environment is `-`. - # @!attribute [r] entries - # @return [::Array<::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry>] - # Output only. The list of agent environments. There will be a maximum number - # of items returned based on the page_size field in the request. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. Token to retrieve the next page of results, or empty if there - # are no more results in the list. - class EnvironmentHistory - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents an environment history entry. - # @!attribute [rw] agent_version - # @return [::String] - # The agent version loaded into this environment history entry. - # @!attribute [rw] description - # @return [::String] - # The developer-provided description for this environment history entry. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The creation time of this environment history entry. - class Entry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb deleted file mode 100644 index 7dcce6bd1fac..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/fulfillment.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 Dialogflow - module V2 - # By default, your agent responds to a matched intent with a static response. - # As an alternative, you can provide a more dynamic response by using - # fulfillment. When you enable fulfillment for an intent, Dialogflow responds - # to that intent by calling a service that you define. For example, if an - # end-user wants to schedule a haircut on Friday, your service can check your - # database and respond to the end-user with availability information for - # Friday. - # - # For more information, see the [fulfillment - # guide](https://cloud.google.com/dialogflow/docs/fulfillment-overview). - # @!attribute [rw] name - # @return [::String] - # Required. The unique identifier of the fulfillment. - # Supported formats: - # - # - `projects//agent/fulfillment` - # - `projects//locations//agent/fulfillment` - # - # This field is not used for Fulfillment in an Environment. - # @!attribute [rw] display_name - # @return [::String] - # Optional. The human-readable name of the fulfillment, unique within the - # agent. - # - # This field is not used for Fulfillment in an Environment. - # @!attribute [rw] generic_web_service - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment::GenericWebService] - # Configuration for a generic web service. - # @!attribute [rw] enabled - # @return [::Boolean] - # Optional. Whether fulfillment is enabled. - # @!attribute [rw] features - # @return [::Array<::Google::Cloud::Dialogflow::V2::Fulfillment::Feature>] - # Optional. The field defines whether the fulfillment is enabled for certain - # features. - class Fulfillment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents configuration for a generic web service. - # Dialogflow supports two mechanisms for authentications: - # - # - Basic authentication with username and password. - # - Authentication with additional authentication headers. - # - # More information could be found at: - # https://cloud.google.com/dialogflow/docs/fulfillment-configure. - # @!attribute [rw] uri - # @return [::String] - # Required. The fulfillment URI for receiving POST requests. - # It must use https protocol. - # @!attribute [rw] username - # @return [::String] - # Optional. The user name for HTTP Basic authentication. - # @!attribute [rw] password - # @return [::String] - # Optional. The password for HTTP Basic authentication. - # @!attribute [rw] request_headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The HTTP request headers to send together with fulfillment - # requests. - # @!attribute [rw] is_cloud_function - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. Indicates if generic web service is created through Cloud - # Functions integration. Defaults to false. - # - # is_cloud_function is deprecated. Cloud functions can be configured by - # its uri as a regular web service now. - class GenericWebService - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RequestHeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Whether fulfillment is enabled for the specific feature. - # @!attribute [rw] type - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment::Feature::Type] - # The type of the feature that enabled for fulfillment. - class Feature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of the feature. - module Type - # Feature type not specified. - TYPE_UNSPECIFIED = 0 - - # Fulfillment is enabled for SmallTalk. - SMALLTALK = 1 - end - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Fulfillments::Client#get_fulfillment Fulfillments.GetFulfillment}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the fulfillment. - # Format: `projects//agent/fulfillment`. - class GetFulfillmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Fulfillments::Client#update_fulfillment Fulfillments.UpdateFulfillment}. - # @!attribute [rw] fulfillment - # @return [::Google::Cloud::Dialogflow::V2::Fulfillment] - # Required. The fulfillment to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to control which fields get updated. If the mask is not - # present, all fields will be updated. - class UpdateFulfillmentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/gcs.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/gcs.rb deleted file mode 100644 index e1029b9b2023..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/gcs.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! - - -module Google - module Cloud - module Dialogflow - module V2 - # Google Cloud Storage location for the inputs. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Required. Google Cloud Storage URIs for the inputs. A URI is of the form: - # `gs://bucket/object-prefix-or-name` - # Whether a prefix or name is used depends on the use case. - class GcsSources - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Google Cloud Storage location for the output. - # @!attribute [rw] uri - # @return [::String] - # The Google Cloud Storage URIs for the output. A URI is of the - # form: - # `gs://bucket/object-prefix-or-name` - # Whether a prefix or name is used depends on the use case. The requesting - # user must have "write-permission" to the bucket. - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator.rb deleted file mode 100644 index 133a538f5be0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator.rb +++ /dev/null @@ -1,659 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Request message of CreateGenerator. - # @!attribute [rw] parent - # @return [::String] - # Required. The project/location to create generator for. Format: - # `projects//locations/` - # @!attribute [rw] generator - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # Required. The generator to create. - # @!attribute [rw] generator_id - # @return [::String] - # Optional. The ID to use for the generator, which will become the final - # component of the generator's resource name. - # - # The generator ID must be compliant with the regression formula - # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - # If the field is not provided, an Id will be auto-generated. - # If the field is provided, the caller is responsible for - # 1. the uniqueness of the ID, otherwise the request will be rejected. - # 2. the consistency for whether to use custom ID or not under a project to - # better ensure uniqueness. - class CreateGeneratorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message of GetGenerator. - # @!attribute [rw] name - # @return [::String] - # Required. The generator resource name to retrieve. Format: - # `projects//locations//generators/` - class GetGeneratorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message of ListGenerators. - # @!attribute [rw] parent - # @return [::String] - # Required. The project/location to list generators for. Format: - # `projects//locations/` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of conversation models to return in a single page. - # Default to 10. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListGeneratorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of ListGenerators. - # @!attribute [rw] generators - # @return [::Array<::Google::Cloud::Dialogflow::V2::Generator>] - # List of generators retrieved. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListGeneratorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request of DeleteGenerator. - # @!attribute [rw] name - # @return [::String] - # Required. The generator resource name to delete. Format: - # `projects//locations//generators/` - class DeleteGeneratorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request of UpdateGenerator. - # @!attribute [rw] generator - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # Required. The generator to update. - # The name field of generator is to identify the generator to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The list of fields to update. - class UpdateGeneratorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a message entry of a conversation. - # @!attribute [rw] role - # @return [::Google::Cloud::Dialogflow::V2::MessageEntry::Role] - # Optional. Participant role of the message. - # @!attribute [rw] text - # @return [::String] - # Optional. Transcript content of the message. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language of the text. See [Language - # Support](https://cloud.google.com/dialogflow/docs/reference/language) for a - # list of the currently supported language codes. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Create time of the message entry. - class MessageEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumeration of the roles a participant can play in a conversation. - module Role - # Participant role not set. - ROLE_UNSPECIFIED = 0 - - # Participant is a human agent. - HUMAN_AGENT = 1 - - # Participant is an automated agent, such as a Dialogflow agent. - AUTOMATED_AGENT = 2 - - # Participant is an end user that has called or chatted with - # Dialogflow services. - END_USER = 3 - end - end - - # Context of the conversation, including transcripts. - # @!attribute [rw] message_entries - # @return [::Array<::Google::Cloud::Dialogflow::V2::MessageEntry>] - # Optional. List of message transcripts in the conversation. - class ConversationContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List of summarization sections. - # @!attribute [rw] summarization_sections - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationSection>] - # Optional. Summarization sections. - class SummarizationSectionList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Providing examples in the generator (i.e. building a few-shot generator) - # helps convey the desired format of the LLM response. - # @!attribute [rw] conversation_context - # @return [::Google::Cloud::Dialogflow::V2::ConversationContext] - # Optional. Conversation transcripts. - # @!attribute [rw] extra_info - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Key is the placeholder field name in input, value is the value of - # the placeholder. E.g. instruction contains "@price", and ingested data has - # <"price", "10"> - # @!attribute [rw] summarization_section_list - # @return [::Google::Cloud::Dialogflow::V2::SummarizationSectionList] - # Summarization sections. - # @!attribute [rw] output - # @return [::Google::Cloud::Dialogflow::V2::GeneratorSuggestion] - # Required. Example output of the model. - class FewShotExample - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ExtraInfoEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The parameters of inference. - # @!attribute [rw] max_output_tokens - # @return [::Integer] - # Optional. Maximum number of the output tokens for the generator. - # @!attribute [rw] temperature - # @return [::Float] - # Optional. Controls the randomness of LLM predictions. - # Low temperature = less random. High temperature = more random. - # If unset (or 0), uses a default value of 0. - # @!attribute [rw] top_k - # @return [::Integer] - # Optional. Top-k changes how the model selects tokens for output. A top-k of - # 1 means the selected token is the most probable among all tokens in the - # model's vocabulary (also called greedy decoding), while a top-k of 3 means - # that the next token is selected from among the 3 most probable tokens - # (using temperature). For each token selection step, the top K tokens with - # the highest probabilities are sampled. Then tokens are further filtered - # based on topP with the final token selected using temperature sampling. - # Specify a lower value for less random responses and a higher value for more - # random responses. Acceptable value is [1, 40], default to 40. - # @!attribute [rw] top_p - # @return [::Float] - # Optional. Top-p changes how the model selects tokens for output. Tokens are - # selected from most K (see topK parameter) probable to least until the sum - # of their probabilities equals the top-p value. For example, if tokens A, B, - # and C have a probability of 0.3, 0.2, and 0.1 and the top-p value is 0.5, - # then the model will select either A or B as the next token (using - # temperature) and doesn't consider C. The default top-p value is 0.95. - # Specify a lower value for less random responses and a higher value for more - # random responses. Acceptable value is [0.0, 1.0], default to 0.95. - class InferenceParameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Agent Coaching context that customer can configure. - # @!attribute [rw] overarching_guidance - # @return [::String] - # Optional. The overarching guidance for the agent coaching. This should be - # set only for v1.5 and later versions. - # @!attribute [rw] instructions - # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction>] - # Optional. Customized instructions for agent coaching. - # @!attribute [rw] version - # @return [::String] - # Optional. Version of the feature. If not set, default to latest version. - # Current candidates are ["1.2"]. - # @!attribute [rw] output_language_code - # @return [::String] - # Optional. Output language code. - class AgentCoachingContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the section of summarization. - # @!attribute [rw] key - # @return [::String] - # Optional. Name of the section, for example, "situation". - # @!attribute [rw] definition - # @return [::String] - # Optional. Definition of the section, for example, "what the customer needs - # help with or has question about." - # @!attribute [rw] type - # @return [::Google::Cloud::Dialogflow::V2::SummarizationSection::Type] - # Optional. Type of the summarization section. - class SummarizationSection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type enum of the summarization sections. - module Type - # Undefined section type, does not return anything. - TYPE_UNSPECIFIED = 0 - - # What the customer needs help with or has question about. - # Section name: "situation". - SITUATION = 1 - - # What the agent does to help the customer. - # Section name: "action". - ACTION = 2 - - # Result of the customer service. A single word describing the result - # of the conversation. - # Section name: "resolution". - RESOLUTION = 3 - - # Reason for cancellation if the customer requests for a cancellation. - # "N/A" otherwise. - # Section name: "reason_for_cancellation". - REASON_FOR_CANCELLATION = 4 - - # "Unsatisfied" or "Satisfied" depending on the customer's feelings at - # the end of the conversation. - # Section name: "customer_satisfaction". - CUSTOMER_SATISFACTION = 5 - - # Key entities extracted from the conversation, such as ticket number, - # order number, dollar amount, etc. - # Section names are prefixed by "entities/". - ENTITIES = 6 - - # Customer defined sections. - CUSTOMER_DEFINED = 7 - - # Concise version of the situation section. This type is only available if - # type SITUATION is not selected. - SITUATION_CONCISE = 9 - - # Concise version of the action section. This type is only available if - # type ACTION is not selected. - ACTION_CONCISE = 10 - end - end - - # Summarization context that customer can configure. - # @!attribute [rw] summarization_sections - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationSection>] - # Optional. List of sections. Note it contains both predefined section sand - # customer defined sections. - # @!attribute [rw] few_shot_examples - # @return [::Array<::Google::Cloud::Dialogflow::V2::FewShotExample>] - # Optional. List of few shot examples. - # @!attribute [rw] version - # @return [::String] - # Optional. Version of the feature. If not set, default to latest version. - # Current candidates are ["1.0"]. - # @!attribute [rw] output_language_code - # @return [::String] - # Optional. The target language of the generated summary. The language code - # for conversation will be used if this field is empty. Supported 2.0 and - # later versions. - class SummarizationContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Free form generator context that customer can configure. - # @!attribute [rw] text - # @return [::String] - # Optional. Free form text input to LLM. - class FreeFormContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # LLM generator. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the generator. Format: - # `projects//locations//generators/` - # @!attribute [rw] description - # @return [::String] - # Optional. Human readable description of the generator. - # @!attribute [rw] free_form_context - # @return [::Google::Cloud::Dialogflow::V2::FreeFormContext] - # Input of free from generator to LLM. - # - # Note: The following fields are mutually exclusive: `free_form_context`, `agent_coaching_context`, `summarization_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] agent_coaching_context - # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingContext] - # Input of prebuilt Agent Coaching feature. - # - # Note: The following fields are mutually exclusive: `agent_coaching_context`, `free_form_context`, `summarization_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] summarization_context - # @return [::Google::Cloud::Dialogflow::V2::SummarizationContext] - # Input of prebuilt Summarization feature. - # - # Note: The following fields are mutually exclusive: `summarization_context`, `free_form_context`, `agent_coaching_context`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] inference_parameter - # @return [::Google::Cloud::Dialogflow::V2::InferenceParameter] - # Optional. Inference parameters for this generator. - # @!attribute [rw] trigger_event - # @return [::Google::Cloud::Dialogflow::V2::TriggerEvent] - # Optional. The trigger event of the generator. It defines when the generator - # is triggered in a conversation. - # @!attribute [rw] published_model - # @return [::String] - # Optional. The published Large Language Model name. - # * To use the latest model version, specify the model name without version - # number. Example: `text-bison` - # * To use a stable model version, specify the version number as well. - # Example: `text-bison@002`. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this generator. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time of this generator. - # @!attribute [rw] tools - # @return [::Array<::String>] - # Optional. Resource names of the tools that the generator can choose from. - # Format: `projects//locations//tools/`. - # @!attribute [rw] suggestion_deduping_config - # @return [::Google::Cloud::Dialogflow::V2::SuggestionDedupingConfig] - # Optional. Configuration for suggestion deduping. This is only applicable to - # AI Coach feature. - # @!attribute [rw] toolset_tools - # @return [::Array<::Google::Cloud::Dialogflow::V2::ToolsetTool>] - # Optional. List of CES toolset specs that the generator can choose from. - # @!attribute [rw] ces_tool_specs - # @return [::Array<::Google::Cloud::Dialogflow::V2::CesToolSpec>] - # Optional. List of CES tool specs that the generator can choose from. - # @!attribute [rw] ces_app_specs - # @return [::Array<::Google::Cloud::Dialogflow::V2::CesAppSpec>] - # Optional. List of CES app specs that the generator can choose from. - class Generator - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Suggestion generated using free form generator. - # @!attribute [rw] response - # @return [::String] - # Required. Free form suggestion. - class FreeFormSuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Suggested summary of the conversation. - # @!attribute [rw] summary_sections - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarySuggestion::SummarySection>] - # Required. All the parts of generated summary. - class SummarySuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A component of the generated summary. - # @!attribute [rw] section - # @return [::String] - # Required. Name of the section. - # @!attribute [rw] summary - # @return [::String] - # Required. Summary text for the section. - class SummarySection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Suggestion for coaching agents. - # @!attribute [rw] applicable_instructions - # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingInstruction>] - # Optional. Instructions applicable based on the current context. - # @!attribute [rw] agent_action_suggestions - # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::AgentActionSuggestion>] - # Optional. Suggested actions for the agent to take. - # @!attribute [rw] sample_responses - # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::SampleResponse>] - # Optional. Sample response for the Agent. - class AgentCoachingSuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Sources for the suggestion. - # @!attribute [r] instruction_indexes - # @return [::Array<::Integer>] - # Output only. Source instruction indexes for the suggestion. This is the - # index of the applicable_instructions field. - class Sources - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Duplication check for the suggestion. - # @!attribute [r] duplicate_suggestions - # @return [::Array<::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::DuplicateCheckResult::DuplicateSuggestion>] - # Output only. The duplicate suggestions. - class DuplicateCheckResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The duplicate suggestion details. - # Keeping answer_record and sources together as they are identifiers for - # duplicate suggestions. - # @!attribute [r] answer_record - # @return [::String] - # Output only. The answer record id of the past duplicate suggestion. - # @!attribute [r] sources - # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::Sources] - # Output only. Sources for the suggestion. - # @!attribute [r] suggestion_index - # @return [::Integer] - # Output only. The index of the duplicate suggestion in the past - # suggestion list. - # @!attribute [r] similarity_score - # @return [::Float] - # Output only. The similarity score of between the past and current - # suggestion. - class DuplicateSuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Actions suggested for the agent. This is based on applicable instructions. - # @!attribute [rw] agent_action - # @return [::String] - # Optional. The suggested action for the agent. - # @!attribute [r] sources - # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::Sources] - # Output only. Sources for the agent action suggestion. - # @!attribute [r] duplicate_check_result - # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::DuplicateCheckResult] - # Output only. Duplicate check result for the agent action suggestion. - class AgentActionSuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Sample response that the agent can use. This could be based on applicable - # instructions and ingested data from other systems. - # @!attribute [rw] response_text - # @return [::String] - # Optional. Sample response for Agent in text. - # @!attribute [r] sources - # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::Sources] - # Output only. Sources for the Sample Response. - # @!attribute [r] duplicate_check_result - # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion::DuplicateCheckResult] - # Output only. Duplicate check result for the sample response. - class SampleResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Suggestion generated using a Generator. - # @!attribute [rw] free_form_suggestion - # @return [::Google::Cloud::Dialogflow::V2::FreeFormSuggestion] - # Optional. Free form suggestion. - # - # Note: The following fields are mutually exclusive: `free_form_suggestion`, `summary_suggestion`, `agent_coaching_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] summary_suggestion - # @return [::Google::Cloud::Dialogflow::V2::SummarySuggestion] - # Optional. Suggested summary. - # - # Note: The following fields are mutually exclusive: `summary_suggestion`, `free_form_suggestion`, `agent_coaching_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] agent_coaching_suggestion - # @return [::Google::Cloud::Dialogflow::V2::AgentCoachingSuggestion] - # Optional. Suggestion to coach the agent. - # - # Note: The following fields are mutually exclusive: `agent_coaching_suggestion`, `free_form_suggestion`, `summary_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] tool_call_info - # @return [::Array<::Google::Cloud::Dialogflow::V2::GeneratorSuggestion::ToolCallInfo>] - # Optional. List of request and response for tool calls executed. - class GeneratorSuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Request and response for a tool call. - # @!attribute [rw] tool_call - # @return [::Google::Cloud::Dialogflow::V2::ToolCall] - # Required. Request for a tool call. - # @!attribute [rw] tool_call_result - # @return [::Google::Cloud::Dialogflow::V2::ToolCallResult] - # Required. Response for a tool call. - class ToolCallInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Config for suggestion deduping. - # NEXT_ID: 3 - # @!attribute [rw] enable_deduping - # @return [::Boolean] - # Optional. Whether to enable suggestion deduping. - # @!attribute [rw] similarity_threshold - # @return [::Float] - # Optional. The threshold for similarity between two suggestions. - # Acceptable value is [0.0, 1.0], default to 0.8 - class SuggestionDedupingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Responsible AI checks. - # @!attribute [rw] rai_category_configs - # @return [::Array<::Google::Cloud::Dialogflow::V2::RaiSettings::RaiCategoryConfig>] - # Configuration for a set of RAI categories. - class RaiSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for a specific RAI category. - # @!attribute [rw] category - # @return [::Google::Cloud::Dialogflow::V2::RaiSettings::RaiCategoryConfig::RaiCategory] - # Optional. The RAI category. - # @!attribute [rw] sensitivity_level - # @return [::Google::Cloud::Dialogflow::V2::RaiSettings::RaiCategoryConfig::SensitivityLevel] - # Optional. The sensitivity level for this category. - class RaiCategoryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum for RAI category. - module RaiCategory - # Default value. - RAI_CATEGORY_UNSPECIFIED = 0 - - # Dangerous content. - DANGEROUS_CONTENT = 1 - - # Sexually explicit content. - SEXUALLY_EXPLICIT = 2 - - # Harassment content. - HARASSMENT = 3 - - # Hate speech content. - HATE_SPEECH = 4 - end - - # Enum for user-configurable sensitivity levels. - module SensitivityLevel - # Default value. - # If unspecified, the default behavior is: - # - DANGEROUS_CONTENT: BLOCK_FEW - # - SEXUALLY_EXPLICIT: BLOCK_SOME - # - HARASSMENT: BLOCK_SOME - # - HATE_SPEECH: BLOCK_SOME - SENSITIVITY_LEVEL_UNSPECIFIED = 0 - - # Block most potentially sensitive responses. - BLOCK_MOST = 1 - - # Block some potentially sensitive responses. - BLOCK_SOME = 2 - - # Block a few potentially sensitive responses. - BLOCK_FEW = 3 - - # No filtering for this category. - BLOCK_NONE = 4 - end - end - end - - # The event that triggers the generator and LLM execution. - module TriggerEvent - # Default value for TriggerEvent. - TRIGGER_EVENT_UNSPECIFIED = 0 - - # Triggers when each chat message or voice utterance ends. - END_OF_UTTERANCE = 1 - - # Triggers on the conversation manually by API calls, such as - # Conversations.GenerateStatelessSuggestion and - # Conversations.GenerateSuggestions. - MANUAL_CALL = 2 - - # Triggers after each customer message only. - CUSTOMER_MESSAGE = 3 - - # Triggers after each agent message only. - AGENT_MESSAGE = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator_evaluation.rb deleted file mode 100644 index e317542a668e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/generator_evaluation.rb +++ /dev/null @@ -1,539 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Request of CreateGeneratorEvaluation. - # @!attribute [rw] parent - # @return [::String] - # Required. The generator resource name. Format: - # `projects//locations//generators/` - # @!attribute [rw] generator_evaluation - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation] - # Required. The generator evaluation to be created. - class CreateGeneratorEvaluationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request of GetGeneratorEvaluation. - # @!attribute [rw] name - # @return [::String] - # Required. The generator evaluation resource name. Format: - # `projects//locations//generators//evaluations/` - class GetGeneratorEvaluationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request of ListGeneratorEvaluations. - # @!attribute [rw] parent - # @return [::String] - # Required. The generator resource name. Format: - # `projects//locations//generators/` - # Wildcard value `-` is supported on generator_id to list evaluations across - # all generators under same project. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of evaluations to return in a - # single page. By default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListGeneratorEvaluationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of ListGeneratorEvaluations. - # @!attribute [rw] generator_evaluations - # @return [::Array<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>] - # The list of evaluations to return. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListGeneratorEvaluationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request of DeleteGeneratorEvaluation. - # @!attribute [rw] name - # @return [::String] - # Required. The generator evaluation resource name. Format: - # `projects//locations//generators// - # evaluations/` - class DeleteGeneratorEvaluationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents evaluation result of a generator. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the evaluation. Format: - # `projects//locations//generators// - # evaluations/` - # @!attribute [rw] display_name - # @return [::String] - # Optional. The display name of the generator evaluation. At most 64 bytes - # long. - # @!attribute [rw] generator_evaluation_config - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig] - # Required. The configuration of the evaluation task. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this generator evaluation. - # @!attribute [r] complete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Completion time of this generator evaluation. - # @!attribute [rw] initial_generator - # @return [::Google::Cloud::Dialogflow::V2::Generator] - # Required. The initial generator that was used when creating this - # evaluation. This is a copy of the generator read from storage when creating - # the evaluation. - # @!attribute [r] summarization_metrics - # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics] - # Output only. Only available when the summarization generator is provided. - # @!attribute [r] evaluation_status - # @return [::Google::Cloud::Dialogflow::V2::EvaluationStatus] - # Output only. The result status of the evaluation pipeline. Provides the - # status information including if the evaluation is still in progress, - # completed or failed with certain error and user actionable message. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. A read only boolean field reflecting Zone Separation - # status of the model. The field is an aggregated - # value of ZS status of its underlying dependencies. See more details in - # go/zicy-resource-placement#resource-status - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Output only. A read only boolean field reflecting Zone Isolation status - # of the model. The field is an aggregated value of - # ZI status of its underlying dependencies. See more details in - # go/zicy-resource-placement#resource-status - class GeneratorEvaluation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Evaluation metrics for summarization generator. - # @!attribute [r] summarization_evaluation_results - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::SummarizationEvaluationResult>] - # Output only. A list of evaluation results per conversation(&summary), - # metric and section. - # @!attribute [r] summarization_evaluation_merged_results_uri - # @return [::String] - # Output only. User bucket uri for merged evaluation score and aggregation - # score csv. - # @!attribute [r] overall_metrics - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::OverallScoresByMetric>] - # Output only. A list of aggregated(average) scores per metric section. - # @!attribute [r] overall_section_tokens - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::SectionToken>] - # Output only. Overall token per section. This is an aggregated(sum) result - # of input token of summary acorss all conversations that are selected for - # summarization evaluation. - # @!attribute [r] conversation_details - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::ConversationDetail>] - # Output only. List of conversation details. - class SummarizationEvaluationMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Decomposition details for accuracy. - # @!attribute [r] point - # @return [::String] - # Output only. The breakdown point of the summary. - # @!attribute [r] accuracy_reasoning - # @return [::String] - # Output only. The accuracy reasoning of the breakdown point. - # @!attribute [r] is_accurate - # @return [::Boolean] - # Output only. Whether the breakdown point is accurate or not. - class AccuracyDecomposition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Decomposition details for adherence. - # @deprecated This message is deprecated and may be removed in the next major version update. - # @!attribute [r] point - # @return [::String] - # Output only. The breakdown point of the given instructions. - # @!attribute [r] adherence_reasoning - # @return [::String] - # Output only. The adherence reasoning of the breakdown point. - # @!attribute [r] is_adherent - # @return [::Boolean] - # Output only. Whether the breakdown point is adherent or not. - class AdherenceDecomposition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Rubric result of the adherence evaluation. A rubric is ued to determine - # if the summary adheres to all aspects of the given instructions. - # @!attribute [r] question - # @return [::String] - # Output only. The question generated from instruction that used to - # evaluate summary. - # @!attribute [r] reasoning - # @return [::String] - # Output only. The reasoning of the rubric question is addressed or not. - # @!attribute [r] is_addressed - # @return [::Boolean] - # Output only. A boolean that indicates whether the rubric question is - # addressed or not. - class AdherenceRubric - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Rubric details of the completeness evaluation result. - # @!attribute [r] question - # @return [::String] - # Output only. The question generated from instruction that used to - # evaluate summary. - # @!attribute [r] is_addressed - # @return [::Boolean] - # Output only. A boolean that indicates whether the rubric question is - # addressed or not. - class CompletenessRubric - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Decomposition details - # @deprecated This message is deprecated and may be removed in the next major version update. - # @!attribute [rw] accuracy_decomposition - # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::AccuracyDecomposition] - # only available for accuracy metric. - # - # Note: The following fields are mutually exclusive: `accuracy_decomposition`, `adherence_decomposition`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] adherence_decomposition - # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::AdherenceDecomposition] - # only available for adherence metric. - # - # Note: The following fields are mutually exclusive: `adherence_decomposition`, `accuracy_decomposition`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Decomposition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Evaluation result that contains one of accuracy, adherence or completeness - # evaluation result. - # @!attribute [rw] accuracy_decomposition - # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::AccuracyDecomposition] - # Only available for accuracy metric. - # - # Note: The following fields are mutually exclusive: `accuracy_decomposition`, `adherence_rubric`, `completeness_rubric`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] adherence_rubric - # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::AdherenceRubric] - # Only available for adherence metric. - # - # Note: The following fields are mutually exclusive: `adherence_rubric`, `accuracy_decomposition`, `completeness_rubric`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] completeness_rubric - # @return [::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::CompletenessRubric] - # Only available for completeness metric. - # - # Note: The following fields are mutually exclusive: `completeness_rubric`, `accuracy_decomposition`, `adherence_rubric`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class EvaluationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Evaluation result per conversation(&summary), metric and section. - # @!attribute [r] session_id - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Output only. conversation session id - # @!attribute [r] metric - # @return [::String] - # Output only. metric name, e.g. accuracy, completeness, adherence, etc. - # @!attribute [r] section - # @return [::String] - # Output only. section/task name, e.g. action, situation, etc - # @!attribute [r] score - # @return [::Float] - # Output only. score calculated from decompositions - # @!attribute [r] section_summary - # @return [::String] - # Output only. Summary of this section - # @!attribute [r] decompositions - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::Decomposition>] - # Output only. List of decompostion details - # @!attribute [r] evaluation_results - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::EvaluationResult>] - # Output only. List of evaluation results. - class SummarizationEvaluationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Overall performance per metric. This is the aggregated score for each - # metric across all conversations that are selected for summarization - # evaluation. - # @!attribute [r] metric - # @return [::String] - # Output only. Metric name. e.g. accuracy, adherence, completeness. - class OverallScoresByMetric - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A pair of section name and input token count of the input summary section. - # @!attribute [r] section - # @return [::String] - # Output only. The name of the summary instruction. - # @!attribute [r] token_count - # @return [::Integer] - # Output only. Token count. - class SectionToken - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Aggregated evaluation result on conversation level. This conatins - # evaluation results of all the metrics and sections. - # @!attribute [r] message_entries - # @return [::Array<::Google::Cloud::Dialogflow::V2::MessageEntry>] - # Output only. Conversation transcript that used for summarization - # evaluation as a reference. - # @!attribute [r] summary_sections - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarySuggestion::SummarySection>] - # Output only. Summary sections that used for summarization evaluation as a - # reference. - # @!attribute [r] metric_details - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::ConversationDetail::MetricDetail>] - # Output only. List of metric details. - # @!attribute [r] section_tokens - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::SectionToken>] - # Output only. Conversation level token count per section. This is an - # aggregated(sum) result of input token of summary acorss all metrics for a - # single conversation. - class ConversationDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Aggregated result on metric level. This conatins the evaluation results - # of all the sections. - # @!attribute [r] metric - # @return [::String] - # Output only. Metrics name. e.g. accuracy, adherence, completeness. - # @!attribute [r] score - # @return [::Float] - # Output only. Aggregated(average) score on this metric across all - # sections. - # @!attribute [r] section_details - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::ConversationDetail::MetricDetail::SectionDetail>] - # Output only. List of section details. - class MetricDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Section level result. - # @!attribute [r] section - # @return [::String] - # Output only. The name of the summary instruction. - # @!attribute [r] score - # @return [::Float] - # Output only. Aggregated(average) score on this section across all - # evaluation results. Either decompositions or rubrics. - # @!attribute [r] section_summary - # @return [::String] - # Output only. Summary for this section - # @!attribute [r] evaluation_results - # @return [::Array<::Google::Cloud::Dialogflow::V2::SummarizationEvaluationMetrics::EvaluationResult>] - # Output only. List of evaluation result. The list only contains one - # kind of the evaluation result. - class SectionDetail - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - - # Generator evaluation input config. - # @!attribute [rw] input_data_config - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::InputDataConfig] - # Required. The config/source of input data. - # @!attribute [rw] output_gcs_bucket_path - # @return [::String] - # Required. The output Cloud Storage bucket path to store eval files, e.g. - # per_summary_accuracy_score report. This path is provided by customer and - # files stored in it are visible to customer, no internal data should be - # stored in this path. - # @!attribute [rw] summarization_config - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::SummarizationConfig] - # Evaluation configs for summarization generator. - class GeneratorEvaluationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The distinctive configs for Agent Assist conversations as the conversation - # source. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Required. The start of the time range for conversations to be evaluated. - # Only conversations created at or after this timestamp will be sampled. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # Required. The end of the time range for conversations to be evaluated. - # Only conversations ended at or before this timestamp will be sampled. - class AgentAssistInputDataConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The distinctive configs for dataset as the conversation source. - # @!attribute [rw] dataset - # @return [::String] - # Required. The identifier of the dataset to be evaluated. - # Format: - # `projects//locations//datasets/`. - class DatasetInputDataConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Input data config details - # @!attribute [rw] input_data_source_type - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::InputDataSourceType] - # Required. The source type of input data. - # @!attribute [rw] start_time - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Protobuf::Timestamp] - # Optional. The start timestamp to fetch conversation data. - # @!attribute [rw] end_time - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Protobuf::Timestamp] - # Optional. The end timestamp to fetch conversation data. - # @!attribute [rw] sample_size - # @return [::Integer] - # Optional. Desired number of conversation-summary pairs to be evaluated. - # @!attribute [rw] is_summary_generation_allowed - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. Whether the summary generation is allowed when the pre-existing - # qualified summaries are insufficient to cover the sample size. - # @!attribute [rw] summary_generation_option - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::InputDataConfig::SummaryGenerationOption] - # Optional. Option to control whether summaries are generated during - # evaluation. - # @!attribute [rw] agent_assist_input_data_config - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::AgentAssistInputDataConfig] - # The distinctive configs for Agent Assist conversations as the - # conversation source. - # - # Note: The following fields are mutually exclusive: `agent_assist_input_data_config`, `dataset_input_data_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] dataset_input_data_config - # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluationConfig::DatasetInputDataConfig] - # The distinctive configs for dataset as the conversation source. - # - # Note: The following fields are mutually exclusive: `dataset_input_data_config`, `agent_assist_input_data_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class InputDataConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Summary generation options. - module SummaryGenerationOption - # Default option will not be used - SUMMARY_GENERATION_OPTION_UNSPECIFIED = 0 - - # Always Generate summary for all conversations. - ALWAYS_GENERATE = 1 - - # Gnerate only missing summaries. - GENERATE_IF_MISSING = 2 - - # Do not generate new summaries. Only use existing summaries found. - DO_NOT_GENERATE = 3 - end - end - - # Evaluation configs for summarization generator. - # @!attribute [rw] enable_accuracy_evaluation - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. Enable accuracy evaluation. - # @!attribute [rw] accuracy_evaluation_version - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Optional. Version for summarization accuracy. This will determine the - # prompt and model used at backend. - # @!attribute [rw] enable_completeness_evaluation - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Optional. Enable completeness evaluation. - # @!attribute [rw] completeness_evaluation_version - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Optional. Version for summarization completeness. This will determine the - # prompt and model used at backend. - # @!attribute [rw] evaluator_version - # @return [::String] - # Optional. Version for summarization evaluation. - class SummarizationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enumeration of input data source type. - module InputDataSourceType - # Unspecified InputDataSourceType. Should not be used. - INPUT_DATA_SOURCE_TYPE_UNSPECIFIED = 0 - - # Fetch data from Agent Assist storage. If this source type is chosen, - # input_data_config.start_time and input_data_config.end_timestamp must be - # provided. - AGENT_ASSIST_CONVERSATIONS = 1 - - # Fetch data from Insights storage. If this source type is chosen, - # input_data_config.start_time and input_data_config.end_timestamp must be - # provided. - INSIGHTS_CONVERSATIONS = 2 - end - end - - # A common evalaution pipeline status. - # @!attribute [r] done - # @return [::Boolean] - # Output only. If the value is `false`, it means the evaluation is still in - # progress. If `true`, the operation is completed, and either `error` or - # `response` is available. - # @!attribute [r] pipeline_status - # @return [::Google::Rpc::Status] - # Output only. The error result of the evaluation in case of failure in - # evaluation pipeline. - class EvaluationStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb deleted file mode 100644 index 67ae06b1b51e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Represents a notification sent to Cloud Pub/Sub subscribers for - # human agent assistant events in a specific conversation. - # @!attribute [rw] conversation - # @return [::String] - # The conversation this notification refers to. - # Format: `projects//conversations/`. - # @!attribute [rw] participant - # @return [::String] - # The participant that the suggestion is compiled for. - # Format: `projects//conversations//participants/`. It will not be set in legacy workflow. - # @!attribute [rw] suggestion_results - # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] - # The suggestion results payload that this notification refers to. - class HumanAgentAssistantEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/intent.rb deleted file mode 100644 index e531744bbf51..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/intent.rb +++ /dev/null @@ -1,1089 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # An intent categorizes an end-user's intention for one conversation turn. For - # each agent, you define many intents, where your combined intents can handle a - # complete conversation. When an end-user writes or says something, referred to - # as an end-user expression or end-user input, Dialogflow matches the end-user - # input to the best intent in your agent. Matching an intent is also known as - # intent classification. - # - # For more information, see the [intent - # guide](https://cloud.google.com/dialogflow/docs/intents-overview). - # @!attribute [rw] name - # @return [::String] - # Optional. The unique identifier of this intent. - # Required for - # {::Google::Cloud::Dialogflow::V2::Intents::Client#update_intent Intents.UpdateIntent} and - # {::Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents Intents.BatchUpdateIntents} - # methods. - # Format: `projects//agent/intents/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The name of this intent. - # @!attribute [rw] webhook_state - # @return [::Google::Cloud::Dialogflow::V2::Intent::WebhookState] - # Optional. Indicates whether webhooks are enabled for the intent. - # @!attribute [rw] priority - # @return [::Integer] - # Optional. The priority of this intent. Higher numbers represent higher - # priorities. - # - # - If the supplied value is unspecified or 0, the service - # translates the value to 500,000, which corresponds to the - # `Normal` priority in the console. - # - If the supplied value is negative, the intent is ignored - # in runtime detect intent requests. - # @!attribute [rw] is_fallback - # @return [::Boolean] - # Optional. Indicates whether this is a fallback intent. - # @!attribute [rw] ml_disabled - # @return [::Boolean] - # Optional. Indicates whether Machine Learning is disabled for the intent. - # Note: If `ml_disabled` setting is set to true, then this intent is not - # taken into account during inference in `ML ONLY` match mode. Also, - # auto-markup in the UI is turned off. - # @!attribute [rw] live_agent_handoff - # @return [::Boolean] - # Optional. Indicates that a live agent should be brought in to handle the - # interaction with the user. In most cases, when you set this flag to true, - # you would also want to set end_interaction to true as well. Default is - # false. - # @!attribute [rw] end_interaction - # @return [::Boolean] - # Optional. Indicates that this intent ends an interaction. Some integrations - # (e.g., Actions on Google or Dialogflow phone gateway) use this information - # to close interaction with an end user. Default is false. - # @!attribute [rw] input_context_names - # @return [::Array<::String>] - # Optional. The list of context names required for this intent to be - # triggered. - # Format: `projects//agent/sessions/-/contexts/`. - # @!attribute [rw] events - # @return [::Array<::String>] - # Optional. The collection of event names that trigger the intent. - # If the collection of input contexts is not empty, all of the contexts must - # be present in the active user session for an event to trigger this intent. - # Event names are limited to 150 characters. - # @!attribute [rw] training_phrases - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase>] - # Optional. The collection of examples that the agent is - # trained on. - # @!attribute [rw] action - # @return [::String] - # Optional. The name of the action associated with the intent. - # Note: The action name must not contain whitespaces. - # @!attribute [rw] output_contexts - # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] - # Optional. The collection of contexts that are activated when the intent - # is matched. Context messages in this collection should not set the - # parameters field. Setting the `lifespan_count` to 0 will reset the context - # when the intent is matched. - # Format: `projects//agent/sessions/-/contexts/`. - # @!attribute [rw] reset_contexts - # @return [::Boolean] - # Optional. Indicates whether to delete all contexts in the current - # session when this intent is matched. - # @!attribute [rw] parameters - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Parameter>] - # Optional. The collection of parameters associated with the intent. - # @!attribute [rw] messages - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message>] - # Optional. The collection of rich messages corresponding to the - # `Response` field in the Dialogflow console. - # @!attribute [rw] default_response_platforms - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::Platform>] - # Optional. The list of platforms for which the first responses will be - # copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). - # @!attribute [r] root_followup_intent_name - # @return [::String] - # Output only. - # Read-only. The unique identifier of the root intent in the chain of - # followup intents. It identifies the correct followup intents chain for - # this intent. We populate this field only in the output. - # - # Format: `projects//agent/intents/`. - # @!attribute [rw] parent_followup_intent_name - # @return [::String] - # Read-only after creation. The unique identifier of the parent intent in the - # chain of followup intents. You can set this field when creating an intent, - # for example with - # {::Google::Cloud::Dialogflow::V2::Intents::Client#create_intent CreateIntent} or - # {::Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents BatchUpdateIntents}, - # in order to make this intent a followup intent. - # - # It identifies the parent followup intent. - # Format: `projects//agent/intents/`. - # @!attribute [r] followup_intent_info - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::FollowupIntentInfo>] - # Output only. Read-only. Information about all followup intents that have - # this intent as a direct or indirect parent. We populate this field only in - # the output. - class Intent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents an example that the agent is trained on. - # @!attribute [r] name - # @return [::String] - # Output only. The unique identifier of this training phrase. - # @!attribute [rw] type - # @return [::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Type] - # Required. The type of the training phrase. - # @!attribute [rw] parts - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Part>] - # Required. The ordered list of training phrase parts. - # The parts are concatenated in order to form the training phrase. - # - # Note: The API does not automatically annotate training phrases like the - # Dialogflow Console does. - # - # Note: Do not forget to include whitespace at part boundaries, - # so the training phrase is well formatted when the parts are concatenated. - # - # If the training phrase does not need to be annotated with parameters, - # you just need a single part with only the - # {::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Part#text Part.text} - # field set. - # - # If you want to annotate the training phrase, you must create multiple - # parts, where the fields of each part are populated in one of two ways: - # - # - `Part.text` is set to a part of the phrase that has no parameters. - # - `Part.text` is set to a part of the phrase that you want to annotate, - # and the `entity_type`, `alias`, and `user_defined` fields are all - # set. - # @!attribute [rw] times_added_count - # @return [::Integer] - # Optional. Indicates how many times this example was added to - # the intent. Each time a developer adds an existing sample by editing an - # intent or training, this counter is increased. - class TrainingPhrase - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a part of a training phrase. - # @!attribute [rw] text - # @return [::String] - # Required. The text for this part. - # @!attribute [rw] entity_type - # @return [::String] - # Optional. The entity type name prefixed with `@`. - # This field is required for annotated parts of the training phrase. - # @!attribute [rw] alias - # @return [::String] - # Optional. The parameter name for the value extracted from the - # annotated part of the example. - # This field is required for annotated parts of the training phrase. - # @!attribute [rw] user_defined - # @return [::Boolean] - # Optional. Indicates whether the text was manually annotated. - # This field is set to true when the Dialogflow Console is used to - # manually annotate the part. When creating an annotated part with the - # API, you must set this to true. - class Part - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents different types of training phrases. - module Type - # Not specified. This value should never be used. - TYPE_UNSPECIFIED = 0 - - # Examples do not contain @-prefixed entity type names, but example parts - # can be annotated with entity types. - EXAMPLE = 1 - - # Templates are not annotated with entity types, but they can contain - # @-prefixed entity type names as substrings. - # Template mode has been deprecated. Example mode is the only supported - # way to create new training phrases. If you have existing training - # phrases that you've created in template mode, those will continue to - # work. - TEMPLATE = 2 - end - end - - # Represents intent parameters. - # @!attribute [rw] name - # @return [::String] - # The unique identifier of this parameter. - # @!attribute [rw] display_name - # @return [::String] - # Required. The name of the parameter. - # @!attribute [rw] value - # @return [::String] - # Optional. The definition of the parameter value. It can be: - # - # - a constant string, - # - a parameter value defined as `$parameter_name`, - # - an original parameter value defined as `$parameter_name.original`, - # - a parameter value from some context defined as - # `#context_name.parameter_name`. - # @!attribute [rw] default_value - # @return [::String] - # Optional. The default value to use when the `value` yields an empty - # result. - # Default values can be extracted from contexts by using the following - # syntax: `#context_name.parameter_name`. - # @!attribute [rw] entity_type_display_name - # @return [::String] - # Optional. The name of the entity type, prefixed with `@`, that - # describes values of the parameter. If the parameter is - # required, this must be provided. - # @!attribute [rw] mandatory - # @return [::Boolean] - # Optional. Indicates whether the parameter is required. That is, - # whether the intent cannot be completed without collecting the parameter - # value. - # @!attribute [rw] prompts - # @return [::Array<::String>] - # Optional. The collection of prompts that the agent can present to the - # user in order to collect a value for the parameter. - # @!attribute [rw] is_list - # @return [::Boolean] - # Optional. Indicates whether the parameter represents a list of values. - class Parameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A rich response message. - # Corresponds to the intent `Response` field in the Dialogflow console. - # For more information, see - # [Rich response - # messages](https://cloud.google.com/dialogflow/docs/intents-rich-messages). - # @!attribute [rw] text - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Text] - # The text response. - # - # Note: The following fields are mutually exclusive: `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] - # The image response. - # - # Note: The following fields are mutually exclusive: `image`, `text`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] quick_replies - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::QuickReplies] - # The quick replies response. - # - # Note: The following fields are mutually exclusive: `quick_replies`, `text`, `image`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] card - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Card] - # The card response. - # - # Note: The following fields are mutually exclusive: `card`, `text`, `image`, `quick_replies`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] payload - # @return [::Google::Protobuf::Struct] - # A custom platform-specific response. - # - # Note: The following fields are mutually exclusive: `payload`, `text`, `image`, `quick_replies`, `card`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] simple_responses - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::SimpleResponses] - # The voice and text-only responses for Actions on Google. - # - # Note: The following fields are mutually exclusive: `simple_responses`, `text`, `image`, `quick_replies`, `card`, `payload`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] basic_card - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BasicCard] - # The basic card response for Actions on Google. - # - # Note: The following fields are mutually exclusive: `basic_card`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] suggestions - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Suggestions] - # The suggestion chips for Actions on Google. - # - # Note: The following fields are mutually exclusive: `suggestions`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] link_out_suggestion - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::LinkOutSuggestion] - # The link out suggestion chip for Actions on Google. - # - # Note: The following fields are mutually exclusive: `link_out_suggestion`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_select - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::ListSelect] - # The list card response for Actions on Google. - # - # Note: The following fields are mutually exclusive: `list_select`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `carousel_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] carousel_select - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::CarouselSelect] - # The carousel card response for Actions on Google. - # - # Note: The following fields are mutually exclusive: `carousel_select`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `browse_carousel_card`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] browse_carousel_card - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard] - # Browse carousel card for Actions on Google. - # - # Note: The following fields are mutually exclusive: `browse_carousel_card`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `table_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] table_card - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::TableCard] - # Table card for Actions on Google. - # - # Note: The following fields are mutually exclusive: `table_card`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `media_content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] media_content - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::MediaContent] - # The media content card for Actions on Google. - # - # Note: The following fields are mutually exclusive: `media_content`, `text`, `image`, `quick_replies`, `card`, `payload`, `simple_responses`, `basic_card`, `suggestions`, `link_out_suggestion`, `list_select`, `carousel_select`, `browse_carousel_card`, `table_card`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] platform - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Platform] - # Optional. The platform that this message is intended for. - class Message - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The text response message. - # @!attribute [rw] text - # @return [::Array<::String>] - # Optional. The collection of the agent's responses. - class Text - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The image response message. - # @!attribute [rw] image_uri - # @return [::String] - # Optional. The public URI to an image file. - # @!attribute [rw] accessibility_text - # @return [::String] - # Optional. A text description of the image to be used for accessibility, - # e.g., screen readers. - class Image - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The quick replies response message. - # @!attribute [rw] title - # @return [::String] - # Optional. The title of the collection of quick replies. - # @!attribute [rw] quick_replies - # @return [::Array<::String>] - # Optional. The collection of quick replies. - class QuickReplies - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The card response message. - # @!attribute [rw] title - # @return [::String] - # Optional. The title of the card. - # @!attribute [rw] subtitle - # @return [::String] - # Optional. The subtitle of the card. - # @!attribute [rw] image_uri - # @return [::String] - # Optional. The public URI to an image file for the card. - # @!attribute [rw] buttons - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::Card::Button>] - # Optional. The collection of card buttons. - class Card - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contains information about a button. - # @!attribute [rw] text - # @return [::String] - # Optional. The text to show on the button. - # @!attribute [rw] postback - # @return [::String] - # Optional. The text to send back to the Dialogflow API or a URI to - # open. - class Button - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The simple response message containing speech or text. - # @!attribute [rw] text_to_speech - # @return [::String] - # One of text_to_speech or ssml must be provided. The plain text of the - # speech output. Mutually exclusive with ssml. - # @!attribute [rw] ssml - # @return [::String] - # One of text_to_speech or ssml must be provided. Structured spoken - # response to the user in the SSML format. Mutually exclusive with - # text_to_speech. - # @!attribute [rw] display_text - # @return [::String] - # Optional. The text to display. - class SimpleResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The collection of simple response candidates. - # This message in `QueryResult.fulfillment_messages` and - # `WebhookResponse.fulfillment_messages` should contain only one - # `SimpleResponse`. - # @!attribute [rw] simple_responses - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::SimpleResponse>] - # Required. The list of simple responses. - class SimpleResponses - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The basic card message. Useful for displaying information. - # @!attribute [rw] title - # @return [::String] - # Optional. The title of the card. - # @!attribute [rw] subtitle - # @return [::String] - # Optional. The subtitle of the card. - # @!attribute [rw] formatted_text - # @return [::String] - # Required, unless image is present. The body text of the card. - # @!attribute [rw] image - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] - # Optional. The image for the card. - # @!attribute [rw] buttons - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::BasicCard::Button>] - # Optional. The collection of card buttons. - class BasicCard - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The button object that appears at the bottom of a card. - # @!attribute [rw] title - # @return [::String] - # Required. The title of the button. - # @!attribute [rw] open_uri_action - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BasicCard::Button::OpenUriAction] - # Required. Action to take when a user taps on the button. - class Button - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Opens the given URI. - # @!attribute [rw] uri - # @return [::String] - # Required. The HTTP or HTTPS scheme URI. - class OpenUriAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # The suggestion chip message that the user can tap to quickly post a reply - # to the conversation. - # @!attribute [rw] title - # @return [::String] - # Required. The text shown the in the suggestion chip. - class Suggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The collection of suggestions. - # @!attribute [rw] suggestions - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::Suggestion>] - # Required. The list of suggested replies. - class Suggestions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The suggestion chip message that allows the user to jump out to the app - # or website associated with this agent. - # @!attribute [rw] destination_name - # @return [::String] - # Required. The name of the app or site this chip is linking to. - # @!attribute [rw] uri - # @return [::String] - # Required. The URI of the app or site to open when the user taps the - # suggestion chip. - class LinkOutSuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The card for presenting a list of options to select from. - # @!attribute [rw] title - # @return [::String] - # Optional. The overall title of the list. - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::ListSelect::Item>] - # Required. List items. - # @!attribute [rw] subtitle - # @return [::String] - # Optional. Subtitle of the list. - class ListSelect - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An item in the list. - # @!attribute [rw] info - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::SelectItemInfo] - # Required. Additional information about this option. - # @!attribute [rw] title - # @return [::String] - # Required. The title of the list item. - # @!attribute [rw] description - # @return [::String] - # Optional. The main text describing the item. - # @!attribute [rw] image - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] - # Optional. The image to display. - class Item - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The card for presenting a carousel of options to select from. - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::CarouselSelect::Item>] - # Required. Carousel items. - class CarouselSelect - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An item in the carousel. - # @!attribute [rw] info - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::SelectItemInfo] - # Required. Additional info about the option item. - # @!attribute [rw] title - # @return [::String] - # Required. Title of the carousel item. - # @!attribute [rw] description - # @return [::String] - # Optional. The body text of the card. - # @!attribute [rw] image - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] - # Optional. The image to display. - class Item - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Additional info about the select item for when it is triggered in a - # dialog. - # @!attribute [rw] key - # @return [::String] - # Required. A unique key that will be sent back to the agent if this - # response is given. - # @!attribute [rw] synonyms - # @return [::Array<::String>] - # Optional. A list of synonyms that can also be used to trigger this - # item in dialog. - class SelectItemInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The media content card for Actions on Google. - # @!attribute [rw] media_type - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::MediaContent::ResponseMediaType] - # Optional. What type of media is the content (ie "audio"). - # @!attribute [rw] media_objects - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::MediaContent::ResponseMediaObject>] - # Required. List of media objects. - class MediaContent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Response media object for media content card. - # @!attribute [rw] name - # @return [::String] - # Required. Name of media card. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of media card. - # @!attribute [rw] large_image - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] - # Optional. Image to display above media content. - # - # Note: The following fields are mutually exclusive: `large_image`, `icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] icon - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] - # Optional. Icon to display above media content. - # - # Note: The following fields are mutually exclusive: `icon`, `large_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] content_url - # @return [::String] - # Required. Url where the media is stored. - class ResponseMediaObject - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Format of response media type. - module ResponseMediaType - # Unspecified. - RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0 - - # Response media type is audio. - AUDIO = 1 - end - end - - # Browse Carousel Card for Actions on Google. - # https://developers.google.com/actions/assistant/responses#browsing_carousel - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem>] - # Required. List of items in the Browse Carousel Card. Minimum of two - # items, maximum of ten. - # @!attribute [rw] image_display_options - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard::ImageDisplayOptions] - # Optional. Settings for displaying the image. Applies to every image in - # {::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard#items items}. - class BrowseCarouselCard - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Browsing carousel tile - # @!attribute [rw] open_uri_action - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem::OpenUrlAction] - # Required. Action to present to the user. - # @!attribute [rw] title - # @return [::String] - # Required. Title of the carousel item. Maximum of two lines of text. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the carousel item. Maximum of four lines of - # text. - # @!attribute [rw] image - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] - # Optional. Hero image for the carousel item. - # @!attribute [rw] footer - # @return [::String] - # Optional. Text that appears at the bottom of the Browse Carousel - # Card. Maximum of one line of text. - class BrowseCarouselCardItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Actions on Google action to open a given url. - # @!attribute [rw] url - # @return [::String] - # Required. URL - # @!attribute [rw] url_type_hint - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::BrowseCarouselCard::BrowseCarouselCardItem::OpenUrlAction::UrlTypeHint] - # Optional. Specifies the type of viewer that is used when opening - # the URL. Defaults to opening via web browser. - class OpenUrlAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of the URI. - module UrlTypeHint - # Unspecified - URL_TYPE_HINT_UNSPECIFIED = 0 - - # Url would be an amp action - AMP_ACTION = 1 - - # URL that points directly to AMP content, or to a canonical URL - # which refers to AMP content via . - AMP_CONTENT = 2 - end - end - end - - # Image display options for Actions on Google. This should be used for - # when the image's aspect ratio does not match the image container's - # aspect ratio. - module ImageDisplayOptions - # Fill the gaps between the image and the image container with gray - # bars. - IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0 - - # Fill the gaps between the image and the image container with gray - # bars. - GRAY = 1 - - # Fill the gaps between the image and the image container with white - # bars. - WHITE = 2 - - # Image is scaled such that the image width and height match or exceed - # the container dimensions. This may crop the top and bottom of the - # image if the scaled image height is greater than the container - # height, or crop the left and right of the image if the scaled image - # width is greater than the container width. This is similar to "Zoom - # Mode" on a widescreen TV when playing a 4:3 video. - CROPPED = 3 - - # Pad the gaps between image and image frame with a blurred copy of the - # same image. - BLURRED_BACKGROUND = 4 - end - end - - # Table card for Actions on Google. - # @!attribute [rw] title - # @return [::String] - # Required. Title of the card. - # @!attribute [rw] subtitle - # @return [::String] - # Optional. Subtitle to the title. - # @!attribute [rw] image - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::Image] - # Optional. Image which should be displayed on the card. - # @!attribute [rw] column_properties - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::ColumnProperties>] - # Optional. Display properties for the columns in this table. - # @!attribute [rw] rows - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::TableCardRow>] - # Optional. Rows in this table of data. - # @!attribute [rw] buttons - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::BasicCard::Button>] - # Optional. List of buttons for the card. - class TableCard - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Column properties for - # {::Google::Cloud::Dialogflow::V2::Intent::Message::TableCard TableCard}. - # @!attribute [rw] header - # @return [::String] - # Required. Column heading. - # @!attribute [rw] horizontal_alignment - # @return [::Google::Cloud::Dialogflow::V2::Intent::Message::ColumnProperties::HorizontalAlignment] - # Optional. Defines text alignment for all cells in this column. - class ColumnProperties - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Text alignments within a cell. - module HorizontalAlignment - # Text is aligned to the leading edge of the column. - HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0 - - # Text is aligned to the leading edge of the column. - LEADING = 1 - - # Text is centered in the column. - CENTER = 2 - - # Text is aligned to the trailing edge of the column. - TRAILING = 3 - end - end - - # Row of {::Google::Cloud::Dialogflow::V2::Intent::Message::TableCard TableCard}. - # @!attribute [rw] cells - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message::TableCardCell>] - # Optional. List of cells that make up this row. - # @!attribute [rw] divider_after - # @return [::Boolean] - # Optional. Whether to add a visual divider after this row. - class TableCardRow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cell of - # {::Google::Cloud::Dialogflow::V2::Intent::Message::TableCardRow TableCardRow}. - # @!attribute [rw] text - # @return [::String] - # Required. Text in this cell. - class TableCardCell - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The rich response message integration platform. See - # [Integrations](https://cloud.google.com/dialogflow/docs/integrations). - module Platform - # Default platform. - PLATFORM_UNSPECIFIED = 0 - - # Facebook. - FACEBOOK = 1 - - # Slack. - SLACK = 2 - - # Telegram. - TELEGRAM = 3 - - # Kik. - KIK = 4 - - # Skype. - SKYPE = 5 - - # Line. - LINE = 6 - - # Viber. - VIBER = 7 - - # Google Assistant - # See [Dialogflow webhook - # format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) - ACTIONS_ON_GOOGLE = 8 - - # Google Hangouts. - GOOGLE_HANGOUTS = 11 - end - end - - # Represents a single followup intent in the chain. - # @!attribute [rw] followup_intent_name - # @return [::String] - # The unique identifier of the followup intent. - # Format: `projects//agent/intents/`. - # @!attribute [rw] parent_followup_intent_name - # @return [::String] - # The unique identifier of the followup intent's parent. - # Format: `projects//agent/intents/`. - class FollowupIntentInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the different states that webhooks can be in. - module WebhookState - # Webhook is disabled in the agent and in the intent. - WEBHOOK_STATE_UNSPECIFIED = 0 - - # Webhook is enabled in the agent and in the intent. - WEBHOOK_STATE_ENABLED = 1 - - # Webhook is enabled in the agent and in the intent. Also, each slot - # filling prompt is forwarded to the webhook. - WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Intents::Client#list_intents Intents.ListIntents}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to list all intents from. - # Format: `projects//agent` or `projects//locations//agent`. - # - # Alternatively, you can specify the environment to list intents for. - # Format: `projects//agent/environments/` - # or `projects//locations//agent/environments/`. - # Note: training phrases of the intents will not be returned for non-draft - # environment. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @!attribute [rw] intent_view - # @return [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListIntentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Intents::Client#list_intents Intents.ListIntents}. - # @!attribute [rw] intents - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent>] - # The list of agent intents. There will be a maximum number of items - # returned based on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListIntentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Intents::Client#get_intent Intents.GetIntent}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the intent. - # Format: `projects//agent/intents/`. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @!attribute [rw] intent_view - # @return [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - class GetIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Intents::Client#create_intent Intents.CreateIntent}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create a intent for. - # Format: `projects//agent`. - # @!attribute [rw] intent - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # Required. The intent to create. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @!attribute [rw] intent_view - # @return [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - class CreateIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Intents::Client#update_intent Intents.UpdateIntent}. - # @!attribute [rw] intent - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # Required. The intent to update. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields get updated. - # @!attribute [rw] intent_view - # @return [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - class UpdateIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Intents::Client#delete_intent Intents.DeleteIntent}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the intent to delete. If this intent has direct or - # indirect followup intents, we also delete them. - # Format: `projects//agent/intents/`. - class DeleteIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the agent to update or create intents in. - # Format: `projects//agent`. - # @!attribute [rw] intent_batch_uri - # @return [::String] - # The URI to a Google Cloud Storage file containing intents to update or - # create. The file format can either be a serialized proto (of IntentBatch - # type) or JSON object. Note: The URI must start with "gs://". - # - # Note: The following fields are mutually exclusive: `intent_batch_uri`, `intent_batch_inline`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] intent_batch_inline - # @return [::Google::Cloud::Dialogflow::V2::IntentBatch] - # The collection of intents to update or create. - # - # Note: The following fields are mutually exclusive: `intent_batch_inline`, `intent_batch_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The language used to access language-specific data. - # If not specified, the agent's default language is used. - # For more information, see - # [Multilingual intent and entity - # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields get updated. - # @!attribute [rw] intent_view - # @return [::Google::Cloud::Dialogflow::V2::IntentView] - # Optional. The resource view to apply to the returned intent. - class BatchUpdateIntentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents Intents.BatchUpdateIntents}. - # @!attribute [rw] intents - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent>] - # The collection of updated or created intents. - class BatchUpdateIntentsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Intents::Client#batch_delete_intents Intents.BatchDeleteIntents}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the agent to delete all entities types for. Format: - # `projects//agent`. - # @!attribute [rw] intents - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent>] - # Required. The collection of intents to delete. Only intent `name` must be - # filled in. - class BatchDeleteIntentsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message is a wrapper around a collection of intents. - # @!attribute [rw] intents - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent>] - # A collection of intents. - class IntentBatch - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the options for views of an intent. - # An intent can be a sizable object. Therefore, we provide a resource view that - # does not return training phrases in the response by default. - module IntentView - # Training phrases field is not populated in the response. - INTENT_VIEW_UNSPECIFIED = 0 - - # All fields are populated. - INTENT_VIEW_FULL = 1 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb deleted file mode 100644 index 0a6fa7d91c68..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb +++ /dev/null @@ -1,173 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # A knowledge base represents a collection of knowledge documents that you - # provide to Dialogflow. Your knowledge documents contain information that may - # be useful during conversations with end-users. Some Dialogflow features use - # knowledge bases when looking for a response to an end-user input. - # - # For more information, see the [knowledge base - # guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases). - # - # Note: The `projects.agent.knowledgeBases` resource is deprecated; - # only use `projects.knowledgeBases`. - # @!attribute [rw] name - # @return [::String] - # The knowledge base resource name. - # The name must be empty when creating a knowledge base. - # Format: `projects//locations//knowledgeBases/`. - # @!attribute [rw] display_name - # @return [::String] - # Required. The display name of the knowledge base. The name must be 1024 - # bytes or less; otherwise, the creation request fails. - # @!attribute [rw] language_code - # @return [::String] - # Language which represents the KnowledgeBase. When the KnowledgeBase is - # created/updated, expect this to be present for non en-us languages. When - # unspecified, the default language code en-us applies. - class KnowledgeBase - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases KnowledgeBases.ListKnowledgeBases}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project to list of knowledge bases for. - # Format: `projects//locations/`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return in a single page. By - # default 10 and at most 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token value returned from a previous list request. - # @!attribute [rw] filter - # @return [::String] - # The filter expression used to filter knowledge bases returned by the list - # method. The expression has the following syntax: - # - # [AND ] ... - # - # The following fields and operators are supported: - # - # * display_name with has(:) operator - # * language_code with equals(=) operator - # - # Examples: - # - # * 'language_code=en-us' matches knowledge bases with en-us language code. - # * 'display_name:articles' matches knowledge bases whose display name - # contains "articles". - # * 'display_name:"Best Articles"' matches knowledge bases whose display - # name contains "Best Articles". - # * 'language_code=en-gb AND display_name=articles' matches all knowledge - # bases whose display name contains "articles" and whose language code is - # "en-gb". - # - # Note: An empty filter string (i.e. "") is a no-op and will result in no - # filtering. - # - # For more information about filtering, see - # [API Filtering](https://aip.dev/160). - class ListKnowledgeBasesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases KnowledgeBases.ListKnowledgeBases}. - # @!attribute [rw] knowledge_bases - # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeBase>] - # The list of knowledge bases. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListKnowledgeBasesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#get_knowledge_base KnowledgeBases.GetKnowledgeBase}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the knowledge base to retrieve. - # Format `projects//locations//knowledgeBases/`. - class GetKnowledgeBaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#create_knowledge_base KnowledgeBases.CreateKnowledgeBase}. - # @!attribute [rw] parent - # @return [::String] - # Required. The project to create a knowledge base for. - # Format: `projects//locations/`. - # @!attribute [rw] knowledge_base - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # Required. The knowledge base to create. - class CreateKnowledgeBaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#delete_knowledge_base KnowledgeBases.DeleteKnowledgeBase}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the knowledge base to delete. - # Format: `projects//locations//knowledgeBases/`. - # @!attribute [rw] force - # @return [::Boolean] - # Optional. Force deletes the knowledge base. When set to true, any documents - # in the knowledge base are also deleted. - class DeleteKnowledgeBaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#update_knowledge_base KnowledgeBases.UpdateKnowledgeBase}. - # @!attribute [rw] knowledge_base - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeBase] - # Required. The knowledge base to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Not specified means `update all`. - # Currently, only `display_name` can be updated, an InvalidArgument will be - # returned for attempting to update other fields. - class UpdateKnowledgeBaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/operations.rb deleted file mode 100644 index ddbb7a24b9dd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/operations.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 Dialogflow - module V2 - # Metadata for a - # {::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#create_generator_evaluation GeneratorEvaluations.CreateGeneratorEvaluation} - # operation. - # @!attribute [r] generator_evaluation - # @return [::String] - # Output only. The resource name of the generator evaluation. Format: - # `projects//locations//generators//evaluations/` - class GeneratorEvaluationOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb deleted file mode 100644 index 8d9a79153ed2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb +++ /dev/null @@ -1,1689 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Represents a conversation participant (human agent, virtual agent, end-user). - # @!attribute [rw] name - # @return [::String] - # Optional. The unique identifier of this participant. - # Format: `projects//locations//conversations//participants/`. - # @!attribute [rw] role - # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Immutable. The role this participant plays in the conversation. This field - # must be set during participant creation and is then immutable. - # @!attribute [rw] sip_recording_media_label - # @return [::String] - # Optional. Label applied to streams representing this participant in SIPREC - # XML metadata and SDP. This is used to assign transcriptions from that - # media stream to this participant. This field can be updated. - # @!attribute [rw] obfuscated_external_user_id - # @return [::String] - # Optional. Obfuscated user id that should be associated with the created - # participant. - # - # You can specify a user id as follows: - # - # 1. If you set this field in - # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest#participant CreateParticipantRequest} - # or - # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest#participant UpdateParticipantRequest}, - # Dialogflow adds the obfuscated user id with the participant. - # - # 2. If you set this field in - # [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] - # or [StreamingAnalyzeContent] - # [google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id], - # Dialogflow will update - # {::Google::Cloud::Dialogflow::V2::Participant#obfuscated_external_user_id Participant.obfuscated_external_user_id}. - # - # Dialogflow returns an error if you try to add a user id for a - # non-{::Google::Cloud::Dialogflow::V2::Participant::Role::END_USER END_USER} - # participant. - # - # Dialogflow uses this user id for billing and measurement purposes. For - # example, Dialogflow determines whether a user in one conversation returned - # in a later conversation. - # - # Additionally, to link an escalated Virtual Agent conversation - # with its corresponding Agent Assist conversation for analytics, this field - # in Agent Assist conversations should be populated to indicate the user id - # of the `END_USER` participant in the escalated conversation. - # - # Note: - # - # * Please never pass raw user ids to Dialogflow. Always obfuscate your user - # id first. - # * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a - # hash function like SHA-512. - # * The length of the user id must be <= 256 characters. - # @!attribute [rw] documents_metadata_filters - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Key-value filters on the metadata of documents returned by - # article suggestion. If specified, article suggestion only returns suggested - # documents that match all filters in their - # {::Google::Cloud::Dialogflow::V2::Document#metadata Document.metadata}. Multiple - # values for a metadata key should be concatenated by comma. For example, - # filters to match all documents that have 'US' or 'CA' in their market - # metadata values and 'agent' in their user metadata values will be - # ``` - # documents_metadata_filters { - # key: "market" - # value: "US,CA" - # } - # documents_metadata_filters { - # key: "user" - # value: "agent" - # } - # ``` - # @!attribute [rw] agent_desktop_source - # @return [::Google::Cloud::Dialogflow::V2::Participant::AgentDesktopSource] - # Optional. For tracking the utilization of prebuilt Agent Assist integration - # modules. This field is only inscope for Integration type that include UI - # Modules, Backend Modules, and Agent Desktop connector, it is out of scope - # for CCaaS and Direct Integration. - # For each human agent, prebuilt UI Modules needs to trigger the - # UpdateParticipant API to update this field. Both - # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest#participant CreateParticipantRequest} - # and - # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest#participant UpdateParticipantRequest} - # will be supported. - class Participant - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class DocumentsMetadataFiltersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enumeration of the roles a participant can play in a conversation. - module Role - # Participant role not set. - ROLE_UNSPECIFIED = 0 - - # Participant is a human agent. - HUMAN_AGENT = 1 - - # Participant is an automated agent, such as a Dialogflow agent. - AUTOMATED_AGENT = 2 - - # Participant is an end user that has called or chatted with - # Dialogflow services. - END_USER = 3 - end - - # Enumeration of the Agent Desktop Source when using prebuilt Agent - # Assist integration modules. - module AgentDesktopSource - # Agent Desktop Source is not specified. - AGENT_DESKTOP_SOURCE_UNSPECIFIED = 0 - - # Agent Desktop Source is Live Person. - LIVE_PERSON = 1 - - # Agent Desktop Source is Genesys Cloud. - GENESYS_CLOUD = 2 - - # Agent Desktop Source is Twilio. - TWILIO = 3 - - # Agent Desktop Source is Salesforce. - SALESFORCE = 4 - - # UI Modules are in use but the desktop is either not currently released or - # setting this field to the applicable desktop. - OTHER = 8 - end - end - - # Represents a message posted into a conversation. - # @!attribute [rw] name - # @return [::String] - # Optional. The unique identifier of the message. - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] content - # @return [::String] - # Required. The message content. - # @!attribute [rw] language_code - # @return [::String] - # Optional. The message language. - # This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - # language tag. Example: "en-US". - # @!attribute [r] participant - # @return [::String] - # Output only. The participant that sends this message. - # @!attribute [r] participant_role - # @return [::Google::Cloud::Dialogflow::V2::Participant::Role] - # Output only. The role of the participant. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the message was created in Contact Center AI. - # @!attribute [rw] send_time - # @return [::Google::Protobuf::Timestamp] - # Optional. The time when the message was sent. For voice messages, this is - # the time when an utterance started. - # @!attribute [r] message_annotation - # @return [::Google::Cloud::Dialogflow::V2::MessageAnnotation] - # Output only. The annotation for the message. - # @!attribute [r] sentiment_analysis - # @return [::Google::Cloud::Dialogflow::V2::SentimentAnalysisResult] - # Output only. The sentiment analysis result for the message. - class Message - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#create_participant Participants.CreateParticipant}. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource identifier of the conversation adding the participant. - # Format: `projects//locations//conversations/`. - # @!attribute [rw] participant - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # Required. The participant to create. - class CreateParticipantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#get_participant Participants.GetParticipant}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the participant. Format: - # `projects//locations//conversations//participants/`. - class GetParticipantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#list_participants Participants.ListParticipants}. - # @!attribute [rw] parent - # @return [::String] - # Required. The conversation to list all participants from. - # Format: `projects//locations//conversations/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListParticipantsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#list_participants Participants.ListParticipants}. - # @!attribute [rw] participants - # @return [::Array<::Google::Cloud::Dialogflow::V2::Participant>] - # The list of participants. There is a maximum number of items - # returned based on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results or empty if there are no - # more results in the list. - class ListParticipantsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#update_participant Participants.UpdateParticipant}. - # @!attribute [rw] participant - # @return [::Google::Cloud::Dialogflow::V2::Participant] - # Required. The participant to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to specify which fields to update. - class UpdateParticipantRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent}. - # @!attribute [rw] participant - # @return [::String] - # Required. The name of the participant this text comes from. - # Format: `projects//locations//conversations//participants/`. - # @!attribute [rw] text_input - # @return [::Google::Cloud::Dialogflow::V2::TextInput] - # The natural language text to be processed. - # - # Note: The following fields are mutually exclusive: `text_input`, `audio_input`, `event_input`, `suggestion_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] audio_input - # @return [::Google::Cloud::Dialogflow::V2::AudioInput] - # The natural language speech audio to be processed. - # - # Note: The following fields are mutually exclusive: `audio_input`, `text_input`, `event_input`, `suggestion_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] event_input - # @return [::Google::Cloud::Dialogflow::V2::EventInput] - # An input event to send to Dialogflow. - # - # Note: The following fields are mutually exclusive: `event_input`, `text_input`, `audio_input`, `suggestion_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] suggestion_input - # @return [::Google::Cloud::Dialogflow::V2::SuggestionInput] - # An input representing the selection of a suggestion. - # - # Note: The following fields are mutually exclusive: `suggestion_input`, `text_input`, `audio_input`, `event_input`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] reply_audio_config - # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] - # Speech synthesis configuration. - # The speech synthesis settings for a virtual agent that may be configured - # for the associated conversation profile are not used when calling - # AnalyzeContent. If this configuration is not supplied, speech synthesis - # is disabled. - # @!attribute [rw] query_params - # @return [::Google::Cloud::Dialogflow::V2::QueryParameters] - # Parameters for a Dialogflow virtual-agent query. - # @!attribute [rw] assist_query_params - # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] - # Parameters for a human assist query. - # @!attribute [rw] cx_parameters - # @return [::Google::Protobuf::Struct] - # Additional parameters to be put into Dialogflow CX session parameters. To - # remove a parameter from the session, clients should explicitly set the - # parameter value to null. - # - # Note: this field should only be used if you are connecting to a Dialogflow - # CX agent. - # @!attribute [rw] request_id - # @return [::String] - # A unique identifier for this request. Restricted to 36 ASCII characters. - # A random UUID is recommended. - # This request is only idempotent if a `request_id` is provided. - class AnalyzeContentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message in the response that indicates the parameters of DTMF. - # @!attribute [rw] accepts_dtmf_input - # @return [::Boolean] - # Indicates whether DTMF input can be handled in the next request. - class DtmfParameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent}. - # @!attribute [rw] reply_text - # @return [::String] - # The output text content. - # This field is set if the automated agent responded with text to show to - # the user. - # @!attribute [rw] reply_audio - # @return [::Google::Cloud::Dialogflow::V2::OutputAudio] - # The audio data bytes encoded as specified in the request. - # This field is set if: - # - # - `reply_audio_config` was specified in the request, or - # - The automated agent responded with audio to play to the user. In such - # case, `reply_audio.config` contains settings used to synthesize the - # speech. - # - # In some scenarios, multiple output audio fields may be present in the - # response structure. In these cases, only the top-most-level audio output - # has content. - # @!attribute [rw] automated_agent_reply - # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentReply] - # Only set if a Dialogflow automated agent has responded. - # Note that in [AutomatedAgentReply.DetectIntentResponse][], - # [Sessions.DetectIntentResponse.output_audio][] - # and [Sessions.DetectIntentResponse.output_audio_config][] - # are always empty, use - # {::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse#reply_audio reply_audio} - # instead. - # @!attribute [rw] message - # @return [::Google::Cloud::Dialogflow::V2::Message] - # Message analyzed by CCAI. - # @!attribute [rw] human_agent_suggestion_results - # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] - # The suggestions for most recent human agent. The order is the same as - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} - # of - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#human_agent_suggestion_config HumanAgentAssistantConfig.human_agent_suggestion_config}. - # - # Note that any failure of Agent Assist features will not lead to the overall - # failure of an AnalyzeContent API call. Instead, the features will - # fail silently with the error field set in the corresponding - # SuggestionResult. - # @!attribute [rw] end_user_suggestion_results - # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] - # The suggestions for end user. The order is the same as - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} - # of - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#end_user_suggestion_config HumanAgentAssistantConfig.end_user_suggestion_config}. - # - # Same as human_agent_suggestion_results, any failure of Agent Assist - # features will not lead to the overall failure of an AnalyzeContent API - # call. Instead, the features will fail silently with the error field set in - # the corresponding SuggestionResult. - # @!attribute [rw] dtmf_parameters - # @return [::Google::Cloud::Dialogflow::V2::DtmfParameters] - # Indicates the parameters of DTMF. - class AnalyzeContentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message sent by the client to the - # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} - # method. - # - # Multiple request messages should be sent in order: - # - # 1. The first message must contain - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#participant participant}, - # [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] - # and optionally - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#query_params query_params}. - # If you want to receive an audio response, it should also contain - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#reply_audio_config reply_audio_config}. - # The message must not contain - # [input][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input]. - # - # 2. If - # [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in - # the first message - # was set to - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#audio_config audio_config}, - # all subsequent messages must contain - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#input_audio input_audio} - # to continue with Speech recognition. However, note that: - # - # * Dialogflow will bill you for the audio so far. - # * Dialogflow discards all Speech recognition results in favor of the - # text input. - # - # 3. If - # [StreamingAnalyzeContentRequest.config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] - # in the first message was set - # to - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#text_config StreamingAnalyzeContentRequest.text_config}, - # then the second message must contain only - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#input_text input_text}. - # Moreover, you must not send more than two messages. - # - # After you sent all input, you must half-close or abort the request stream. - # @!attribute [rw] participant - # @return [::String] - # Required. The name of the participant this text comes from. - # Format: `projects//locations//conversations//participants/`. - # @!attribute [rw] audio_config - # @return [::Google::Cloud::Dialogflow::V2::InputAudioConfig] - # Instructs the speech recognizer how to process the speech audio. - # - # Note: The following fields are mutually exclusive: `audio_config`, `text_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_config - # @return [::Google::Cloud::Dialogflow::V2::InputTextConfig] - # The natural language text to be processed. - # - # Note: The following fields are mutually exclusive: `text_config`, `audio_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] reply_audio_config - # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] - # Speech synthesis configuration. - # The speech synthesis settings for a virtual agent that may be configured - # for the associated conversation profile are not used when calling - # StreamingAnalyzeContent. If this configuration is not supplied, speech - # synthesis is disabled. - # @!attribute [rw] input_audio - # @return [::String] - # The input audio content to be recognized. Must be sent if `audio_config` - # is set in the first message. The complete audio over all streaming - # messages must not exceed 1 minute. - # - # Note: The following fields are mutually exclusive: `input_audio`, `input_text`, `input_dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] input_text - # @return [::String] - # The UTF-8 encoded natural language text to be processed. Must be sent if - # `text_config` is set in the first message. Text length must not exceed - # 256 bytes for virtual agent interactions. The `input_text` field can be - # only sent once, and would cancel the speech recognition if any ongoing. - # - # Note: The following fields are mutually exclusive: `input_text`, `input_audio`, `input_dtmf`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] input_dtmf - # @return [::Google::Cloud::Dialogflow::V2::TelephonyDtmfEvents] - # The DTMF digits used to invoke intent and fill in parameter value. - # - # This input is ignored if the previous response indicated that DTMF input - # is not accepted. - # - # Note: The following fields are mutually exclusive: `input_dtmf`, `input_audio`, `input_text`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] query_params - # @return [::Google::Cloud::Dialogflow::V2::QueryParameters] - # Parameters for a Dialogflow virtual-agent query. - # @!attribute [rw] assist_query_params - # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] - # Parameters for a human assist query. - # @!attribute [rw] cx_parameters - # @return [::Google::Protobuf::Struct] - # Additional parameters to be put into Dialogflow CX session parameters. To - # remove a parameter from the session, clients should explicitly set the - # parameter value to null. - # - # Note: this field should only be used if you are connecting to a Dialogflow - # CX agent. - # @!attribute [rw] enable_extended_streaming - # @return [::Boolean] - # Optional. Enable full bidirectional streaming. You can keep streaming the - # audio until timeout, and there's no need to half close the stream to get - # the response. - # - # Restrictions: - # - # - Timeout: 3 mins. - # - Audio Encoding: only supports - # {::Google::Cloud::Dialogflow::V2::AudioEncoding::AUDIO_ENCODING_LINEAR_16 AudioEncoding.AUDIO_ENCODING_LINEAR_16} - # and - # {::Google::Cloud::Dialogflow::V2::AudioEncoding::AUDIO_ENCODING_MULAW AudioEncoding.AUDIO_ENCODING_MULAW} - # - Lifecycle: conversation should be in `Assist Stage`, go to - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#create_conversation Conversations.CreateConversation} - # for more information. - # - # InvalidArgument Error will be returned if the one of restriction checks - # failed. - # - # You can find more details in - # https://cloud.google.com/agent-assist/docs/extended-streaming - # @!attribute [rw] enable_partial_automated_agent_reply - # @return [::Boolean] - # Optional. Enable partial responses from Dialogflow CX agent. If this flag - # is not enabled, response stream still contains only one final response even - # if some `Fulfillment`s in Dialogflow CX agent have been configured to - # return partial responses. - # @!attribute [rw] output_multiple_utterances - # @return [::Boolean] - # Optional. If multiple uttereances are detected in the audio stream, process - # them individually instead of stitching them together to form a single - # utterance. - # @!attribute [rw] enable_debugging_info - # @return [::Boolean] - # If true, `StreamingAnalyzeContentResponse.debugging_info` will get - # populated. - class StreamingAnalyzeContentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message returned from the `StreamingAnalyzeContent` method. - # - # Multiple response messages can be returned in order: - # - # 1. If the input was set to streaming audio, the first one or more messages - # contain `recognition_result`. Each `recognition_result` represents a more - # complete transcript of what the user said. When a user speaks multiple - # sentences, the API will emit multiple messages where `is_final = true`. - # Each time the system detects a distinct pause or completed thought, it - # locks in that segment, marks it `is_final = true`, and then immediately - # starts a new recognition cycle for the next sentence on the same stream. - # - # 2. In virtual agent stage: if `enable_partial_automated_agent_reply` is - # true, the following N (currently 1 <= N <= 4) messages - # contain `automated_agent_reply` and optionally `reply_audio` - # returned by the virtual agent. The first (N-1) - # `automated_agent_reply`s will have `automated_agent_reply_type` set to - # `PARTIAL`. The last `automated_agent_reply` has - # `automated_agent_reply_type` set to `FINAL`. - # If `enable_partial_automated_agent_reply` is not enabled, response stream - # only contains the final reply. - # - # In human assist stage: the following N (N >= 1) messages contain - # `human_agent_suggestion_results`, `end_user_suggestion_results` or - # `message`. - # @!attribute [rw] recognition_result - # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult] - # The result of speech recognition. - # @!attribute [rw] reply_text - # @return [::String] - # The output text content. - # This field is set if an automated agent responded with a text for the user. - # @!attribute [rw] reply_audio - # @return [::Google::Cloud::Dialogflow::V2::OutputAudio] - # The audio data bytes encoded as specified in the request. - # This field is set if: - # - # - The `reply_audio_config` field is specified in the request. - # - The automated agent, which this output comes from, responded with audio. - # In such case, the `reply_audio.config` field contains settings used to - # synthesize the speech. - # - # In some scenarios, multiple output audio fields may be present in the - # response structure. In these cases, only the top-most-level audio output - # has content. - # @!attribute [rw] automated_agent_reply - # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentReply] - # Note that in [AutomatedAgentReply.DetectIntentResponse][], - # [Sessions.DetectIntentResponse.output_audio][] - # and [Sessions.DetectIntentResponse.output_audio_config][] - # are always empty, use - # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#reply_audio reply_audio} - # instead. - # @!attribute [rw] message - # @return [::Google::Cloud::Dialogflow::V2::Message] - # Message analyzed by CCAI. - # @!attribute [rw] human_agent_suggestion_results - # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] - # The suggestions for most recent human agent. The order is the same as - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} - # of - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#human_agent_suggestion_config HumanAgentAssistantConfig.human_agent_suggestion_config}. - # @!attribute [rw] end_user_suggestion_results - # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] - # The suggestions for end user. The order is the same as - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} - # of - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#end_user_suggestion_config HumanAgentAssistantConfig.end_user_suggestion_config}. - # @!attribute [rw] dtmf_parameters - # @return [::Google::Cloud::Dialogflow::V2::DtmfParameters] - # Indicates the parameters of DTMF. - # @!attribute [rw] debugging_info - # @return [::Google::Cloud::Dialogflow::V2::CloudConversationDebuggingInfo] - # Debugging info that would get populated when - # `StreamingAnalyzeContentRequest.enable_debugging_info` is set to true. - # @!attribute [rw] speech_model - # @return [::String] - # The name of the actual Cloud speech model used for speech recognition. - class StreamingAnalyzeContentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles Participants.SuggestArticles}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the participant to fetch suggestion for. - # Format: `projects//locations//conversations//participants/`. - # @!attribute [rw] latest_message - # @return [::String] - # Optional. The name of the latest conversation message to compile suggestion - # for. If empty, it will be the latest message of the conversation. - # - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Optional. Max number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#latest_message latest_message} - # to use as context when compiling the suggestion. By default 20 and at - # most 50. - # @!attribute [rw] assist_query_params - # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] - # Parameters for a human assist query. - class SuggestArticlesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles Participants.SuggestArticles}. - # @!attribute [rw] article_answers - # @return [::Array<::Google::Cloud::Dialogflow::V2::ArticleAnswer>] - # Articles ordered by score in descending order. - # @!attribute [rw] latest_message - # @return [::String] - # The name of the latest conversation message used to compile - # suggestion for. - # - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse#latest_message latest_message} - # to compile the suggestion. It may be smaller than the - # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#context_size SuggestArticlesRequest.context_size} - # field in the request if there aren't that many messages in the - # conversation. - class SuggestArticlesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_faq_answers Participants.SuggestFaqAnswers}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the participant to fetch suggestion for. - # Format: `projects//locations//conversations//participants/`. - # @!attribute [rw] latest_message - # @return [::String] - # Optional. The name of the latest conversation message to compile suggestion - # for. If empty, it will be the latest message of the conversation. - # - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Optional. Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 20 and at most 50. - # @!attribute [rw] assist_query_params - # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] - # Parameters for a human assist query. - class SuggestFaqAnswersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_faq_answers Participants.SuggestFaqAnswers}. - # @!attribute [rw] faq_answers - # @return [::Array<::Google::Cloud::Dialogflow::V2::FaqAnswer>] - # Answers extracted from FAQ documents. - # @!attribute [rw] latest_message - # @return [::String] - # The name of the latest conversation message used to compile - # suggestion for. - # - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse#latest_message latest_message} - # to compile the suggestion. It may be smaller than the - # {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest#context_size SuggestFaqAnswersRequest.context_size} - # field in the request if there aren't that many messages in the - # conversation. - class SuggestFaqAnswersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_suggestions Conversations.GenerateSuggestions}. - # @!attribute [rw] generator_suggestion_answers - # @return [::Array<::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse::GeneratorSuggestionAnswer>] - # The answers generated for the conversation based on context. - # @!attribute [rw] latest_message - # @return [::String] - # The name of the latest conversation message used as context for - # compiling suggestion. - # - # Format: `projects//locations//conversations//messages/`. - class GenerateSuggestionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A GeneratorSuggestion answer. - # @!attribute [rw] generator_suggestion - # @return [::Google::Cloud::Dialogflow::V2::GeneratorSuggestion] - # Suggestion details. - # @!attribute [rw] source_generator - # @return [::String] - # The name of the generator used to generate this suggestion. Format: - # `projects//locations//generators/`. - # @!attribute [rw] answer_record - # @return [::String] - # Answer record that uniquely identifies the suggestion. This can be used - # to provide suggestion feedback. - class GeneratorSuggestionAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_smart_replies Participants.SuggestSmartReplies}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the participant to fetch suggestion for. - # Format: `projects//locations//conversations//participants/`. - # @!attribute [rw] current_text_input - # @return [::Google::Cloud::Dialogflow::V2::TextInput] - # The current natural language text segment to compile suggestion - # for. This provides a way for user to get follow up smart reply suggestion - # after a smart reply selection, without sending a text message. - # @!attribute [rw] latest_message - # @return [::String] - # The name of the latest conversation message to compile suggestion - # for. If empty, it will be the latest message of the conversation. - # - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Max number of messages prior to and including - # [latest_message] to use as context when compiling the - # suggestion. By default 20 and at most 50. - class SuggestSmartRepliesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_smart_replies Participants.SuggestSmartReplies}. - # @!attribute [r] smart_reply_answers - # @return [::Array<::Google::Cloud::Dialogflow::V2::SmartReplyAnswer>] - # Output only. Multiple reply options provided by smart reply service. The - # order is based on the rank of the model prediction. - # The maximum number of the returned replies is set in SmartReplyConfig. - # @!attribute [rw] latest_message - # @return [::String] - # The name of the latest conversation message used to compile - # suggestion for. - # - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse#latest_message latest_message} - # to compile the suggestion. It may be smaller than the - # {::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest#context_size SuggestSmartRepliesRequest.context_size} - # field in the request if there aren't that many messages in the - # conversation. - class SuggestSmartRepliesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the natural language speech audio to be processed. - # @!attribute [rw] config - # @return [::Google::Cloud::Dialogflow::V2::InputAudioConfig] - # Required. Instructs the speech recognizer how to process the speech audio. - # @!attribute [rw] audio - # @return [::String] - # Required. The natural language speech audio to be processed. - # A single request can contain up to 2 minutes of speech audio data. - # The transcribed text cannot contain more than 256 bytes for virtual agent - # interactions. - class AudioInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the natural language speech audio to be played to the end user. - # @!attribute [rw] config - # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] - # Instructs the speech synthesizer how to generate the speech - # audio. - # @!attribute [rw] audio - # @return [::String] - # The natural language speech audio. - class OutputAudio - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a response from an automated agent. - # @!attribute [rw] detect_intent_response - # @return [::Google::Cloud::Dialogflow::V2::DetectIntentResponse] - # Response of the Dialogflow - # {::Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent Sessions.DetectIntent} - # call. - # @!attribute [rw] automated_agent_reply_type - # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentReply::AutomatedAgentReplyType] - # AutomatedAgentReply type. - # @!attribute [rw] allow_cancellation - # @return [::Boolean] - # Indicates whether the partial automated agent reply is interruptible when a - # later reply message arrives. e.g. if the agent specified some music as - # partial response, it can be cancelled. - # @!attribute [rw] cx_current_page - # @return [::String] - # The unique identifier of the current Dialogflow CX conversation page. - # Format: `projects//locations//agents//flows//pages/`. - class AutomatedAgentReply - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents different automated agent reply types. - module AutomatedAgentReplyType - # Not specified. This should never happen. - AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED = 0 - - # Partial reply. e.g. Aggregated responses in a `Fulfillment` that enables - # `return_partial_response` can be returned as partial reply. - # WARNING: partial reply is not eligible for barge-in. - PARTIAL = 1 - - # Final reply. - FINAL = 2 - end - end - - # Represents article answer. - # @!attribute [rw] title - # @return [::String] - # The article title. - # @!attribute [rw] uri - # @return [::String] - # The article URI. - # @!attribute [rw] snippets - # @return [::Array<::String>] - # Article snippets. - # @!attribute [rw] confidence - # @return [::Float] - # Article match confidence. - # The system's confidence score that this article is a good match for this - # conversation, as a value from 0.0 (completely uncertain) to 1.0 - # (completely certain). - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # A map that contains metadata about the answer and the - # document from which it originates. - # @!attribute [rw] answer_record - # @return [::String] - # The name of answer record, in the format of - # "projects//locations//answerRecords/" - class ArticleAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents answer from "frequently asked questions". - # @!attribute [rw] answer - # @return [::String] - # The piece of text from the `source` knowledge base document. - # @!attribute [rw] confidence - # @return [::Float] - # The system's confidence score that this Knowledge answer is a good match - # for this conversational query, range from 0.0 (completely uncertain) - # to 1.0 (completely certain). - # @!attribute [rw] question - # @return [::String] - # The corresponding FAQ question. - # @!attribute [rw] source - # @return [::String] - # Indicates which Knowledge Document this answer was extracted - # from. - # Format: `projects//locations//agent/knowledgeBases//documents/`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # A map that contains metadata about the answer and the - # document from which it originates. - # @!attribute [rw] answer_record - # @return [::String] - # The name of answer record, in the format of - # "projects//locations//answerRecords/" - class FaqAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents a smart reply answer. - # @!attribute [rw] reply - # @return [::String] - # The content of the reply. - # @!attribute [rw] confidence - # @return [::Float] - # Smart reply confidence. - # The system's confidence score that this reply is a good match for - # this conversation, as a value from 0.0 (completely uncertain) to 1.0 - # (completely certain). - # @!attribute [rw] answer_record - # @return [::String] - # The name of answer record, in the format of - # "projects//locations//answerRecords/" - class SmartReplyAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an intent suggestion. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the intent. - # @!attribute [rw] intent_v2 - # @return [::String] - # The unique identifier of this - # {::Google::Cloud::Dialogflow::V2::Intent intent}. Format: `projects//locations//agent/intents/`. - # @!attribute [rw] description - # @return [::String] - # Human readable description for better understanding an intent like its - # scope, content, result etc. Maximum character limit: 140 characters. - class IntentSuggestion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a Dialogflow assist answer. - # @!attribute [rw] query_result - # @return [::Google::Cloud::Dialogflow::V2::QueryResult] - # Result from v2 agent. - # - # Note: The following fields are mutually exclusive: `query_result`, `intent_suggestion`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] intent_suggestion - # @return [::Google::Cloud::Dialogflow::V2::IntentSuggestion] - # An intent suggestion generated from conversation. - # - # Note: The following fields are mutually exclusive: `intent_suggestion`, `query_result`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] answer_record - # @return [::String] - # The name of answer record, in the format of - # "projects//locations//answerRecords/" - class DialogflowAssistAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One response of different type of suggestion response which is used in - # the response of - # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} - # and - # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent}, - # as well as - # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantEvent HumanAgentAssistantEvent}. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # Error status if the request failed. - # - # Note: The following fields are mutually exclusive: `error`, `suggest_articles_response`, `suggest_knowledge_assist_response`, `suggest_faq_answers_response`, `suggest_smart_replies_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] suggest_articles_response - # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse] - # SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. - # - # Note: The following fields are mutually exclusive: `suggest_articles_response`, `error`, `suggest_knowledge_assist_response`, `suggest_faq_answers_response`, `suggest_smart_replies_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] suggest_knowledge_assist_response - # @return [::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse] - # SuggestKnowledgeAssistResponse if request is for KNOWLEDGE_ASSIST. - # - # Note: The following fields are mutually exclusive: `suggest_knowledge_assist_response`, `error`, `suggest_articles_response`, `suggest_faq_answers_response`, `suggest_smart_replies_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] suggest_faq_answers_response - # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse] - # SuggestFaqAnswersResponse if request is for FAQ_ANSWER. - # - # Note: The following fields are mutually exclusive: `suggest_faq_answers_response`, `error`, `suggest_articles_response`, `suggest_knowledge_assist_response`, `suggest_smart_replies_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] suggest_smart_replies_response - # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse] - # SuggestSmartRepliesResponse if request is for SMART_REPLY. - # - # Note: The following fields are mutually exclusive: `suggest_smart_replies_response`, `error`, `suggest_articles_response`, `suggest_knowledge_assist_response`, `suggest_faq_answers_response`, `generate_suggestions_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] generate_suggestions_response - # @return [::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse] - # Suggestions generated using generators triggered by customer or agent - # messages. - # - # Note: The following fields are mutually exclusive: `generate_suggestions_response`, `error`, `suggest_articles_response`, `suggest_knowledge_assist_response`, `suggest_faq_answers_response`, `suggest_smart_replies_response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class SuggestionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines the language used in the input text. - # @!attribute [rw] language_code - # @return [::String] - # Required. The language of this conversational query. See [Language - # Support](https://cloud.google.com/dialogflow/docs/reference/language) - # for a list of the currently supported language codes. - class InputTextConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a part of a message possibly annotated with an entity. The part - # can be an entity or purely a part of the message between two entities or - # message start/end. - # @!attribute [rw] text - # @return [::String] - # A part of a message possibly annotated with an entity. - # @!attribute [rw] entity_type - # @return [::String] - # The [Dialogflow system entity - # type](https://cloud.google.com/dialogflow/docs/reference/system-entities) - # of this message part. If this is empty, Dialogflow could not annotate the - # phrase part with a system entity. - # @!attribute [rw] formatted_value - # @return [::Google::Protobuf::Value] - # The [Dialogflow system entity formatted value - # ](https://cloud.google.com/dialogflow/docs/reference/system-entities) of - # this message part. For example for a system entity of type - # `@sys.unit-currency`, this may contain: - #
-        #     {
-        #       "amount": 5,
-        #       "currency": "USD"
-        #     }
-        #     
- class AnnotatedMessagePart - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the result of annotation for the message. - # @!attribute [rw] parts - # @return [::Array<::Google::Cloud::Dialogflow::V2::AnnotatedMessagePart>] - # The collection of annotated message parts ordered by their - # position in the message. You can recover the annotated message by - # concatenating [AnnotatedMessagePart.text]. - # @!attribute [rw] contain_entities - # @return [::Boolean] - # Indicates whether the text message contains entities. - class MessageAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the action to take for a tool call that requires confirmation. - # @!attribute [rw] answer_record - # @return [::String] - # Required. Format: `projects//locations//answerRecords/` - # The answer record associated with the tool call. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Struct] - # Optional. Parameters to be used for the tool call. If not provided, the - # tool will be called without any parameters. - # @!attribute [rw] action - # @return [::Google::Cloud::Dialogflow::V2::SuggestionInput::Action] - # Optional. The type of action to take with the tool. - # @!attribute [rw] send_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Time when the current suggest input is sent. For tool calls, this - # timestamp (along with the answer record) will be included in the - # corresponding tool call result so that it can be identified. - class SuggestionInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicate what type of action to take with the tool call. - module Action - # Action not specified. - ACTION_UNSPECIFIED = 0 - - # Indicates the user chooses to not make the tool call. It - # is only applicable to tool calls that are waiting for user - # confirmation. - CANCEL = 1 - - # Makes the tool call with provided parameters. This action is intended - # for tool calls that only read but not write data. - REVISE = 2 - - # Makes the tool call with provided parameters. This action is intended - # for tool calls that may write data. - CONFIRM = 3 - end - end - - # Represents the parameters of human assist query. - # @!attribute [rw] documents_metadata_filters - # @return [::Google::Protobuf::Map{::String => ::String}] - # Key-value filters on the metadata of documents returned by article - # suggestion. If specified, article suggestion only returns suggested - # documents that match all filters in their - # {::Google::Cloud::Dialogflow::V2::Document#metadata Document.metadata}. Multiple - # values for a metadata key should be concatenated by comma. For example, - # filters to match all documents that have 'US' or 'CA' in their market - # metadata values and 'agent' in their user metadata values will be - # ``` - # documents_metadata_filters { - # key: "market" - # value: "US,CA" - # } - # documents_metadata_filters { - # key: "user" - # value: "agent" - # } - # ``` - class AssistQueryParameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class DocumentsMetadataFiltersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist Participants.SuggestKnowledgeAssist}. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the participant to fetch suggestions for. - # Format: `projects//locations//conversations//participants/`. - # @!attribute [rw] latest_message - # @return [::String] - # Optional. The name of the latest conversation message to compile - # suggestions for. If empty, it will be the latest message of the - # conversation. Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Optional. Max number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest#latest_message latest_message} - # to use as context when compiling the suggestion. The context size is by - # default 100 and at most 100. - # @!attribute [rw] previous_suggested_query - # @return [::String] - # Optional. The previously suggested query for the given conversation. This - # helps identify whether the next suggestion we generate is reasonably - # different from the previous one. This is useful to avoid similar - # suggestions within the conversation. - class SuggestKnowledgeAssistRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist Participants.SuggestKnowledgeAssist}. - # @!attribute [r] knowledge_assist_answer - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer] - # Output only. Knowledge Assist suggestion. - # @!attribute [rw] latest_message - # @return [::String] - # The name of the latest conversation message used to compile suggestion for. - # Format: `projects//locations//conversations//messages/`. - # @!attribute [rw] context_size - # @return [::Integer] - # Number of messages prior to and including - # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse#latest_message latest_message} - # to compile the suggestion. It may be smaller than the - # {::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest#context_size SuggestKnowledgeAssistRequest.context_size} - # field in the request if there are fewer messages in the conversation. - # @!attribute [rw] additional_suggested_query_results - # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::AdditionalSuggestedQueryResult>] - # Optional. The list of additional suggested queries based on the context. - # This is used for the cases when we want to generate multiple queries - # for a single request. - class SuggestKnowledgeAssistResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Debug information related to ingested context reference. - # @!attribute [rw] project_not_allowlisted - # @return [::Boolean] - # Indicates if the project is allowlisted to use ingested context - # reference. - # @!attribute [rw] context_reference_retrieved - # @return [::Boolean] - # The status of context_reference retrieval from database. - # @!attribute [rw] ingested_parameters_debug_info - # @return [::Array<::Google::Cloud::Dialogflow::V2::IngestedContextReferenceDebugInfo::IngestedParameterDebugInfo>] - # Parameters ingested from the context reference. - class IngestedContextReferenceDebugInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Debug information related to ingested parameters from context reference. - # @!attribute [rw] parameter - # @return [::String] - # The name of the parameter in the context reference. - # @!attribute [rw] ingestion_status - # @return [::Google::Cloud::Dialogflow::V2::IngestedContextReferenceDebugInfo::IngestedParameterDebugInfo::IngestionStatus] - # The ingestion status for this specific parameter. - class IngestedParameterDebugInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum representing the various states of parameter ingestion. - module IngestionStatus - # Default value, indicates that the ingestion status is not specified. - INGESTION_STATUS_UNSPECIFIED = 0 - - # Indicates that the parameter was successfully ingested. - INGESTION_STATUS_SUCCEEDED = 1 - - # Indicates that the parameter was not available for ingestion. - INGESTION_STATUS_CONTEXT_NOT_AVAILABLE = 2 - - # Indicates that there was a failure parsing the parameter content. - INGESTION_STATUS_PARSE_FAILED = 3 - - # Indicates that the context reference had an unexpected number of - # content entries as Context reference should only have one entry. - INGESTION_STATUS_INVALID_ENTRY = 4 - - # Indicates that the context reference content was not in the expected - # format (e.g., JSON). - INGESTION_STATUS_INVALID_FORMAT = 5 - - # Indicates that the context reference language does not match the - # conversation language. - INGESTION_STATUS_LANGUAGE_MISMATCH = 6 - end - end - end - - # Message to represent the latency of the service. - # @!attribute [rw] internal_service_latencies - # @return [::Array<::Google::Cloud::Dialogflow::V2::ServiceLatency::InternalServiceLatency>] - # A list of internal service latencies. - class ServiceLatency - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message to represent the latency of an internal service. - # @!attribute [rw] step - # @return [::String] - # The name of the internal service. - # @!attribute [rw] latency_ms - # @return [::Float] - # The latency of the internal service in milliseconds. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The start time of the internal service. - # @!attribute [rw] complete_time - # @return [::Google::Protobuf::Timestamp] - # The completion time of the internal service. - class InternalServiceLatency - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Debug information related to Knowledge Assist feature. - # @!attribute [rw] query_generation_failure_reason - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo::QueryGenerationFailureReason] - # Reason for query generation. - # @!attribute [rw] query_categorization_failure_reason - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo::QueryCategorizationFailureReason] - # Reason for query categorization. - # @!attribute [rw] datastore_response_reason - # @return [::Google::Cloud::Dialogflow::V2::DatastoreResponseReason] - # Response reason from datastore which indicates data serving status or - # answer quality degradation. - # @!attribute [rw] knowledge_assist_behavior - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo::KnowledgeAssistBehavior] - # Configured behaviors for Knowedge Assist. - # @!attribute [rw] ingested_context_reference_debug_info - # @return [::Google::Cloud::Dialogflow::V2::IngestedContextReferenceDebugInfo] - # Information about parameters ingested for search knowledge. - # @!attribute [rw] service_latency - # @return [::Google::Cloud::Dialogflow::V2::ServiceLatency] - # The latency of the service. - # @!attribute [rw] query_generation_debug_info - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo::QueryGenerationDebugInfo] - # Token usage metadata for query generation. - # @!attribute [rw] ces_debug_info - # @return [::Google::Protobuf::Struct] - # Debug information from CES runtime API. - class KnowledgeAssistDebugInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configured behaviors for Knowedge Assist. - # @!attribute [rw] answer_generation_rewriter_on - # @return [::Boolean] - # Whether data store agent rewriter was turned off for the request. - # @!attribute [rw] end_user_metadata_included - # @return [::Boolean] - # Whether end_user_metadata is included in the data store agent call. - # @!attribute [rw] return_query_only - # @return [::Boolean] - # Whether customers configured to return query only in the - # conversation profile. - # @!attribute [rw] use_pubsub_delivery - # @return [::Boolean] - # Whether customers configured to use pubsub to deliver. - # @!attribute [rw] disable_sync_delivery - # @return [::Boolean] - # Whether customers configured to disable the synchronous delivery of - # Knowedge Assist response. - # @!attribute [rw] previous_queries_included - # @return [::Boolean] - # Whether previously suggested queries are included in the query generation - # process. - # @!attribute [rw] use_translated_message - # @return [::Boolean] - # Translated message is included in query generation process. - # @!attribute [rw] use_custom_safety_filter_level - # @return [::Boolean] - # Safety filter is adjusted by user. - # @!attribute [rw] conversation_transcript_has_mixed_languages - # @return [::Boolean] - # Conversation transcript has mixed languages. - # @!attribute [rw] query_generation_agent_language_mismatch - # @return [::Boolean] - # Whether the agent language from the translation generator mismatches the - # end-user language. - # @!attribute [rw] query_generation_end_user_language_mismatch - # @return [::Boolean] - # Whether the end-user language from the translation generator mismatches - # the end-user language. - # @!attribute [rw] third_party_connector_allowed - # @return [::Boolean] - # This field indicates whether third party connectors are enabled for the - # project - # @!attribute [rw] multiple_queries_generated - # @return [::Boolean] - # Indicates that the query generation model generated multiple queries. - # @!attribute [rw] query_contained_search_context - # @return [::Boolean] - # Indicates that the generated query contains search context. - # @!attribute [rw] invalid_items_query_suggestion_skipped - # @return [::Boolean] - # Indicates that invalid items were skipped when parsing the LLM response. - # @!attribute [rw] primary_query_redacted_and_replaced - # @return [::Boolean] - # True if the primary suggested query was redacted and replaced by an - # additional query. - # @!attribute [rw] appended_search_context_count - # @return [::Integer] - # The number of search contexts appended to the query. - class KnowledgeAssistBehavior - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Token usage metadata for query generation. - # @!attribute [rw] prompt_token_count - # @return [::Integer] - # The total number of tokens in the prompt. - # @!attribute [rw] candidates_token_count - # @return [::Integer] - # The total number of tokens in the generated candidates. - # @!attribute [rw] total_token_count - # @return [::Integer] - # The total number of tokens for the entire request. - class QueryGenerationDebugInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Reason for query generation failure. - module QueryGenerationFailureReason - # Default value. - QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED = 0 - - # Query generation is blocked due to out of quota. - QUERY_GENERATION_OUT_OF_QUOTA = 1 - - # Call to Knowedge Assist query generation model fails. - QUERY_GENERATION_FAILED = 2 - - # Query generation model decides that there is no new topic change or - # there has been similar queries generated in the previous turns. - QUERY_GENERATION_NO_QUERY_GENERATED = 3 - - # Knowedge Assist generated query is blocked by RAI (Responsible AI). - QUERY_GENERATION_RAI_FAILED = 4 - - # Query generation is blocked by Knowledge Assist conversation profile - # level / agent id level filtering. - NOT_IN_ALLOWLIST = 5 - - # The generated query is blocked due to redaction. - QUERY_GENERATION_QUERY_REDACTED = 6 - - # Query generation failed due to LLM response parse failure. - QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED = 10 - - # The conversation has no messages. - QUERY_GENERATION_EMPTY_CONVERSATION = 11 - - # The last message in the conversation is empty. - QUERY_GENERATION_EMPTY_LAST_MESSAGE = 12 - - # The trigger event condition is not met. - # This occurs in the following scenarios: - # 1. The trigger_event is CUSTOMER_MESSAGE or UNSPECIFIED, but the last - # message is not from the customer. - # 2. The trigger_event is AGENT_MESSAGE, but the last message is not from - # the agent. - QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET = 13 - end - - # Reason for query categorization failure. - module QueryCategorizationFailureReason - # Default value. - QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED = 0 - - # Vertex AI Search config supplied for query categorization is invalid. - QUERY_CATEGORIZATION_INVALID_CONFIG = 1 - - # Vertex AI Search result does not contain a query categorization result. - QUERY_CATEGORIZATION_RESULT_NOT_FOUND = 2 - - # Vertex AI Search call fails. - QUERY_CATEGORIZATION_FAILED = 3 - end - end - - # Represents a Knowledge Assist answer. - # @!attribute [rw] suggested_query - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::SuggestedQuery] - # The query suggested based on the context. Suggestion is made only if it - # is different from the previous suggestion. - # @!attribute [rw] suggested_query_answer - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer] - # The answer generated for the suggested query. Whether or not an answer is - # generated depends on how confident we are about the generated query. - # @!attribute [rw] answer_record - # @return [::String] - # The name of the answer record. - # Format: `projects//locations//answer - # Records/`. - # @!attribute [rw] knowledge_assist_debug_info - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistDebugInfo] - # Debug information related to Knowledge Assist feature. - class KnowledgeAssistAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a suggested query. - # @!attribute [rw] query_text - # @return [::String] - # Suggested query text. - # @!attribute [rw] search_contexts - # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::SuggestedQuery::SearchContext>] - # Optional. The search contexts for the query. - class SuggestedQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Search context is information useful for knowledge search that helps - # enrich the query. - # Example: - # search_context { - # key: "application name" - # value: "DesignApp" - # } - # @!attribute [rw] key - # @return [::String] - # Optional. The key of the search context, e.g. "application name". - # @!attribute [rw] value - # @return [::String] - # Optional. The value of the search context, e.g. "DesignApp". - class SearchContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents a single suggested query result. - # @!attribute [r] suggested_query - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::SuggestedQuery] - # Output only. The suggested query based on the context. - # @!attribute [r] answer_record - # @return [::String] - # Output only. The name of the answer record. - # Format: `projects//locations//answerRecords/` - class AdditionalSuggestedQueryResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an answer from Knowledge. Currently supports FAQ and Generative - # answers. - # @!attribute [rw] answer_text - # @return [::String] - # The piece of text from the `source` that answers this suggested query. - # @!attribute [rw] faq_source - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::FaqSource] - # Populated if the prediction came from FAQ. - # - # Note: The following fields are mutually exclusive: `faq_source`, `generative_source`, `playbook_source`, `event_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] generative_source - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource] - # Populated if the prediction was Generative. - # - # Note: The following fields are mutually exclusive: `generative_source`, `faq_source`, `playbook_source`, `event_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] playbook_source - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource] - # Populated if the prediction was from Playbook. - # - # Note: The following fields are mutually exclusive: `playbook_source`, `faq_source`, `generative_source`, `event_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] event_source - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::EventSource] - # Populated if the prediction was from an event. - # - # Note: The following fields are mutually exclusive: `event_source`, `faq_source`, `generative_source`, `playbook_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class KnowledgeAnswer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Details about source of FAQ answer. - # @!attribute [rw] question - # @return [::String] - # The corresponding FAQ question. - class FaqSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about source of Generative answer. - # @!attribute [rw] snippets - # @return [::Array<::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource::Snippet>] - # All snippets used for this Generative Prediction, with their source URI - # and data. - class GenerativeSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Snippet Source for a Generative Prediction. - # @!attribute [rw] uri - # @return [::String] - # URI the data is sourced from. - # @!attribute [rw] text - # @return [::String] - # Text taken from that URI. - # @!attribute [rw] title - # @return [::String] - # Title of the document. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Struct] - # Metadata of the document. - class Snippet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Details about source of Event answer. - # @!attribute [rw] event - # @return [::String] - # Name of the triggered event. - # @!attribute [rw] snippets - # @return [::Google::Cloud::Dialogflow::V2::KnowledgeAssistAnswer::KnowledgeAnswer::GenerativeSource] - # Sources used in event fulfillment. - class EventSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Response reason from datastore which indicates data serving status or - # answer quality degradation. - module DatastoreResponseReason - # Default value. - DATASTORE_RESPONSE_REASON_UNSPECIFIED = 0 - - # No specific response reason from datastore. - NONE = 1 - - # Search is blocked due to out of quota. - SEARCH_OUT_OF_QUOTA = 2 - - # Search returns empty results. - SEARCH_EMPTY_RESULTS = 3 - - # Generative AI is disabled. - ANSWER_GENERATION_GEN_AI_DISABLED = 4 - - # Answer generation is blocked due to out of quota. - ANSWER_GENERATION_OUT_OF_QUOTA = 5 - - # Answer generation encounters an error. - ANSWER_GENERATION_ERROR = 6 - - # Answer generation does not have enough information to generate answer. - ANSWER_GENERATION_NOT_ENOUGH_INFO = 7 - - # Answer generation is blocked by RAI (Responsible AI) failure. - ANSWER_GENERATION_RAI_FAILED = 8 - - # Answer generation is not grounded on reliable sources. - ANSWER_GENERATION_NOT_GROUNDED = 9 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb deleted file mode 100644 index 3530af5106e8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb +++ /dev/null @@ -1,762 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # The request to detect user's intent. - # @!attribute [rw] session - # @return [::String] - # Required. The name of the session this query is sent to. Format: - # `projects//agent/sessions/`, or - # `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - # default 'draft' environment (`Environment ID` might be referred to as - # environment name at some places). If `User ID` is not specified, we are - # using "-". It's up to the API caller to choose an appropriate `Session ID` - # and `User Id`. They can be a random number or some type of user and session - # identifiers (preferably hashed). The length of the `Session ID` and - # `User ID` must not exceed 36 characters. - # - # For more information, see the [API interactions - # guide](https://cloud.google.com/dialogflow/docs/api-overview). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # @!attribute [rw] query_params - # @return [::Google::Cloud::Dialogflow::V2::QueryParameters] - # The parameters of this query. - # @!attribute [rw] query_input - # @return [::Google::Cloud::Dialogflow::V2::QueryInput] - # Required. The input specification. It can be set to: - # - # 1. an audio config which instructs the speech recognizer how to process - # the speech audio, - # - # 2. a conversational query in the form of text, or - # - # 3. an event that specifies which intent to trigger. - # @!attribute [rw] output_audio_config - # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] - # Instructs the speech synthesizer how to generate the output - # audio. If this field is not set and agent-level speech synthesizer is not - # configured, no output audio is generated. - # @!attribute [rw] output_audio_config_mask - # @return [::Google::Protobuf::FieldMask] - # Mask for - # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} - # indicating which settings in this request-level config should override - # speech synthesizer settings defined at agent-level. - # - # If unspecified or empty, - # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#output_audio_config output_audio_config} - # replaces the agent-level config in its entirety. - # @!attribute [rw] input_audio - # @return [::String] - # The natural language speech audio to be processed. This field - # should be populated iff `query_input` is set to an input audio config. - # A single request can contain up to 1 minute of speech audio data. - class DetectIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message returned from the [DetectIntent][] method. - # @!attribute [rw] response_id - # @return [::String] - # The unique identifier of the response. It can be used to - # locate a response in the training example set or for reporting issues. - # @!attribute [rw] query_result - # @return [::Google::Cloud::Dialogflow::V2::QueryResult] - # The selected results of the conversational query or event processing. - # See `alternative_query_results` for additional potential results. - # @!attribute [rw] webhook_status - # @return [::Google::Rpc::Status] - # Specifies the status of the webhook request. - # @!attribute [rw] output_audio - # @return [::String] - # The audio data bytes encoded as specified in the request. - # Note: The output audio is generated based on the values of default platform - # text responses found in the `query_result.fulfillment_messages` field. If - # multiple default text responses exist, they will be concatenated when - # generating audio. If no default platform text responses exist, the - # generated audio content will be empty. - # - # In some scenarios, multiple output audio fields may be present in the - # response structure. In these cases, only the top-most-level audio output - # has content. - # @!attribute [rw] output_audio_config - # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] - # The config used by the speech synthesizer to generate the output audio. - class DetectIntentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the parameters of the conversational query. - # @!attribute [rw] time_zone - # @return [::String] - # The time zone of this conversational query from the - # [time zone database](https://www.iana.org/time-zones), e.g., - # America/New_York, Europe/Paris. If not provided, the time zone specified in - # agent settings is used. - # @!attribute [rw] geo_location - # @return [::Google::Type::LatLng] - # The geo location of this conversational query. - # @!attribute [rw] contexts - # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] - # The collection of contexts to be activated before this query is - # executed. - # @!attribute [rw] reset_contexts - # @return [::Boolean] - # Specifies whether to delete all contexts in the current session - # before the new ones are activated. - # @!attribute [rw] session_entity_types - # @return [::Array<::Google::Cloud::Dialogflow::V2::SessionEntityType>] - # Additional session entity types to replace or extend developer - # entity types with. The entity synonyms apply to all languages and persist - # for the session of this query. - # @!attribute [rw] payload - # @return [::Google::Protobuf::Struct] - # This field can be used to pass custom data to your webhook. - # Arbitrary JSON objects are supported. - # If supplied, the value is used to populate the - # `WebhookRequest.original_detect_intent_request.payload` - # field sent to your webhook. - # @!attribute [rw] sentiment_analysis_request_config - # @return [::Google::Cloud::Dialogflow::V2::SentimentAnalysisRequestConfig] - # Configures the type of sentiment analysis to perform. If not - # provided, sentiment analysis is not performed. - # @!attribute [rw] webhook_headers - # @return [::Google::Protobuf::Map{::String => ::String}] - # This field can be used to pass HTTP headers for a webhook - # call. These headers will be sent to webhook along with the headers that - # have been configured through the Dialogflow web console. The headers - # defined within this field will overwrite the headers configured through the - # Dialogflow console if there is a conflict. Header names are - # case-insensitive. Google's specified headers are not allowed. Including: - # "Host", "Content-Length", "Connection", "From", "User-Agent", - # "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", - # etc. - # @!attribute [rw] platform - # @return [::String] - # The platform of the virtual agent response messages. - # - # If not empty, only emits messages from this platform in the response. - # Valid values are the enum names of - # {::Google::Cloud::Dialogflow::V2::Intent::Message#platform platform}. - class QueryParameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class WebhookHeadersEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represents the query input. It can contain either: - # - # 1. An audio config which instructs the speech recognizer how to process the - # speech audio. - # - # 2. A conversational query in the form of text. - # - # 3. An event that specifies which intent to trigger. - # @!attribute [rw] audio_config - # @return [::Google::Cloud::Dialogflow::V2::InputAudioConfig] - # Instructs the speech recognizer how to process the speech audio. - # - # Note: The following fields are mutually exclusive: `audio_config`, `text`, `event`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text - # @return [::Google::Cloud::Dialogflow::V2::TextInput] - # The natural language text to be processed. Text length must not exceed - # 256 character for virtual agent interactions. - # - # Note: The following fields are mutually exclusive: `text`, `audio_config`, `event`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] event - # @return [::Google::Cloud::Dialogflow::V2::EventInput] - # The event to be processed. - # - # Note: The following fields are mutually exclusive: `event`, `audio_config`, `text`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class QueryInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the result of conversational query or event processing. - # @!attribute [rw] query_text - # @return [::String] - # The original conversational query text: - # - # - If natural language text was provided as input, `query_text` contains - # a copy of the input. - # - If natural language speech audio was provided as input, `query_text` - # contains the speech recognition result. If speech recognizer produced - # multiple alternatives, a particular one is picked. - # - If automatic spell correction is enabled, `query_text` will contain the - # corrected user input. - # @!attribute [rw] language_code - # @return [::String] - # The language that was triggered during intent detection. - # See [Language - # Support](https://cloud.google.com/dialogflow/docs/reference/language) - # for a list of the currently supported language codes. - # @!attribute [rw] speech_recognition_confidence - # @return [::Float] - # The Speech recognition confidence between 0.0 and 1.0. A higher number - # indicates an estimated greater likelihood that the recognized words are - # correct. The default of 0.0 is a sentinel value indicating that confidence - # was not set. - # - # This field is not guaranteed to be accurate or set. In particular this - # field isn't set for [StreamingDetectIntent][] since the streaming endpoint - # has separate confidence estimates per portion of the audio in - # StreamingRecognitionResult. - # @!attribute [rw] action - # @return [::String] - # The action name from the matched intent. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Struct] - # The collection of extracted parameters. - # - # Depending on your protocol or client library language, this is a - # map, associative array, symbol table, dictionary, or JSON object - # composed of a collection of (MapKey, MapValue) pairs: - # - # * MapKey type: string - # * MapKey value: parameter name - # * MapValue type: If parameter's entity type is a composite entity then use - # map, otherwise, depending on the parameter value type, it could be one of - # string, number, boolean, null, list or map. - # * MapValue value: If parameter's entity type is a composite entity then use - # map from composite entity property names to property values, otherwise, - # use parameter value. - # @!attribute [rw] all_required_params_present - # @return [::Boolean] - # This field is set to: - # - # - `false` if the matched intent has required parameters and not all of - # the required parameter values have been collected. - # - `true` if all required parameter values have been collected, or if the - # matched intent doesn't contain any required parameters. - # @!attribute [rw] cancels_slot_filling - # @return [::Boolean] - # Indicates whether the conversational query triggers a cancellation for slot - # filling. For more information, see the [cancel slot filling - # documentation](https://cloud.google.com/dialogflow/es/docs/intents-actions-parameters#cancel). - # @!attribute [rw] fulfillment_text - # @return [::String] - # The text to be pronounced to the user or shown on the screen. - # Note: This is a legacy field, `fulfillment_messages` should be preferred. - # @!attribute [rw] fulfillment_messages - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message>] - # The collection of rich messages to present to the user. - # @!attribute [rw] webhook_source - # @return [::String] - # If the query was fulfilled by a webhook call, this field is set to the - # value of the `source` field returned in the webhook response. - # @!attribute [rw] webhook_payload - # @return [::Google::Protobuf::Struct] - # If the query was fulfilled by a webhook call, this field is set to the - # value of the `payload` field returned in the webhook response. - # @!attribute [rw] output_contexts - # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] - # The collection of output contexts. If applicable, - # `output_contexts.parameters` contains entries with name - # `.original` containing the original parameter values - # before the query. - # @!attribute [rw] intent - # @return [::Google::Cloud::Dialogflow::V2::Intent] - # The intent that matched the conversational query. Some, not - # all fields are filled in this message, including but not limited to: - # `name`, `display_name`, `end_interaction` and `is_fallback`. - # @!attribute [rw] intent_detection_confidence - # @return [::Float] - # The intent detection confidence. Values range from 0.0 - # (completely uncertain) to 1.0 (completely certain). - # This value is for informational purpose only and is only used to - # help match the best intent within the classification threshold. - # This value may change for the same end-user expression at any time due to a - # model retraining or change in implementation. - # If there are `multiple knowledge_answers` messages, this value is set to - # the greatest `knowledgeAnswers.match_confidence` value in the list. - # @!attribute [rw] diagnostic_info - # @return [::Google::Protobuf::Struct] - # Free-form diagnostic information for the associated detect intent request. - # The fields of this data can change without notice, so you should not write - # code that depends on its structure. - # The data may contain: - # - # - webhook call latency - # - webhook errors - # @!attribute [rw] sentiment_analysis_result - # @return [::Google::Cloud::Dialogflow::V2::SentimentAnalysisResult] - # The sentiment analysis result, which depends on the - # `sentiment_analysis_request_config` specified in the request. - class QueryResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message sent by the client to the - # [StreamingDetectIntent][] method. - # - # Multiple request messages should be sent in order: - # - # 1. The first message must contain - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#session session}, - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_input query_input} - # plus optionally - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_params query_params}. - # If the client wants to receive an audio response, it should also contain - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config}. - # The message must not contain - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio input_audio}. - # 2. If - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_input query_input} - # was set to - # {::Google::Cloud::Dialogflow::V2::InputAudioConfig query_input.audio_config}, - # all subsequent messages must contain - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio input_audio} - # to continue with Speech recognition. If you decide to rather detect an - # intent from text input after you already started Speech recognition, - # please send a message with - # {::Google::Cloud::Dialogflow::V2::QueryInput#text query_input.text}. - # - # However, note that: - # - # * Dialogflow will bill you for the audio duration so far. - # * Dialogflow discards all Speech recognition results in favor of the - # input text. - # * Dialogflow will use the language code from the first message. - # - # After you sent all input, you must half-close or abort the request stream. - # @!attribute [rw] session - # @return [::String] - # Required. The name of the session the query is sent to. - # Format of the session name: - # `projects//agent/sessions/`, or - # `projects//agent/environments//users//sessions/`. If `Environment ID` is not specified, we assume - # default 'draft' environment. If `User ID` is not specified, we are using - # "-". It's up to the API caller to choose an appropriate `Session ID` and - # `User Id`. They can be a random number or some type of user and session - # identifiers (preferably hashed). The length of the `Session ID` and - # `User ID` must not exceed 36 characters. - # - # For more information, see the [API interactions - # guide](https://cloud.google.com/dialogflow/docs/api-overview). - # - # Note: Always use agent versions for production traffic. - # See [Versions and - # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). - # @!attribute [rw] query_params - # @return [::Google::Cloud::Dialogflow::V2::QueryParameters] - # The parameters of this query. - # @!attribute [rw] query_input - # @return [::Google::Cloud::Dialogflow::V2::QueryInput] - # Required. The input specification. It can be set to: - # - # 1. an audio config which instructs the speech recognizer how to process - # the speech audio, - # - # 2. a conversational query in the form of text, or - # - # 3. an event that specifies which intent to trigger. - # @!attribute [rw] single_utterance - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Please use - # {::Google::Cloud::Dialogflow::V2::InputAudioConfig#single_utterance InputAudioConfig.single_utterance} - # instead. If `false` (default), recognition does not cease until the client - # closes the stream. If `true`, the recognizer will detect a single spoken - # utterance in input audio. Recognition ceases when it detects the audio's - # voice has stopped or paused. In this case, once a detected intent is - # received, the client should close the stream and start a new request with a - # new stream as needed. This setting is ignored when `query_input` is a piece - # of text or an event. - # @!attribute [rw] output_audio_config - # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] - # Instructs the speech synthesizer how to generate the output - # audio. If this field is not set and agent-level speech synthesizer is not - # configured, no output audio is generated. - # @!attribute [rw] output_audio_config_mask - # @return [::Google::Protobuf::FieldMask] - # Mask for - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config} - # indicating which settings in this request-level config should override - # speech synthesizer settings defined at agent-level. - # - # If unspecified or empty, - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config} - # replaces the agent-level config in its entirety. - # @!attribute [rw] input_audio - # @return [::String] - # The input audio content to be recognized. Must be sent if - # `query_input` was set to a streaming input audio config. The complete audio - # over all streaming messages must not exceed 1 minute. - # @!attribute [rw] enable_debugging_info - # @return [::Boolean] - # if true, `StreamingDetectIntentResponse.debugging_info` will get populated. - class StreamingDetectIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Cloud conversation info for easier debugging. - # It will get populated in `StreamingDetectIntentResponse` or - # `StreamingAnalyzeContentResponse` when the flag `enable_debugging_info` is - # set to true in corresponding requests. - # @!attribute [rw] audio_data_chunks - # @return [::Integer] - # Number of input audio data chunks in streaming requests. - # @!attribute [rw] result_end_time_offset - # @return [::Google::Protobuf::Duration] - # Time offset of the end of speech utterance relative to the - # beginning of the first audio chunk. - # @!attribute [rw] first_audio_duration - # @return [::Google::Protobuf::Duration] - # Duration of first audio chunk. - # @!attribute [rw] single_utterance - # @return [::Boolean] - # Whether client used single utterance mode. - # @!attribute [rw] speech_partial_results_end_times - # @return [::Array<::Google::Protobuf::Duration>] - # Time offsets of the speech partial results relative to the beginning of - # the stream. - # @!attribute [rw] speech_final_results_end_times - # @return [::Array<::Google::Protobuf::Duration>] - # Time offsets of the speech final results (is_final=true) relative to the - # beginning of the stream. - # @!attribute [rw] partial_responses - # @return [::Integer] - # Total number of partial responses. - # @!attribute [rw] speaker_id_passive_latency_ms_offset - # @return [::Integer] - # Time offset of Speaker ID stream close time relative to the Speech stream - # close time in milliseconds. Only meaningful for conversations involving - # passive verification. - # @!attribute [rw] bargein_event_triggered - # @return [::Boolean] - # Whether a barge-in event is triggered in this request. - # @!attribute [rw] speech_single_utterance - # @return [::Boolean] - # Whether speech uses single utterance mode. - # @!attribute [rw] dtmf_partial_results_times - # @return [::Array<::Google::Protobuf::Duration>] - # Time offsets of the DTMF partial results relative to the beginning of - # the stream. - # @!attribute [rw] dtmf_final_results_times - # @return [::Array<::Google::Protobuf::Duration>] - # Time offsets of the DTMF final results relative to the beginning of - # the stream. - # @!attribute [rw] single_utterance_end_time_offset - # @return [::Google::Protobuf::Duration] - # Time offset of the end-of-single-utterance signal relative to the - # beginning of the stream. - # @!attribute [rw] no_speech_timeout - # @return [::Google::Protobuf::Duration] - # No speech timeout settings for the stream. - # @!attribute [rw] endpointing_timeout - # @return [::Google::Protobuf::Duration] - # Speech endpointing timeout settings for the stream. - # @!attribute [rw] is_input_text - # @return [::Boolean] - # Whether the streaming terminates with an injected text query. - # @!attribute [rw] client_half_close_time_offset - # @return [::Google::Protobuf::Duration] - # Client half close time in terms of input audio duration. - # @!attribute [rw] client_half_close_streaming_time_offset - # @return [::Google::Protobuf::Duration] - # Client half close time in terms of API streaming duration. - class CloudConversationDebuggingInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The top-level message returned from the - # [StreamingDetectIntent][] method. - # - # Multiple response messages can be returned in order: - # - # 1. If the - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio StreamingDetectIntentRequest.input_audio} - # field was - # set, the `recognition_result` field is populated for one - # or more messages. - # See the - # {::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult StreamingRecognitionResult} - # message for details about the result message sequence. - # - # 2. The next message contains `response_id`, `query_result` - # and optionally `webhook_status` if a WebHook was called. - # @!attribute [rw] response_id - # @return [::String] - # The unique identifier of the response. It can be used to - # locate a response in the training example set or for reporting issues. - # @!attribute [rw] recognition_result - # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult] - # The result of speech recognition. - # @!attribute [rw] query_result - # @return [::Google::Cloud::Dialogflow::V2::QueryResult] - # The result of the conversational query or event processing. - # @!attribute [rw] webhook_status - # @return [::Google::Rpc::Status] - # Specifies the status of the webhook request. - # @!attribute [rw] output_audio - # @return [::String] - # The audio data bytes encoded as specified in the request. - # Note: The output audio is generated based on the values of default platform - # text responses found in the `query_result.fulfillment_messages` field. If - # multiple default text responses exist, they will be concatenated when - # generating audio. If no default platform text responses exist, the - # generated audio content will be empty. - # - # In some scenarios, multiple output audio fields may be present in the - # response structure. In these cases, only the top-most-level audio output - # has content. - # @!attribute [rw] output_audio_config - # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] - # The config used by the speech synthesizer to generate the output audio. - # @!attribute [rw] debugging_info - # @return [::Google::Cloud::Dialogflow::V2::CloudConversationDebuggingInfo] - # Debugging info that would get populated when - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#enable_debugging_info StreamingDetectIntentRequest.enable_debugging_info} - # is set to true. - class StreamingDetectIntentResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains a speech recognition result corresponding to a portion of the audio - # that is currently being processed or an indication that this is the end - # of the single requested utterance. - # - # While end-user audio is being processed, Dialogflow sends a series of - # results. Each result may contain a `transcript` value. A transcript - # represents a portion of the utterance. While the recognizer is processing - # audio, transcript values may be interim values or finalized values. - # Once a transcript is finalized, the `is_final` value is set to true and - # processing continues for the next transcript. - # - # If `StreamingDetectIntentRequest.query_input.audio_config.single_utterance` - # was true, and the recognizer has completed processing audio, - # the `message_type` value is set to `END_OF_SINGLE_UTTERANCE and the - # following (last) result contains the last finalized transcript. - # - # The complete end-user utterance is determined by concatenating the - # finalized transcript values received for the series of results. - # - # In the following example, single utterance is enabled. In the case where - # single utterance is not enabled, result 8 would not occur. - # - # ``` - # Num | transcript | message_type | is_final - # --- | ------------------------ | ----------------------- | -------- - # 1 | "tube" | TRANSCRIPT | false - # 2 | "to be a" | TRANSCRIPT | false - # 3 | "to be" | TRANSCRIPT | false - # 4 | "to be or not to be" | TRANSCRIPT | true - # 5 | "that's" | TRANSCRIPT | false - # 6 | "that is | TRANSCRIPT | false - # 7 | " that is the question" | TRANSCRIPT | true - # 8 | unset | END_OF_SINGLE_UTTERANCE | unset - # 9 | ". Whether 'tis nobler" | TRANSCRIPT | true - # 10 | " in the mind" | TRANSCRIPT | false - # 11 | " in the mind to suffer" | TRANSCRIPT | true - # ``` - # - # Concatenating the finalized transcripts with `is_final` set to true, - # the complete utterance becomes "to be or not to be that is the question". - # @!attribute [rw] message_type - # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult::MessageType] - # Type of the result message. - # @!attribute [rw] transcript - # @return [::String] - # Transcript text representing the words that the user spoke. - # Populated if and only if `message_type` = `TRANSCRIPT`. - # @!attribute [rw] is_final - # @return [::Boolean] - # If `false`, the `StreamingRecognitionResult` represents an - # interim result that may change. If `true`, the recognizer will not return - # any further hypotheses about this piece of the audio. May only be populated - # for `message_type` = `TRANSCRIPT`. - # @!attribute [rw] confidence - # @return [::Float] - # The Speech confidence between 0.0 and 1.0 for the current portion of audio. - # A higher number indicates an estimated greater likelihood that the - # recognized words are correct. The default of 0.0 is a sentinel value - # indicating that confidence was not set. - # - # This field is typically only provided if `is_final` is true and you should - # not rely on it being accurate or even set. - # @!attribute [rw] speech_word_info - # @return [::Array<::Google::Cloud::Dialogflow::V2::SpeechWordInfo>] - # Word-specific information for the words recognized by Speech in - # {::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult#transcript transcript}. - # Populated if and only if `message_type` = `TRANSCRIPT` and - # [InputAudioConfig.enable_word_info] is set. - # @!attribute [rw] speech_end_offset - # @return [::Google::Protobuf::Duration] - # Time offset of the end of this Speech recognition result relative to the - # beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`. - # @!attribute [rw] language_code - # @return [::String] - # Detected language code for the transcript. - class StreamingRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of the response message. - module MessageType - # Not specified. Should never be used. - MESSAGE_TYPE_UNSPECIFIED = 0 - - # Message contains a (possibly partial) transcript. - TRANSCRIPT = 1 - - # This event indicates that the server has detected the end of the user's - # speech utterance and expects no additional inputs. - # Therefore, the server will not process additional audio (although it may - # subsequently return additional results). The client should stop sending - # additional audio data, half-close the gRPC connection, and wait for any - # additional results until the server closes the gRPC connection. This - # message is only sent if `single_utterance` was set to `true`, and is not - # used otherwise. - END_OF_SINGLE_UTTERANCE = 2 - end - end - - # Auxiliary proto messages. - # - # Represents the natural language text to be processed. - # @!attribute [rw] text - # @return [::String] - # Required. The UTF-8 encoded natural language text to be processed. - # Text length must not exceed 256 characters for virtual agent interactions. - # @!attribute [rw] language_code - # @return [::String] - # Required. The language of this conversational query. See [Language - # Support](https://cloud.google.com/dialogflow/docs/reference/language) - # for a list of the currently supported language codes. Note that queries in - # the same session do not necessarily need to specify the same language. - class TextInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Events allow for matching intents by event name instead of the natural - # language input. For instance, input `` can trigger a personalized welcome response. - # The parameter `name` may be used by the agent in the response: - # `"Hello #welcome_event.name! What can I do for you today?"`. - # @!attribute [rw] name - # @return [::String] - # Required. The unique identifier of the event. - # @!attribute [rw] parameters - # @return [::Google::Protobuf::Struct] - # The collection of parameters associated with the event. - # - # Depending on your protocol or client library language, this is a - # map, associative array, symbol table, dictionary, or JSON object - # composed of a collection of (MapKey, MapValue) pairs: - # - # * MapKey type: string - # * MapKey value: parameter name - # * MapValue type: If parameter's entity type is a composite entity then use - # map, otherwise, depending on the parameter value type, it could be one of - # string, number, boolean, null, list or map. - # * MapValue value: If parameter's entity type is a composite entity then use - # map from composite entity property names to property values, otherwise, - # use parameter value. - # @!attribute [rw] language_code - # @return [::String] - # Required. The language of this query. See [Language - # Support](https://cloud.google.com/dialogflow/docs/reference/language) - # for a list of the currently supported language codes. Note that queries in - # the same session do not necessarily need to specify the same language. - # - # This field is ignored when used in the context of a - # {::Google::Cloud::Dialogflow::V2::WebhookResponse#followup_event_input WebhookResponse.followup_event_input} - # field, because the language was already defined in the originating detect - # intent request. - class EventInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configures the types of sentiment analysis to perform. - # @!attribute [rw] analyze_query_text_sentiment - # @return [::Boolean] - # Instructs the service to perform sentiment analysis on - # `query_text`. If not provided, sentiment analysis is not performed on - # `query_text`. - class SentimentAnalysisRequestConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The result of sentiment analysis. Sentiment analysis inspects user input - # and identifies the prevailing subjective opinion, especially to determine a - # user's attitude as positive, negative, or neutral. - # For [DetectIntent][], it needs to be configured in - # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest#query_params DetectIntentRequest.query_params}. - # For [StreamingDetectIntent][], it needs to be configured in - # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_params StreamingDetectIntentRequest.query_params}. - # And for - # {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} - # and - # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent}, - # it needs to be configured in - # {::Google::Cloud::Dialogflow::V2::ConversationProfile#human_agent_assistant_config ConversationProfile.human_agent_assistant_config} - # @!attribute [rw] query_text_sentiment - # @return [::Google::Cloud::Dialogflow::V2::Sentiment] - # The sentiment analysis result for `query_text`. - class SentimentAnalysisResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The sentiment, such as positive/negative feeling or association, for a unit - # of analysis, such as the query text. See: - # https://cloud.google.com/natural-language/docs/basics#interpreting_sentiment_analysis_values - # for how to interpret the result. - # @!attribute [rw] score - # @return [::Float] - # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive - # sentiment). - # @!attribute [rw] magnitude - # @return [::Float] - # A non-negative number in the [0, +inf) range, which represents the absolute - # magnitude of sentiment, regardless of score (positive or negative). - class Sentiment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb deleted file mode 100644 index 0869b91564a2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session_entity_type.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 Dialogflow - module V2 - # A session represents a conversation between a Dialogflow agent and an - # end-user. You can create special entities, called session entities, during a - # session. Session entities can extend or replace custom entity types and only - # exist during the session that they were created for. All session data, - # including session entities, is stored by Dialogflow for 20 minutes. - # - # For more information, see the [session entity - # guide](https://cloud.google.com/dialogflow/docs/entities-session). - # @!attribute [rw] name - # @return [::String] - # Required. The unique identifier of this session entity type. Format: - # `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # - # `` must be the display name of an existing entity - # type in the same agent that will be overridden or supplemented. - # @!attribute [rw] entity_override_mode - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType::EntityOverrideMode] - # Required. Indicates whether the additional data should override or - # supplement the custom entity type definition. - # @!attribute [rw] entities - # @return [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity>] - # Required. The collection of entities associated with this session entity - # type. - class SessionEntityType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The types of modifications for a session entity type. - module EntityOverrideMode - # Not specified. This value should be never used. - ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0 - - # The collection of session entities overrides the collection of entities - # in the corresponding custom entity type. - ENTITY_OVERRIDE_MODE_OVERRIDE = 1 - - # The collection of session entities extends the collection of entities in - # the corresponding custom entity type. - # - # Note: Even in this override mode calls to `ListSessionEntityTypes`, - # `GetSessionEntityType`, `CreateSessionEntityType` and - # `UpdateSessionEntityType` only return the additional entities added in - # this session entity type. If you want to get the supplemented list, - # please call - # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client#get_entity_type EntityTypes.GetEntityType} - # on the custom entity type and merge. - ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types SessionEntityTypes.ListSessionEntityTypes}. - # @!attribute [rw] parent - # @return [::String] - # Required. The session to list all session entity types from. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users// - # sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListSessionEntityTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types SessionEntityTypes.ListSessionEntityTypes}. - # @!attribute [rw] session_entity_types - # @return [::Array<::Google::Cloud::Dialogflow::V2::SessionEntityType>] - # The list of session entity types. There will be a maximum number of items - # returned based on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListSessionEntityTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#get_session_entity_type SessionEntityTypes.GetSessionEntityType}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the session entity type. Format: - # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - class GetSessionEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#create_session_entity_type SessionEntityTypes.CreateSessionEntityType}. - # @!attribute [rw] parent - # @return [::String] - # Required. The session to create a session entity type for. - # Format: `projects//agent/sessions/` or - # `projects//agent/environments//users// - # sessions/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - # @!attribute [rw] session_entity_type - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # Required. The session entity type to create. - class CreateSessionEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#update_session_entity_type SessionEntityTypes.UpdateSessionEntityType}. - # @!attribute [rw] session_entity_type - # @return [::Google::Cloud::Dialogflow::V2::SessionEntityType] - # Required. The session entity type to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields get updated. - class UpdateSessionEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#delete_session_entity_type SessionEntityTypes.DeleteSessionEntityType}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the entity type to delete. Format: - # `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. - # If `Environment ID` is not specified, we assume default 'draft' - # environment. If `User ID` is not specified, we assume default '-' user. - class DeleteSessionEntityTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/sip_trunk.rb deleted file mode 100644 index 9cbbcb689362..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/sip_trunk.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! - - -module Google - module Cloud - module Dialogflow - module V2 - # The request message for - # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#create_sip_trunk SipTrunks.CreateSipTrunk}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location to create a SIP trunk for. - # Format: `projects//locations/`. - # @!attribute [rw] sip_trunk - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # Required. The SIP trunk to create. - class CreateSipTrunkRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#delete_sip_trunk SipTrunks.DeleteSipTrunk}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the SIP trunk to delete. - # Format: `projects//locations//sipTrunks/`. - class DeleteSipTrunkRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#list_sip_trunks SipTrunks.ListSipTrunks}. - # @!attribute [rw] parent - # @return [::String] - # Required. The location to list SIP trunks from. - # Format: `projects//locations/`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListSipTrunksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#list_sip_trunks SipTrunks.ListSipTrunks}. - # @!attribute [rw] sip_trunks - # @return [::Array<::Google::Cloud::Dialogflow::V2::SipTrunk>] - # The list of SIP trunks. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListSipTrunksResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#get_sip_trunk SipTrunks.GetSipTrunk}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the SIP trunk to delete. - # Format: `projects//locations//sipTrunks/`. - class GetSipTrunkRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::SipTrunks::Client#update_sip_trunk SipTrunks.UpdateSipTrunk}. - # @!attribute [rw] sip_trunk - # @return [::Google::Cloud::Dialogflow::V2::SipTrunk] - # Required. The SipTrunk to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The mask to control which fields get updated. If the mask is not - # present, all fields will be updated. - class UpdateSipTrunkRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # SipTrunk is the resource that represents a SIP trunk to connect to Google - # Telephony platform SIP trunking service. - # @!attribute [rw] name - # @return [::String] - # Identifier. The unique identifier of the SIP trunk. - # Format: `projects//locations//sipTrunks/`. - # @!attribute [rw] expected_hostname - # @return [::Array<::String>] - # Required. The expected hostnames in the peer certificate from partner that - # is used for TLS authentication. - # @!attribute [r] connections - # @return [::Array<::Google::Cloud::Dialogflow::V2::Connection>] - # Output only. Connections of the SIP trunk. - # @!attribute [rw] display_name - # @return [::String] - # Optional. Human readable alias for this trunk. - class SipTrunk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a connection for SIP Trunk. - # @!attribute [r] connection_id - # @return [::String] - # Output only. The unique identifier of the SIP Trunk connection. - # @!attribute [r] state - # @return [::Google::Cloud::Dialogflow::V2::Connection::State] - # Output only. State of the connection. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. When the connection status changed. - # @!attribute [r] error_details - # @return [::Google::Cloud::Dialogflow::V2::Connection::ErrorDetails] - # Output only. The error details for the connection. Only populated when - # authentication errors occur. - class Connection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The error details of Sip Trunk connection authentication. - # @!attribute [r] certificate_state - # @return [::Google::Cloud::Dialogflow::V2::Connection::CertificateState] - # Output only. The status of the certificate authentication. - # @!attribute [rw] error_message - # @return [::String] - # The error message provided from SIP trunking auth service - class ErrorDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The state of Sip Trunk connection. - module State - # SIP Trunk connection state is Not specified. - STATE_UNSPECIFIED = 0 - - # SIP Trunk connection is connected. - CONNECTED = 1 - - # SIP Trunk connection is disconnected. - DISCONNECTED = 2 - - # SIP Trunk connection has authentication error. - AUTHENTICATION_FAILED = 3 - - # SIP Trunk connection is keepalive. - KEEPALIVE = 4 - end - - # The state of Sip Trunk certificate authentication. - module CertificateState - # Certificate state is not specified. - CERTIFICATE_STATE_UNSPECIFIED = 0 - - # Certificate is valid. - CERTIFICATE_VALID = 1 - - # Catch all for any error not specified. - CERTIFICATE_INVALID = 2 - - # Certificate leaf node has expired. - CERTIFICATE_EXPIRED = 3 - - # There is no hostname defined to authenticate in SipTrunkingServer. - CERTIFICATE_HOSTNAME_NOT_FOUND = 4 - - # No path found from the leaf certificate to any root. - CERTIFICATE_UNAUTHENTICATED = 5 - - # Trust store does not exist. - CERTIFICATE_TRUST_STORE_NOT_FOUND = 6 - - # Hostname has invalid format. - CERTIFICATE_HOSTNAME_INVALID_FORMAT = 7 - - # Certificate has exhausted its quota. - CERTIFICATE_QUOTA_EXCEEDED = 8 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool.rb deleted file mode 100644 index 236a71e701c7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool.rb +++ /dev/null @@ -1,552 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Request message of CreateTool. - # @!attribute [rw] parent - # @return [::String] - # Required. The project/location to create tool for. Format: - # `projects//locations/` - # @!attribute [rw] tool - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # Required. The tool to create. - # @!attribute [rw] tool_id - # @return [::String] - # Optional. The ID to use for the tool, which will become the final - # component of the tool's resource name. - # - # The tool ID must be compliant with the regression formula - # `[a-zA-Z][a-zA-Z0-9_-]*` with the characters length in range of [3,64]. - # If the field is not provide, an Id will be auto-generated. - # If the field is provided, the caller is responsible for - # 1. the uniqueness of the ID, otherwise the request will be rejected. - # 2. the consistency for whether to use custom ID or not under a project to - # better ensure uniqueness. - class CreateToolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message of GetTool. - # @!attribute [rw] name - # @return [::String] - # Required. The tool resource name to retrieve. Format: - # `projects//locations//tools/` - class GetToolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message of ListTools. - # @!attribute [rw] parent - # @return [::String] - # Required. The project/location to list tools for. Format: - # `projects//locations/` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of conversation models to return in a single page. - # Default to 10. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListToolsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response of ListTools. - # @!attribute [rw] tools - # @return [::Array<::Google::Cloud::Dialogflow::V2::Tool>] - # List of tools retrieved. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListToolsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request of DeleteTool. - # @!attribute [rw] name - # @return [::String] - # Required. The tool resource name to delete. Format: - # `projects//locations//tools/` - class DeleteToolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request of UpdateTool. - # @!attribute [rw] tool - # @return [::Google::Cloud::Dialogflow::V2::Tool] - # Required. The tool to update. - # The name field of tool is to identify the tool to - # update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The list of fields to update. - class UpdateToolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a tool. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The resource name of the tool. Format: - # `projects//locations//tools/`. - # @!attribute [rw] tool_key - # @return [::String] - # Required. A human readable short name of the tool, which should be unique - # within the project. It should only contain letters, numbers, and - # underscores, and it will be used by LLM to identify the tool. - # @!attribute [rw] display_name - # @return [::String] - # Optional. A human readable short name of the tool, to be shown on the UI. - # @!attribute [rw] description - # @return [::String] - # Optional. A human readable description of the tool. - # @!attribute [rw] action_confirmation_requirement - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement}] - # Optional. Confirmation requirement for the actions. Each key is an action - # name in the action_schemas. If an action's confirmation requirement is - # unspecified (either the key is not present, or its value is - # CONFIRMATION_REQUIREMENT_UNSPECIFIED), the requirement is inferred from the - # action's method_type - confirmation is not required if and only if - # method_type is GET. - # @!attribute [rw] extension_spec - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::Dialogflow::V2::Tool::ExtensionTool] - # Vertex extension tool specification. - # - # Note: The following fields are mutually exclusive: `extension_spec`, `function_spec`, `connector_spec`, `open_api_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] function_spec - # @return [::Google::Cloud::Dialogflow::V2::Tool::FunctionTool] - # Client side executed function specification. - # - # Note: The following fields are mutually exclusive: `function_spec`, `extension_spec`, `connector_spec`, `open_api_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] connector_spec - # @return [::Google::Cloud::Dialogflow::V2::Tool::ConnectorTool] - # Integration connectors tool specification. - # - # Note: The following fields are mutually exclusive: `connector_spec`, `extension_spec`, `function_spec`, `open_api_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] open_api_spec - # @return [::Google::Cloud::Dialogflow::V2::Tool::OpenApiTool] - # OpenAPI tool. - # - # Note: The following fields are mutually exclusive: `open_api_spec`, `extension_spec`, `function_spec`, `connector_spec`. 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. Creation time of this tool. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update time of this tool. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. A read only boolean field reflecting Zone Separation - # status of the tool. If the field is absent, it means the status is unknown. - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Output only. A read only boolean field reflecting Zone Isolation status - # of the tool. If the field is absent, it means the status is unknown. - class Tool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An ExtensionTool is a way to use Vertex Extensions as a tool. - # @!attribute [rw] name - # @return [::String] - # Required. The full name of the referenced vertex extension. - # Format: - # `projects/{project}/locations/{location}/extensions/{extension}` - class ExtensionTool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Function tool describes the functions to be invoked on the client side. - # @!attribute [rw] input_schema - # @return [::Google::Protobuf::Struct] - # Optional. The JSON schema is encapsulated in a - # {::Google::Protobuf::Struct google.protobuf.Struct} to describe the input of - # the function. This input is a JSON object that contains the function's - # parameters as properties of the object. - # @!attribute [rw] output_schema - # @return [::Google::Protobuf::Struct] - # Optional. The JSON schema is encapsulated in a - # {::Google::Protobuf::Struct google.protobuf.Struct} to describe the output - # of the function. This output is a JSON object that contains the - # function's parameters as properties of the object. - # @!attribute [rw] method_type - # @return [::Google::Cloud::Dialogflow::V2::Tool::MethodType] - # Optional. The method type of the function. If not specified, the default - # value is GET. - class FunctionTool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An OpenAPI tool is a way to provide the Tool specifications in the Open API - # schema format. - # @!attribute [rw] text_schema - # @return [::String] - # Required. The OpenAPI schema specified as a text. - # @!attribute [rw] authentication - # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication] - # Optional. Authentication information required by the API. - # @!attribute [rw] tls_config - # @return [::Google::Cloud::Dialogflow::V2::Tool::TLSConfig] - # Optional. TLS configuration for the HTTPS verification. - # @!attribute [rw] service_directory_config - # @return [::Google::Cloud::Dialogflow::V2::Tool::ServiceDirectoryConfig] - # Optional. Service Directory configuration. - class OpenApiTool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A ConnectorTool enabling using Integration Connectors Connections as tools. - # @!attribute [rw] name - # @return [::String] - # Required. The full resource name of the referenced Integration Connectors - # Connection. Format: 'projects/*/locations/*/connections/*' - # @!attribute [rw] actions - # @return [::Array<::Google::Cloud::Dialogflow::V2::Tool::ConnectorTool::Action>] - # Required. Actions for the tool to use. - class ConnectorTool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration of a Connection operation for the tool to use. - # @!attribute [rw] connection_action_id - # @return [::String] - # ID of a Connection action for the tool to use. - # - # Note: The following fields are mutually exclusive: `connection_action_id`, `entity_operation`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] entity_operation - # @return [::Google::Cloud::Dialogflow::V2::Tool::ConnectorTool::Action::EntityOperation] - # Entity operation configuration for the tool to use. - # - # Note: The following fields are mutually exclusive: `entity_operation`, `connection_action_id`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] input_fields - # @return [::Array<::String>] - # Optional. Entity fields to use as inputs for the operation. - # If no fields are specified, all fields of the Entity will be used. - # @!attribute [rw] output_fields - # @return [::Array<::String>] - # Optional. Entity fields to return from the operation. - # If no fields are specified, all fields of the Entity will be returned. - class Action - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Entity CRUD operation specification. - # @!attribute [rw] entity_id - # @return [::String] - # Required. ID of the entity. - # @!attribute [rw] operation - # @return [::Google::Cloud::Dialogflow::V2::Tool::ConnectorTool::Action::EntityOperation::OperationType] - # Required. Operation to perform on the entity. - class EntityOperation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The operation to perform on the entity. - module OperationType - # Operation type unspecified. Invalid, ConnectorTool create/update - # will fail. - OPERATION_TYPE_UNSPECIFIED = 0 - - # List operation. - LIST = 1 - - # Get operation. - GET = 2 - - # Create operation. - CREATE = 3 - - # Update operation. - UPDATE = 4 - - # Delete operation. - DELETE = 5 - end - end - end - end - - # Authentication information required for API calls - # @!attribute [rw] api_key_config - # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::ApiKeyConfig] - # Config for API key auth. - # - # Note: The following fields are mutually exclusive: `api_key_config`, `oauth_config`, `service_agent_auth_config`, `bearer_token_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oauth_config - # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::OAuthConfig] - # Config for OAuth. - # - # Note: The following fields are mutually exclusive: `oauth_config`, `api_key_config`, `service_agent_auth_config`, `bearer_token_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] service_agent_auth_config - # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::ServiceAgentAuthConfig] - # Config for [Diglogflow service - # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent) - # auth. - # - # Note: The following fields are mutually exclusive: `service_agent_auth_config`, `api_key_config`, `oauth_config`, `bearer_token_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bearer_token_config - # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::BearerTokenConfig] - # Config for bearer token auth. - # - # Note: The following fields are mutually exclusive: `bearer_token_config`, `api_key_config`, `oauth_config`, `service_agent_auth_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Authentication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Config for authentication with API key. - # @!attribute [rw] key_name - # @return [::String] - # Required. The parameter name or the header name of the API key. - # E.g., If the API request is "https://example.com/act?X-Api-Key=", "X-Api-Key" would be the parameter name. - # @!attribute [rw] api_key - # @return [::String] - # Optional. The API key. If the `secret_version_for_api_key` field is - # set, this field will be ignored. - # @!attribute [rw] secret_version_for_api_key - # @return [::String] - # Optional. The name of the SecretManager secret version resource storing - # the API key. If this field is set, the `api_key` field will be ignored. - # Format: `projects/{project}/secrets/{secret}/versions/{version}` - # @!attribute [rw] request_location - # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::RequestLocation] - # Required. Key location in the request. - class ApiKeyConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Config for authentication with OAuth. - # @!attribute [rw] oauth_grant_type - # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::OAuthConfig::OauthGrantType] - # Required. OAuth grant types. - # @!attribute [rw] client_id - # @return [::String] - # Required. The client ID from the OAuth provider. - # @!attribute [rw] client_secret - # @return [::String] - # Optional. The client secret from the OAuth provider. If the - # `secret_version_for_client_secret` field is set, this field will be - # ignored. - # @!attribute [rw] secret_version_for_client_secret - # @return [::String] - # Optional. The name of the SecretManager secret version resource storing - # the client secret. If this field is set, the `client_secret` field will - # be ignored. Format: - # `projects/{project}/secrets/{secret}/versions/{version}` - # @!attribute [rw] token_endpoint - # @return [::String] - # Required. The token endpoint in the OAuth provider to exchange for an - # access token. - # @!attribute [rw] scopes - # @return [::Array<::String>] - # Optional. The OAuth scopes to grant. - class OAuthConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # OAuth grant types. Only [client credential - # grant](https://oauth.net/2/grant-types/client-credentials) is - # supported. - module OauthGrantType - # Default value. This value is unused. - OAUTH_GRANT_TYPE_UNSPECIFIED = 0 - - # Represents the [client credential - # flow](https://oauth.net/2/grant-types/client-credentials). - CLIENT_CREDENTIAL = 1 - end - end - - # Config for auth using [Dialogflow service - # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). - # @!attribute [rw] service_agent_auth - # @return [::Google::Cloud::Dialogflow::V2::Tool::Authentication::ServiceAgentAuthConfig::ServiceAgentAuth] - # Optional. Indicate the auth token type generated from the [Diglogflow - # service - # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). - # The generated token is sent in the Authorization header. - class ServiceAgentAuthConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Indicate the auth token type generated from the [Diaglogflow service - # agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). - module ServiceAgentAuth - # Service agent auth type unspecified. Default to ID_TOKEN. - SERVICE_AGENT_AUTH_UNSPECIFIED = 0 - - # Use [ID - # token](https://cloud.google.com/docs/authentication/token-types#id) - # generated from service agent. This can be used to access Cloud - # Function and Cloud Run after you grant Invoker role to - # `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. - ID_TOKEN = 1 - - # Use [access - # token](https://cloud.google.com/docs/authentication/token-types#access) - # generated from service agent. This can be used to access other Google - # Cloud APIs after you grant required roles to - # `service-@gcp-sa-dialogflow.iam.gserviceaccount.com`. - ACCESS_TOKEN = 2 - end - end - - # Config for authentication using bearer token. - # @!attribute [rw] token - # @return [::String] - # Optional. The text token appended to the text `Bearer` to the request - # Authorization header. - # [Session parameters - # reference](https://cloud.google.com/dialogflow/cx/docs/concept/parameter#session-ref) - # can be used to pass the token dynamically, e.g. - # `$session.params.parameter-id`. - # @!attribute [rw] secret_version_for_token - # @return [::String] - # Optional. The name of the SecretManager secret version resource storing - # the Bearer token. If this field is set, the `token` field will be - # ignored. Format: - # `projects/{project}/secrets/{secret}/versions/{version}` - class BearerTokenConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The location of the API key in the request. - module RequestLocation - # Default value. This value is unused. - REQUEST_LOCATION_UNSPECIFIED = 0 - - # Represents the key in http header. - HEADER = 1 - - # Represents the key in query string. - QUERY_STRING = 2 - end - end - - # The TLS configuration. - # @!attribute [rw] ca_certs - # @return [::Array<::Google::Cloud::Dialogflow::V2::Tool::TLSConfig::CACert>] - # Required. Specifies a list of allowed custom CA certificates for HTTPS - # verification. - class TLSConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The CA certificate. - # @!attribute [rw] display_name - # @return [::String] - # Required. The name of the allowed custom CA certificates. This - # can be used to disambiguate the custom CA certificates. - # @!attribute [rw] cert - # @return [::String] - # Required. The allowed custom CA certificates (in DER format) for - # HTTPS verification. This overrides the default SSL trust store. If this - # is empty or unspecified, Dialogflow will use Google's default trust - # store to verify certificates. N.B. Make sure the HTTPS server - # certificates are signed with "subject alt name". For instance a - # certificate can be self-signed using the following command, - # ``` - # openssl x509 -req -days 200 -in example.com.csr \ - # -signkey example.com.key \ - # -out example.com.crt \ - # -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") - # ``` - class CACert - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Configuration for tools using Service Directory. - # @!attribute [rw] service - # @return [::String] - # Required. The name of [Service - # Directory](https://cloud.google.com/service-directory) service. - # Format: - # `projects//locations//namespaces//services/`. - # `LocationID` of the service directory must be the same as the location - # of the tool. - class ServiceDirectoryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement] - class ActionConfirmationRequirementEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Types of confirmation requirement. - module ConfirmationRequirement - # Unspecified. Whether the action requires confirmation is inferred from - # method_type. - CONFIRMATION_REQUIREMENT_UNSPECIFIED = 0 - - # Conformation is required. - REQUIRED = 1 - - # Conformation is not required. - NOT_REQUIRED = 2 - end - - # The method type of the tool. - module MethodType - # Unspecified. - METHOD_TYPE_UNSPECIFIED = 0 - - # GET method. - GET = 1 - - # POST method. - POST = 2 - - # PUT method. - PUT = 3 - - # DELETE method. - DELETE = 4 - - # PATCH method. - PATCH = 5 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool_call.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool_call.rb deleted file mode 100644 index 78fb857b4d6d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/tool_call.rb +++ /dev/null @@ -1,161 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # Represents a call of a specific tool's action with the specified inputs. - # @!attribute [rw] tool - # @return [::String] - # Optional. The {::Google::Cloud::Dialogflow::V2::Tool tool} associated with - # this call. Format: - # `projects//locations//tools/`. - # - # Note: The following fields are mutually exclusive: `tool`, `ces_tool`, `ces_toolset`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ces_tool - # @return [::String] - # Optional. CES tool name for this call. - # Format: - # `projects//locations//apps//tools/`. - # - # Note: The following fields are mutually exclusive: `ces_tool`, `tool`, `ces_toolset`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ces_toolset - # @return [::String] - # Optional. CES toolset name for this call. - # Format: - # `projects//locations//apps//toolsets/ToolsetID>`. - # - # Note: The following fields are mutually exclusive: `ces_toolset`, `tool`, `ces_tool`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ces_app - # @return [::String] - # Optional. CES app name for this call. - # Format: - # `projects//locations//apps/`. - # - # Note: The following fields are mutually exclusive: `ces_app`, `tool`, `ces_tool`, `ces_toolset`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] tool_display_name - # @return [::String] - # Optional. A human readable short name of the tool, to be shown on the UI. - # @!attribute [rw] tool_display_details - # @return [::String] - # Optional. A human readable description of the tool. - # @!attribute [rw] action - # @return [::String] - # Optional. The name of the tool's action associated with this call. - # @!attribute [rw] input_parameters - # @return [::Google::Protobuf::Struct] - # Optional. The action's input parameters. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create time of the tool call. - # @!attribute [rw] answer_record - # @return [::String] - # Optional. The answer record associated with this tool call. - # @!attribute [r] state - # @return [::Google::Cloud::Dialogflow::V2::ToolCall::State] - # Output only. State of the tool call. - class ToolCall - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Tool call states. - module State - # Default value. - STATE_UNSPECIFIED = 0 - - # The tool call has been triggered. - TRIGGERED = 1 - - # The tool call requires confirmation from a human. - NEEDS_CONFIRMATION = 2 - end - end - - # The result of calling a tool's action. - # @!attribute [rw] tool - # @return [::String] - # Optional. The {::Google::Cloud::Dialogflow::V2::Tool tool} associated with - # this call. Format: - # `projects//locations//tools/`. - # - # Note: The following fields are mutually exclusive: `tool`, `ces_toolset`, `ces_tool`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ces_toolset - # @return [::String] - # Optional. CES toolset name for this call. - # Format: - # `projects//locations//apps//toolsets/ToolsetID>`. - # - # Note: The following fields are mutually exclusive: `ces_toolset`, `tool`, `ces_tool`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ces_tool - # @return [::String] - # Optional. CES tool name for this call. - # Format: - # `projects//locations//apps//tools/`. - # - # Note: The following fields are mutually exclusive: `ces_tool`, `tool`, `ces_toolset`, `ces_app`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ces_app - # @return [::String] - # Optional. CES app name for this call. - # Format: - # `projects//locations//apps/`. - # - # Note: The following fields are mutually exclusive: `ces_app`, `tool`, `ces_toolset`, `ces_tool`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] action - # @return [::String] - # Optional. The name of the tool's action associated with this call. - # @!attribute [rw] error - # @return [::Google::Cloud::Dialogflow::V2::ToolCallResult::Error] - # The tool call's error. - # - # Note: The following fields are mutually exclusive: `error`, `raw_content`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] raw_content - # @return [::String] - # Only populated if the response content is not utf-8 encoded. - # (by definition byte fields are base64 encoded). - # - # Note: The following fields are mutually exclusive: `raw_content`, `error`, `content`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] content - # @return [::String] - # Only populated if the response content is utf-8 encoded. - # - # Note: The following fields are mutually exclusive: `content`, `error`, `raw_content`. 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. Create time of the tool call result. - # @!attribute [rw] answer_record - # @return [::String] - # Optional. The answer record associated with this tool call result. - class ToolCallResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An error produced by the tool call. - # @!attribute [rw] message - # @return [::String] - # Optional. The error message of the function. - class Error - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/toolset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/toolset.rb deleted file mode 100644 index 678b0309b45b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/toolset.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 Dialogflow - module V2 - # A tool that is created from a toolset. - # @!attribute [rw] toolset - # @return [::String] - # Required. The name of the toolset to retrieve the schema for. - # Format: - # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}` - # @!attribute [rw] operation_id - # @return [::String] - # Optional. The operationId field of the OpenAPI endpoint. The operationId - # must be present in the toolset's definition. - # @!attribute [rw] confirmation_requirement - # @return [::Google::Cloud::Dialogflow::V2::Tool::ConfirmationRequirement] - # Optional. Indicates whether the tool requires human confirmation. - class ToolsetTool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/validation_result.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/validation_result.rb deleted file mode 100644 index 66c12576d07f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/validation_result.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 Dialogflow - module V2 - # Represents a single validation error. - # @!attribute [rw] severity - # @return [::Google::Cloud::Dialogflow::V2::ValidationError::Severity] - # The severity of the error. - # @!attribute [rw] entries - # @return [::Array<::String>] - # The names of the entries that the error is associated with. - # Format: - # - # - `projects//agent`, if the error is associated with the entire - # agent. - # - `projects//agent/intents/`, if the error is - # associated with certain intents. - # - `projects//agent/intents//trainingPhrases/`, if the error is associated with - # certain intent training phrases. - # - `projects//agent/intents//parameters/`, if the error is associated with certain intent parameters. - # - `projects//agent/entities/`, if the error is - # associated with certain entities. - # @!attribute [rw] error_message - # @return [::String] - # The detailed error message. - class ValidationError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a level of severity. - module Severity - # Not specified. This value should never be used. - SEVERITY_UNSPECIFIED = 0 - - # The agent doesn't follow Dialogflow best practices. - INFO = 1 - - # The agent may not behave as expected. - WARNING = 2 - - # The agent may experience partial failures. - ERROR = 3 - - # The agent may completely fail. - CRITICAL = 4 - end - end - - # Represents the output of agent validation. - # @!attribute [rw] validation_errors - # @return [::Array<::Google::Cloud::Dialogflow::V2::ValidationError>] - # Contains all validation errors. - class ValidationResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/version.rb deleted file mode 100644 index fc0ace2ec88e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/version.rb +++ /dev/null @@ -1,188 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Dialogflow - module V2 - # You can create multiple versions of your agent and publish them to separate - # environments. - # - # When you edit an agent, you are editing the draft agent. At any point, you - # can save the draft agent as an agent version, which is an immutable snapshot - # of your agent. - # - # When you save the draft agent, it is published to the default environment. - # When you create agent versions, you can publish them to custom environments. - # You can create a variety of custom environments for: - # - # - testing - # - development - # - production - # - etc. - # - # For more information, see the [versions and environments - # guide](https://cloud.google.com/dialogflow/docs/agents-versions). - # @!attribute [r] name - # @return [::String] - # Output only. The unique identifier of this agent version. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - # @!attribute [rw] description - # @return [::String] - # Optional. The developer-provided description of this version. - # @!attribute [r] version_number - # @return [::Integer] - # Output only. The sequential number of this version. This field is read-only - # which means it cannot be set by create and update methods. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time of this version. This field is read-only, - # i.e., it cannot be set by create and update methods. - # @!attribute [r] status - # @return [::Google::Cloud::Dialogflow::V2::Version::VersionStatus] - # Output only. The status of this version. This field is read-only and cannot - # be set by create and update methods. - class Version - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of a version. - module VersionStatus - # Not specified. This value is not used. - VERSION_STATUS_UNSPECIFIED = 0 - - # Version is not ready to serve (e.g. training is in progress). - IN_PROGRESS = 1 - - # Version is ready to serve. - READY = 2 - - # Version training failed. - FAILED = 3 - end - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Versions::Client#list_versions Versions.ListVersions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to list all versions from. - # Supported formats: - # - # - `projects//agent` - # - `projects//locations//agent` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of items to return in a single page. By - # default 100 and at most 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. The next_page_token value returned from a previous list request. - class ListVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # {::Google::Cloud::Dialogflow::V2::Versions::Client#list_versions Versions.ListVersions}. - # @!attribute [rw] versions - # @return [::Array<::Google::Cloud::Dialogflow::V2::Version>] - # The list of agent versions. There will be a maximum number of items - # returned based on the page_size field in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Versions::Client#get_version Versions.GetVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the version. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - class GetVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Versions::Client#create_version Versions.CreateVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The agent to create a version for. - # Supported formats: - # - # - `projects//agent` - # - `projects//locations//agent` - # @!attribute [rw] version - # @return [::Google::Cloud::Dialogflow::V2::Version] - # Required. The version to create. - class CreateVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Versions::Client#update_version Versions.UpdateVersion}. - # @!attribute [rw] version - # @return [::Google::Cloud::Dialogflow::V2::Version] - # Required. The version to update. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to control which fields get updated. - class UpdateVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # {::Google::Cloud::Dialogflow::V2::Versions::Client#delete_version Versions.DeleteVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the version to delete. - # Supported formats: - # - # - `projects//agent/versions/` - # - `projects//locations//agent/versions/` - class DeleteVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/webhook.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/webhook.rb deleted file mode 100644 index 1257075be86f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/webhook.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! - - -module Google - module Cloud - module Dialogflow - module V2 - # The request message for a webhook call. - # @!attribute [rw] session - # @return [::String] - # The unique identifier of detectIntent request session. - # Can be used to identify end-user inside webhook implementation. - # Format: `projects//agent/sessions/`, or - # `projects//agent/environments//users//sessions/`. - # @!attribute [rw] response_id - # @return [::String] - # The unique identifier of the response. Contains the same value as - # `[Streaming]DetectIntentResponse.response_id`. - # @!attribute [rw] query_result - # @return [::Google::Cloud::Dialogflow::V2::QueryResult] - # The result of the conversational query or event processing. Contains the - # same value as `[Streaming]DetectIntentResponse.query_result`. - # @!attribute [rw] original_detect_intent_request - # @return [::Google::Cloud::Dialogflow::V2::OriginalDetectIntentRequest] - # Optional. The contents of the original request that was passed to - # `[Streaming]DetectIntent` call. - class WebhookRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for a webhook call. - # - # This response is validated by the Dialogflow server. If validation fails, - # an error will be returned in the - # {::Google::Cloud::Dialogflow::V2::QueryResult#diagnostic_info QueryResult.diagnostic_info} - # field. Setting JSON fields to an empty value with the wrong type is a common - # error. To avoid this error: - # - # - Use `""` for empty strings - # - Use `{}` or `null` for empty objects - # - Use `[]` or `null` for empty arrays - # - # For more information, see the - # [Protocol Buffers Language - # Guide](https://developers.google.com/protocol-buffers/docs/proto3#json). - # @!attribute [rw] fulfillment_text - # @return [::String] - # Optional. The text response message intended for the end-user. - # It is recommended to use `fulfillment_messages.text.text[0]` instead. - # When provided, Dialogflow uses this field to populate - # {::Google::Cloud::Dialogflow::V2::QueryResult#fulfillment_text QueryResult.fulfillment_text} - # sent to the integration or API caller. - # @!attribute [rw] fulfillment_messages - # @return [::Array<::Google::Cloud::Dialogflow::V2::Intent::Message>] - # Optional. The rich response messages intended for the end-user. - # When provided, Dialogflow uses this field to populate - # {::Google::Cloud::Dialogflow::V2::QueryResult#fulfillment_messages QueryResult.fulfillment_messages} - # sent to the integration or API caller. - # @!attribute [rw] source - # @return [::String] - # Optional. A custom field used to identify the webhook source. - # Arbitrary strings are supported. - # When provided, Dialogflow uses this field to populate - # {::Google::Cloud::Dialogflow::V2::QueryResult#webhook_source QueryResult.webhook_source} - # sent to the integration or API caller. - # @!attribute [rw] payload - # @return [::Google::Protobuf::Struct] - # Optional. This field can be used to pass custom data from your webhook to - # the integration or API caller. Arbitrary JSON objects are supported. When - # provided, Dialogflow uses this field to populate - # {::Google::Cloud::Dialogflow::V2::QueryResult#webhook_payload QueryResult.webhook_payload} - # sent to the integration or API caller. This field is also used by the - # [Google Assistant - # integration](https://cloud.google.com/dialogflow/docs/integrations/aog) - # for rich response messages. - # See the format definition at [Google Assistant Dialogflow webhook - # format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json) - # @!attribute [rw] output_contexts - # @return [::Array<::Google::Cloud::Dialogflow::V2::Context>] - # Optional. The collection of output contexts that will overwrite currently - # active contexts for the session and reset their lifespans. - # When provided, Dialogflow uses this field to populate - # {::Google::Cloud::Dialogflow::V2::QueryResult#output_contexts QueryResult.output_contexts} - # sent to the integration or API caller. - # @!attribute [rw] followup_event_input - # @return [::Google::Cloud::Dialogflow::V2::EventInput] - # Optional. Invokes the supplied events. - # When this field is set, Dialogflow ignores the `fulfillment_text`, - # `fulfillment_messages`, and `payload` fields. - # @!attribute [rw] session_entity_types - # @return [::Array<::Google::Cloud::Dialogflow::V2::SessionEntityType>] - # Optional. Additional session entity types to replace or extend developer - # entity types with. The entity synonyms apply to all languages and persist - # for the session. Setting this data from a webhook overwrites - # the session entity types that have been set using `detectIntent`, - # `streamingDetectIntent` or - # {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} - # management methods. - class WebhookResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the contents of the original request that was passed to - # the `[Streaming]DetectIntent` call. - # @!attribute [rw] source - # @return [::String] - # The source of this request, e.g., `google`, `facebook`, `slack`. It is set - # by Dialogflow-owned servers. - # @!attribute [rw] version - # @return [::String] - # Optional. The version of the protocol used for this request. - # This field is AoG-specific. - # @!attribute [rw] payload - # @return [::Google::Protobuf::Struct] - # Optional. This field is set to the value of the `QueryParameters.payload` - # field passed in the request. Some integrations that query a Dialogflow - # agent may provide additional information in the payload. - # - # In particular, for the Dialogflow Phone Gateway integration, this field has - # the form: - #
{
-        #      "telephony": {
-        #        "caller_id": "+18558363987"
-        #      }
-        #     }
- # Note: The caller ID field (`caller_id`) will be redacted for Trial - # Edition agents and populated with the caller ID in [E.164 - # format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents. - class OriginalDetectIntentRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/type/latlng.rb deleted file mode 100644 index 593314b4cde5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/proto_docs/google/type/latlng.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 - # An object that represents a latitude/longitude pair. This is expressed as a - # pair of doubles to represent degrees latitude and degrees longitude. Unless - # specified otherwise, this object must conform to the - # - # WGS84 standard. Values must be within normalized ranges. - # @!attribute [rw] latitude - # @return [::Float] - # The latitude in degrees. It must be in the range [-90.0, +90.0]. - # @!attribute [rw] longitude - # @return [::Float] - # The longitude in degrees. It must be in the range [-180.0, +180.0]. - class LatLng - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/Gemfile deleted file mode 100644 index 2acb72ce745a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/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-dialogflow-v2", path: "../" -else - gem "google-cloud-dialogflow-v2" -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-dialogflow-v2/snippets/agents/delete_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/delete_agent.rb deleted file mode 100644 index 1dc9023adc01..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/delete_agent.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 dialogflow_v2_generated_Agents_DeleteAgent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_agent call in the Agents 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::Dialogflow::V2::Agents::Client#delete_agent. -# -def delete_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new - - # Call the delete_agent method. - result = client.delete_agent request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_Agents_DeleteAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb deleted file mode 100644 index 8722ab5c72ed..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/export_agent.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 dialogflow_v2_generated_Agents_ExportAgent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the export_agent call in the Agents 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::Dialogflow::V2::Agents::Client#export_agent. -# -def export_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new - - # Call the export_agent method. - result = client.export_agent request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Agents_ExportAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb deleted file mode 100644 index 7a95d5e28b96..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_agent.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 dialogflow_v2_generated_Agents_GetAgent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_agent call in the Agents 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::Dialogflow::V2::Agents::Client#get_agent. -# -def get_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new - - # Call the get_agent method. - result = client.get_agent request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. - p result -end -# [END dialogflow_v2_generated_Agents_GetAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb deleted file mode 100644 index ed0f75af59d4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.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 dialogflow_v2_generated_Agents_GetValidationResult_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_validation_result call in the Agents 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::Dialogflow::V2::Agents::Client#get_validation_result. -# -def get_validation_result - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new - - # Call the get_validation_result method. - result = client.get_validation_result request - - # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult. - p result -end -# [END dialogflow_v2_generated_Agents_GetValidationResult_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb deleted file mode 100644 index e7284b6e6efc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/import_agent.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 dialogflow_v2_generated_Agents_ImportAgent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the import_agent call in the Agents 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::Dialogflow::V2::Agents::Client#import_agent. -# -def import_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new - - # Call the import_agent method. - result = client.import_agent request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Agents_ImportAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb deleted file mode 100644 index d28970b5fe09..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/restore_agent.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 dialogflow_v2_generated_Agents_RestoreAgent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the restore_agent call in the Agents 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::Dialogflow::V2::Agents::Client#restore_agent. -# -def restore_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new - - # Call the restore_agent method. - result = client.restore_agent request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Agents_RestoreAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb deleted file mode 100644 index 8f929009101e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/search_agents.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 dialogflow_v2_generated_Agents_SearchAgents_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the search_agents call in the Agents 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::Dialogflow::V2::Agents::Client#search_agents. -# -def search_agents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new - - # Call the search_agents method. - result = client.search_agents 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::Dialogflow::V2::Agent. - p item - end -end -# [END dialogflow_v2_generated_Agents_SearchAgents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb deleted file mode 100644 index 4024bdc6c5b9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/set_agent.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 dialogflow_v2_generated_Agents_SetAgent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the set_agent call in the Agents 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::Dialogflow::V2::Agents::Client#set_agent. -# -def set_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new - - # Call the set_agent method. - result = client.set_agent request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. - p result -end -# [END dialogflow_v2_generated_Agents_SetAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb deleted file mode 100644 index 80f635acaaf3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/agents/train_agent.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 dialogflow_v2_generated_Agents_TrainAgent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the train_agent call in the Agents 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::Dialogflow::V2::Agents::Client#train_agent. -# -def train_agent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Agents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new - - # Call the train_agent method. - result = client.train_agent request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Agents_TrainAgent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb deleted file mode 100644 index b82dcb5b2b4f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.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 dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_answer_records call in the AnswerRecords 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::Dialogflow::V2::AnswerRecords::Client#list_answer_records. -# -def list_answer_records - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new - - # Call the list_answer_records method. - result = client.list_answer_records 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::Dialogflow::V2::AnswerRecord. - p item - end -end -# [END dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb deleted file mode 100644 index 6c8f8db961f5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.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 dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_answer_record call in the AnswerRecords 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::Dialogflow::V2::AnswerRecords::Client#update_answer_record. -# -def update_answer_record - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new - - # Call the update_answer_record method. - result = client.update_answer_record request - - # The returned object is of type Google::Cloud::Dialogflow::V2::AnswerRecord. - p result -end -# [END dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb deleted file mode 100644 index 9a7b15ca505a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/create_context.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 dialogflow_v2_generated_Contexts_CreateContext_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_context call in the Contexts 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::Dialogflow::V2::Contexts::Client#create_context. -# -def create_context - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new - - # Call the create_context method. - result = client.create_context request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Context. - p result -end -# [END dialogflow_v2_generated_Contexts_CreateContext_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb deleted file mode 100644 index efe3eca6c0dc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.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 dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_all_contexts call in the Contexts 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::Dialogflow::V2::Contexts::Client#delete_all_contexts. -# -def delete_all_contexts - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new - - # Call the delete_all_contexts method. - result = client.delete_all_contexts request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb deleted file mode 100644 index 9863858c489a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/delete_context.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 dialogflow_v2_generated_Contexts_DeleteContext_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_context call in the Contexts 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::Dialogflow::V2::Contexts::Client#delete_context. -# -def delete_context - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new - - # Call the delete_context method. - result = client.delete_context request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_Contexts_DeleteContext_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb deleted file mode 100644 index da09cc6d51f5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/get_context.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 dialogflow_v2_generated_Contexts_GetContext_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_context call in the Contexts 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::Dialogflow::V2::Contexts::Client#get_context. -# -def get_context - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetContextRequest.new - - # Call the get_context method. - result = client.get_context request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Context. - p result -end -# [END dialogflow_v2_generated_Contexts_GetContext_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb deleted file mode 100644 index bf646bd3dee8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.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 dialogflow_v2_generated_Contexts_ListContexts_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_contexts call in the Contexts 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::Dialogflow::V2::Contexts::Client#list_contexts. -# -def list_contexts - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new - - # Call the list_contexts method. - result = client.list_contexts 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::Dialogflow::V2::Context. - p item - end -end -# [END dialogflow_v2_generated_Contexts_ListContexts_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb deleted file mode 100644 index 29cbf2478522..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/contexts/update_context.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 dialogflow_v2_generated_Contexts_UpdateContext_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_context call in the Contexts 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::Dialogflow::V2::Contexts::Client#update_context. -# -def update_context - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Contexts::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new - - # Call the update_context method. - result = client.update_context request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Context. - p result -end -# [END dialogflow_v2_generated_Contexts_UpdateContext_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb deleted file mode 100644 index fe70fd892912..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.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 dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_conversation_dataset call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#create_conversation_dataset. -# -def create_conversation_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new - - # Call the create_conversation_dataset method. - result = client.create_conversation_dataset request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb deleted file mode 100644 index eb3601be7b26..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.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 dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_conversation_dataset call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#delete_conversation_dataset. -# -def delete_conversation_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new - - # Call the delete_conversation_dataset method. - result = client.delete_conversation_dataset request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb deleted file mode 100644 index 0c4a42c0b852..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.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 dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_conversation_dataset call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#get_conversation_dataset. -# -def get_conversation_dataset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new - - # Call the get_conversation_dataset method. - result = client.get_conversation_dataset request - - # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. - p result -end -# [END dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb deleted file mode 100644 index 8c3c877a147e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.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 dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the import_conversation_data call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data. -# -def import_conversation_data - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new - - # Call the import_conversation_data method. - result = client.import_conversation_data request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb deleted file mode 100644 index 4e30f4d0af71..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.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 dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_conversation_datasets call in the ConversationDatasets 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::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets. -# -def list_conversation_datasets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new - - # Call the list_conversation_datasets method. - result = client.list_conversation_datasets 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::Dialogflow::V2::ConversationDataset. - p item - end -end -# [END dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb deleted file mode 100644 index 67046818982c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_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 dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#create_conversation_model. -# -def create_conversation_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new - - # Call the create_conversation_model method. - result = client.create_conversation_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 dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb deleted file mode 100644 index 08f031d2dc4f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.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 dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_conversation_model_evaluation call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation. -# -def create_conversation_model_evaluation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new - - # Call the create_conversation_model_evaluation method. - result = client.create_conversation_model_evaluation request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb deleted file mode 100644 index 4a135c039229..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_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 dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#delete_conversation_model. -# -def delete_conversation_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new - - # Call the delete_conversation_model method. - result = client.delete_conversation_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 dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb deleted file mode 100644 index 0c840fb018c5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_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 dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the deploy_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model. -# -def deploy_conversation_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new - - # Call the deploy_conversation_model method. - result = client.deploy_conversation_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 dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb deleted file mode 100644 index df02f37ecd43..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.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 dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#get_conversation_model. -# -def get_conversation_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new - - # Call the get_conversation_model method. - result = client.get_conversation_model request - - # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. - p result -end -# [END dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb deleted file mode 100644 index 0806c1654f42..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.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 dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_conversation_model_evaluation call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#get_conversation_model_evaluation. -# -def get_conversation_model_evaluation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new - - # Call the get_conversation_model_evaluation method. - result = client.get_conversation_model_evaluation request - - # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. - p result -end -# [END dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb deleted file mode 100644 index 9d835d0d26a7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.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 dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_conversation_model_evaluations call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations. -# -def list_conversation_model_evaluations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new - - # Call the list_conversation_model_evaluations method. - result = client.list_conversation_model_evaluations 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::Dialogflow::V2::ConversationModelEvaluation. - p item - end -end -# [END dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb deleted file mode 100644 index feb0adee80df..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.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 dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_conversation_models call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#list_conversation_models. -# -def list_conversation_models - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new - - # Call the list_conversation_models method. - result = client.list_conversation_models 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::Dialogflow::V2::ConversationModel. - p item - end -end -# [END dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb deleted file mode 100644 index cd527948af47..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_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 dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the undeploy_conversation_model call in the ConversationModels 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::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model. -# -def undeploy_conversation_model - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new - - # Call the undeploy_conversation_model method. - result = client.undeploy_conversation_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 dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb deleted file mode 100644 index d33648bb0442..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_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 dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the clear_suggestion_feature_config call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config. -# -def clear_suggestion_feature_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new - - # Call the clear_suggestion_feature_config method. - result = client.clear_suggestion_feature_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 dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb deleted file mode 100644 index 0bff474f17f4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.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 dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_conversation_profile call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#create_conversation_profile. -# -def create_conversation_profile - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new - - # Call the create_conversation_profile method. - result = client.create_conversation_profile request - - # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. - p result -end -# [END dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb deleted file mode 100644 index 0764e4d81d3e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.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 dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_conversation_profile call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#delete_conversation_profile. -# -def delete_conversation_profile - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new - - # Call the delete_conversation_profile method. - result = client.delete_conversation_profile request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb deleted file mode 100644 index 084d30cf18f7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.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 dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_conversation_profile call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile. -# -def get_conversation_profile - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new - - # Call the get_conversation_profile method. - result = client.get_conversation_profile request - - # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. - p result -end -# [END dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb deleted file mode 100644 index e2d03f7cc868..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.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 dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_conversation_profiles call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles. -# -def list_conversation_profiles - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new - - # Call the list_conversation_profiles method. - result = client.list_conversation_profiles 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::Dialogflow::V2::ConversationProfile. - p item - end -end -# [END dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb deleted file mode 100644 index 5f8f6b342935..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_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 dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the set_suggestion_feature_config call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config. -# -def set_suggestion_feature_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new - - # Call the set_suggestion_feature_config method. - result = client.set_suggestion_feature_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 dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb deleted file mode 100644 index c9caf7615409..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.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 dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_conversation_profile call in the ConversationProfiles 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::Dialogflow::V2::ConversationProfiles::Client#update_conversation_profile. -# -def update_conversation_profile - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new - - # Call the update_conversation_profile method. - result = client.update_conversation_profile request - - # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. - p result -end -# [END dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb deleted file mode 100644 index b3ab2aa619d6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/complete_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 dialogflow_v2_generated_Conversations_CompleteConversation_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the complete_conversation call in the Conversations 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::Dialogflow::V2::Conversations::Client#complete_conversation. -# -def complete_conversation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new - - # Call the complete_conversation method. - result = client.complete_conversation request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. - p result -end -# [END dialogflow_v2_generated_Conversations_CompleteConversation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb deleted file mode 100644 index 6f10891d7eef..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/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 dialogflow_v2_generated_Conversations_CreateConversation_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_conversation call in the Conversations 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::Dialogflow::V2::Conversations::Client#create_conversation. -# -def create_conversation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new - - # Call the create_conversation method. - result = client.create_conversation request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. - p result -end -# [END dialogflow_v2_generated_Conversations_CreateConversation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_suggestion.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_suggestion.rb deleted file mode 100644 index aa371ba61700..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_suggestion.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 dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the generate_stateless_suggestion call in the Conversations 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::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion. -# -def generate_stateless_suggestion - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new - - # Call the generate_stateless_suggestion method. - result = client.generate_stateless_suggestion request - - # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse. - p result -end -# [END dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_summary.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_summary.rb deleted file mode 100644 index 29ac2872d330..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_stateless_summary.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 dialogflow_v2_generated_Conversations_GenerateStatelessSummary_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the generate_stateless_summary call in the Conversations 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::Dialogflow::V2::Conversations::Client#generate_stateless_summary. -# -def generate_stateless_summary - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new - - # Call the generate_stateless_summary method. - result = client.generate_stateless_summary request - - # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse. - p result -end -# [END dialogflow_v2_generated_Conversations_GenerateStatelessSummary_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_suggestions.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_suggestions.rb deleted file mode 100644 index 6a49d93fda1e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/generate_suggestions.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 dialogflow_v2_generated_Conversations_GenerateSuggestions_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the generate_suggestions call in the Conversations 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::Dialogflow::V2::Conversations::Client#generate_suggestions. -# -def generate_suggestions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new - - # Call the generate_suggestions method. - result = client.generate_suggestions request - - # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse. - p result -end -# [END dialogflow_v2_generated_Conversations_GenerateSuggestions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb deleted file mode 100644 index 38bd3cf94644..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/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 dialogflow_v2_generated_Conversations_GetConversation_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_conversation call in the Conversations 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::Dialogflow::V2::Conversations::Client#get_conversation. -# -def get_conversation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new - - # Call the get_conversation method. - result = client.get_conversation request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. - p result -end -# [END dialogflow_v2_generated_Conversations_GetConversation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/ingest_context_references.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/ingest_context_references.rb deleted file mode 100644 index 408a37f8fbcd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/ingest_context_references.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 dialogflow_v2_generated_Conversations_IngestContextReferences_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the ingest_context_references call in the Conversations 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::Dialogflow::V2::Conversations::Client#ingest_context_references. -# -def ingest_context_references - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new - - # Call the ingest_context_references method. - result = client.ingest_context_references request - - # The returned object is of type Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse. - p result -end -# [END dialogflow_v2_generated_Conversations_IngestContextReferences_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb deleted file mode 100644 index 7adcf395116f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/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 dialogflow_v2_generated_Conversations_ListConversations_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_conversations call in the Conversations 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::Dialogflow::V2::Conversations::Client#list_conversations. -# -def list_conversations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Conversation. - p item - end -end -# [END dialogflow_v2_generated_Conversations_ListConversations_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb deleted file mode 100644 index 6db48aadee73..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/list_messages.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 dialogflow_v2_generated_Conversations_ListMessages_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_messages call in the Conversations 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::Dialogflow::V2::Conversations::Client#list_messages. -# -def list_messages - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new - - # Call the list_messages method. - result = client.list_messages 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::Dialogflow::V2::Message. - p item - end -end -# [END dialogflow_v2_generated_Conversations_ListMessages_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/search_knowledge.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/search_knowledge.rb deleted file mode 100644 index 6d9f04ecc8c4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/search_knowledge.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 dialogflow_v2_generated_Conversations_SearchKnowledge_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the search_knowledge call in the Conversations 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::Dialogflow::V2::Conversations::Client#search_knowledge. -# -def search_knowledge - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new - - # Call the search_knowledge method. - result = client.search_knowledge request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse. - p result -end -# [END dialogflow_v2_generated_Conversations_SearchKnowledge_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/suggest_conversation_summary.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/suggest_conversation_summary.rb deleted file mode 100644 index 64fa435c538e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/conversations/suggest_conversation_summary.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 dialogflow_v2_generated_Conversations_SuggestConversationSummary_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the suggest_conversation_summary call in the Conversations 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::Dialogflow::V2::Conversations::Client#suggest_conversation_summary. -# -def suggest_conversation_summary - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Conversations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new - - # Call the suggest_conversation_summary method. - result = client.suggest_conversation_summary request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse. - p result -end -# [END dialogflow_v2_generated_Conversations_SuggestConversationSummary_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/create_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/create_document.rb deleted file mode 100644 index 09a45b2b34e2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/create_document.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 dialogflow_v2_generated_Documents_CreateDocument_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_document call in the Documents 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::Dialogflow::V2::Documents::Client#create_document. -# -def create_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Documents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new - - # Call the create_document method. - result = client.create_document request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Documents_CreateDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb deleted file mode 100644 index c2527ed89adb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/delete_document.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 dialogflow_v2_generated_Documents_DeleteDocument_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_document call in the Documents 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::Dialogflow::V2::Documents::Client#delete_document. -# -def delete_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Documents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new - - # Call the delete_document method. - result = client.delete_document request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Documents_DeleteDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/export_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/export_document.rb deleted file mode 100644 index 5bc17b24a8a4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/export_document.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 dialogflow_v2_generated_Documents_ExportDocument_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the export_document call in the Documents 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::Dialogflow::V2::Documents::Client#export_document. -# -def export_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Documents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new - - # Call the export_document method. - result = client.export_document request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Documents_ExportDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/get_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/get_document.rb deleted file mode 100644 index 46c5f51e1a16..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/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 dialogflow_v2_generated_Documents_GetDocument_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_document call in the Documents 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::Dialogflow::V2::Documents::Client#get_document. -# -def get_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Documents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new - - # Call the get_document method. - result = client.get_document request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Document. - p result -end -# [END dialogflow_v2_generated_Documents_GetDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb deleted file mode 100644 index 3f6b2677bfd5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/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 dialogflow_v2_generated_Documents_ImportDocuments_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the import_documents call in the Documents 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::Dialogflow::V2::Documents::Client#import_documents. -# -def import_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Documents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::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 dialogflow_v2_generated_Documents_ImportDocuments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb deleted file mode 100644 index c41bd457b663..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/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 dialogflow_v2_generated_Documents_ListDocuments_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_documents call in the Documents 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::Dialogflow::V2::Documents::Client#list_documents. -# -def list_documents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Documents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Document. - p item - end -end -# [END dialogflow_v2_generated_Documents_ListDocuments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb deleted file mode 100644 index 02eb4cbe14ed..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/reload_document.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 dialogflow_v2_generated_Documents_ReloadDocument_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the reload_document call in the Documents 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::Dialogflow::V2::Documents::Client#reload_document. -# -def reload_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Documents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new - - # Call the reload_document method. - result = client.reload_document request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Documents_ReloadDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/update_document.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/update_document.rb deleted file mode 100644 index 17a517e7e16d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/documents/update_document.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 dialogflow_v2_generated_Documents_UpdateDocument_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_document call in the Documents 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::Dialogflow::V2::Documents::Client#update_document. -# -def update_document - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Documents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new - - # Call the update_document method. - result = client.update_document request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Documents_UpdateDocument_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/get_encryption_spec.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/get_encryption_spec.rb deleted file mode 100644 index 4ebad6a0d692..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/get_encryption_spec.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 dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_encryption_spec call in the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::Client#get_encryption_spec. -# -def get_encryption_spec - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new - - # Call the get_encryption_spec method. - result = client.get_encryption_spec request - - # The returned object is of type Google::Cloud::Dialogflow::V2::EncryptionSpec. - p result -end -# [END dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/initialize_encryption_spec.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/initialize_encryption_spec.rb deleted file mode 100644 index e0da7705ede7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/encryption_spec_service/initialize_encryption_spec.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 dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the initialize_encryption_spec call in the EncryptionSpecService 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::Dialogflow::V2::EncryptionSpecService::Client#initialize_encryption_spec. -# -def initialize_encryption_spec - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new - - # Call the initialize_encryption_spec method. - result = client.initialize_encryption_spec request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb deleted file mode 100644 index 68f06144a270..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.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 dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the batch_create_entities call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_create_entities. -# -def batch_create_entities - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new - - # Call the batch_create_entities method. - result = client.batch_create_entities request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb deleted file mode 100644 index ae82178d87a7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.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 dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the batch_delete_entities call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_delete_entities. -# -def batch_delete_entities - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new - - # Call the batch_delete_entities method. - result = client.batch_delete_entities request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb deleted file mode 100644 index ce5ee0fee9b5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.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 dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the batch_delete_entity_types call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_delete_entity_types. -# -def batch_delete_entity_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new - - # Call the batch_delete_entity_types method. - result = client.batch_delete_entity_types request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb deleted file mode 100644 index 69982093619b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.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 dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the batch_update_entities call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_update_entities. -# -def batch_update_entities - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new - - # Call the batch_update_entities method. - result = client.batch_update_entities request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb deleted file mode 100644 index b01544b1d981..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.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 dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the batch_update_entity_types call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types. -# -def batch_update_entity_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new - - # Call the batch_update_entity_types method. - result = client.batch_update_entity_types request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb deleted file mode 100644 index e58746418ec7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.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 dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_entity_type call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#create_entity_type. -# -def create_entity_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new - - # Call the create_entity_type method. - result = client.create_entity_type request - - # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. - p result -end -# [END dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb deleted file mode 100644 index 7e04582cac7f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.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 dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_entity_type call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#delete_entity_type. -# -def delete_entity_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new - - # Call the delete_entity_type method. - result = client.delete_entity_type request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb deleted file mode 100644 index 309d3a58e7c9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.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 dialogflow_v2_generated_EntityTypes_GetEntityType_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_entity_type call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#get_entity_type. -# -def get_entity_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new - - # Call the get_entity_type method. - result = client.get_entity_type request - - # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. - p result -end -# [END dialogflow_v2_generated_EntityTypes_GetEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb deleted file mode 100644 index efb7d67d12af..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.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 dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_entity_types call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#list_entity_types. -# -def list_entity_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new - - # Call the list_entity_types method. - result = client.list_entity_types 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::Dialogflow::V2::EntityType. - p item - end -end -# [END dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb deleted file mode 100644 index 7879502b5e51..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.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 dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_entity_type call in the EntityTypes 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::Dialogflow::V2::EntityTypes::Client#update_entity_type. -# -def update_entity_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new - - # Call the update_entity_type method. - result = client.update_entity_type request - - # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. - p result -end -# [END dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb deleted file mode 100644 index 77761ba93b38..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/create_environment.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 dialogflow_v2_generated_Environments_CreateEnvironment_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_environment call in the Environments 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::Dialogflow::V2::Environments::Client#create_environment. -# -def create_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new - - # Call the create_environment method. - result = client.create_environment request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. - p result -end -# [END dialogflow_v2_generated_Environments_CreateEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb deleted file mode 100644 index 25202158fb20..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/delete_environment.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 dialogflow_v2_generated_Environments_DeleteEnvironment_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_environment call in the Environments 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::Dialogflow::V2::Environments::Client#delete_environment. -# -def delete_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new - - # Call the delete_environment method. - result = client.delete_environment request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_Environments_DeleteEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb deleted file mode 100644 index 60157fefbe6e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment.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 dialogflow_v2_generated_Environments_GetEnvironment_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_environment call in the Environments 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::Dialogflow::V2::Environments::Client#get_environment. -# -def get_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new - - # Call the get_environment method. - result = client.get_environment request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. - p result -end -# [END dialogflow_v2_generated_Environments_GetEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb deleted file mode 100644 index 5f6c1b0b6d33..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.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 dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_environment_history call in the Environments 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::Dialogflow::V2::Environments::Client#get_environment_history. -# -def get_environment_history - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.new - - # Call the get_environment_history method. - result = client.get_environment_history 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::Dialogflow::V2::EnvironmentHistory::Entry. - p item - end -end -# [END dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb deleted file mode 100644 index e8527f8181dd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/list_environments.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 dialogflow_v2_generated_Environments_ListEnvironments_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_environments call in the Environments 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::Dialogflow::V2::Environments::Client#list_environments. -# -def list_environments - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.new - - # Call the list_environments method. - result = client.list_environments 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::Dialogflow::V2::Environment. - p item - end -end -# [END dialogflow_v2_generated_Environments_ListEnvironments_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb deleted file mode 100644 index 44842c188b53..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/environments/update_environment.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 dialogflow_v2_generated_Environments_UpdateEnvironment_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_environment call in the Environments 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::Dialogflow::V2::Environments::Client#update_environment. -# -def update_environment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Environments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new - - # Call the update_environment method. - result = client.update_environment request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. - p result -end -# [END dialogflow_v2_generated_Environments_UpdateEnvironment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb deleted file mode 100644 index 5d7394f0a225..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.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 dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_fulfillment call in the Fulfillments 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::Dialogflow::V2::Fulfillments::Client#get_fulfillment. -# -def get_fulfillment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new - - # Call the get_fulfillment method. - result = client.get_fulfillment request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. - p result -end -# [END dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb deleted file mode 100644 index f937798be201..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.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 dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_fulfillment call in the Fulfillments 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::Dialogflow::V2::Fulfillments::Client#update_fulfillment. -# -def update_fulfillment - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new - - # Call the update_fulfillment method. - result = client.update_fulfillment request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. - p result -end -# [END dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/create_generator_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/create_generator_evaluation.rb deleted file mode 100644 index a3f3fb94bcfe..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/create_generator_evaluation.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 dialogflow_v2_generated_GeneratorEvaluations_CreateGeneratorEvaluation_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_generator_evaluation call in the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::Client#create_generator_evaluation. -# -def create_generator_evaluation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new - - # Call the create_generator_evaluation method. - result = client.create_generator_evaluation request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_GeneratorEvaluations_CreateGeneratorEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/delete_generator_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/delete_generator_evaluation.rb deleted file mode 100644 index 59ce5ac33b34..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/delete_generator_evaluation.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 dialogflow_v2_generated_GeneratorEvaluations_DeleteGeneratorEvaluation_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_generator_evaluation call in the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::Client#delete_generator_evaluation. -# -def delete_generator_evaluation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new - - # Call the delete_generator_evaluation method. - result = client.delete_generator_evaluation request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_GeneratorEvaluations_DeleteGeneratorEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/get_generator_evaluation.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/get_generator_evaluation.rb deleted file mode 100644 index 36eb0a27f011..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/get_generator_evaluation.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 dialogflow_v2_generated_GeneratorEvaluations_GetGeneratorEvaluation_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_generator_evaluation call in the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::Client#get_generator_evaluation. -# -def get_generator_evaluation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new - - # Call the get_generator_evaluation method. - result = client.get_generator_evaluation request - - # The returned object is of type Google::Cloud::Dialogflow::V2::GeneratorEvaluation. - p result -end -# [END dialogflow_v2_generated_GeneratorEvaluations_GetGeneratorEvaluation_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/list_generator_evaluations.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/list_generator_evaluations.rb deleted file mode 100644 index 87f21e7f2c21..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generator_evaluations/list_generator_evaluations.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 dialogflow_v2_generated_GeneratorEvaluations_ListGeneratorEvaluations_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_generator_evaluations call in the GeneratorEvaluations 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::Dialogflow::V2::GeneratorEvaluations::Client#list_generator_evaluations. -# -def list_generator_evaluations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.new - - # Call the list_generator_evaluations method. - result = client.list_generator_evaluations 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::Dialogflow::V2::GeneratorEvaluation. - p item - end -end -# [END dialogflow_v2_generated_GeneratorEvaluations_ListGeneratorEvaluations_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/create_generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/create_generator.rb deleted file mode 100644 index 3f3c5fbcbd9a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/create_generator.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 dialogflow_v2_generated_Generators_CreateGenerator_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_generator call in the Generators 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::Dialogflow::V2::Generators::Client#create_generator. -# -def create_generator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new - - # Call the create_generator method. - result = client.create_generator request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. - p result -end -# [END dialogflow_v2_generated_Generators_CreateGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/delete_generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/delete_generator.rb deleted file mode 100644 index 2aaec0ceda4b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/delete_generator.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 dialogflow_v2_generated_Generators_DeleteGenerator_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_generator call in the Generators 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::Dialogflow::V2::Generators::Client#delete_generator. -# -def delete_generator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new - - # Call the delete_generator method. - result = client.delete_generator request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_Generators_DeleteGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/get_generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/get_generator.rb deleted file mode 100644 index 87194b7d58ff..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/get_generator.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 dialogflow_v2_generated_Generators_GetGenerator_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_generator call in the Generators 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::Dialogflow::V2::Generators::Client#get_generator. -# -def get_generator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new - - # Call the get_generator method. - result = client.get_generator request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. - p result -end -# [END dialogflow_v2_generated_Generators_GetGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/list_generators.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/list_generators.rb deleted file mode 100644 index 19b1dff473b3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/list_generators.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 dialogflow_v2_generated_Generators_ListGenerators_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_generators call in the Generators 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::Dialogflow::V2::Generators::Client#list_generators. -# -def list_generators - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.new - - # Call the list_generators method. - result = client.list_generators 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::Dialogflow::V2::Generator. - p item - end -end -# [END dialogflow_v2_generated_Generators_ListGenerators_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/update_generator.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/update_generator.rb deleted file mode 100644 index 84192e6c0cc4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/generators/update_generator.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 dialogflow_v2_generated_Generators_UpdateGenerator_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_generator call in the Generators 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::Dialogflow::V2::Generators::Client#update_generator. -# -def update_generator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Generators::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new - - # Call the update_generator method. - result = client.update_generator request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Generator. - p result -end -# [END dialogflow_v2_generated_Generators_UpdateGenerator_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb deleted file mode 100644 index 9778985ab52f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.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 dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the batch_delete_intents call in the Intents 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::Dialogflow::V2::Intents::Client#batch_delete_intents. -# -def batch_delete_intents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new - - # Call the batch_delete_intents method. - result = client.batch_delete_intents request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb deleted file mode 100644 index 3601b8579c40..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.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 dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the batch_update_intents call in the Intents 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::Dialogflow::V2::Intents::Client#batch_update_intents. -# -def batch_update_intents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new - - # Call the batch_update_intents method. - result = client.batch_update_intents request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is 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 dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb deleted file mode 100644 index 63bfadfbbdf1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/create_intent.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 dialogflow_v2_generated_Intents_CreateIntent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_intent call in the Intents 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::Dialogflow::V2::Intents::Client#create_intent. -# -def create_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new - - # Call the create_intent method. - result = client.create_intent request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. - p result -end -# [END dialogflow_v2_generated_Intents_CreateIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb deleted file mode 100644 index 1679670c7f1c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/delete_intent.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 dialogflow_v2_generated_Intents_DeleteIntent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_intent call in the Intents 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::Dialogflow::V2::Intents::Client#delete_intent. -# -def delete_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new - - # Call the delete_intent method. - result = client.delete_intent request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_Intents_DeleteIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb deleted file mode 100644 index 3117e8aa5595..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/get_intent.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 dialogflow_v2_generated_Intents_GetIntent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_intent call in the Intents 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::Dialogflow::V2::Intents::Client#get_intent. -# -def get_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new - - # Call the get_intent method. - result = client.get_intent request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. - p result -end -# [END dialogflow_v2_generated_Intents_GetIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb deleted file mode 100644 index 4913a8ffe8da..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/list_intents.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 dialogflow_v2_generated_Intents_ListIntents_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_intents call in the Intents 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::Dialogflow::V2::Intents::Client#list_intents. -# -def list_intents - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new - - # Call the list_intents method. - result = client.list_intents 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::Dialogflow::V2::Intent. - p item - end -end -# [END dialogflow_v2_generated_Intents_ListIntents_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb deleted file mode 100644 index 621afdbe41e9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/intents/update_intent.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 dialogflow_v2_generated_Intents_UpdateIntent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_intent call in the Intents 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::Dialogflow::V2::Intents::Client#update_intent. -# -def update_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Intents::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new - - # Call the update_intent method. - result = client.update_intent request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. - p result -end -# [END dialogflow_v2_generated_Intents_UpdateIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb deleted file mode 100644 index cf1a10c4cebf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.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 dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_knowledge_base call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#create_knowledge_base. -# -def create_knowledge_base - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new - - # Call the create_knowledge_base method. - result = client.create_knowledge_base request - - # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. - p result -end -# [END dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb deleted file mode 100644 index c7270d6b310a..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.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 dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_knowledge_base call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#delete_knowledge_base. -# -def delete_knowledge_base - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new - - # Call the delete_knowledge_base method. - result = client.delete_knowledge_base request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb deleted file mode 100644 index 69489a60dc25..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.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 dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_knowledge_base call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#get_knowledge_base. -# -def get_knowledge_base - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new - - # Call the get_knowledge_base method. - result = client.get_knowledge_base request - - # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. - p result -end -# [END dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb deleted file mode 100644 index 0f0aed18a5dd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.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 dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_knowledge_bases call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases. -# -def list_knowledge_bases - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.new - - # Call the list_knowledge_bases method. - result = client.list_knowledge_bases 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::Dialogflow::V2::KnowledgeBase. - p item - end -end -# [END dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb deleted file mode 100644 index 075d971a2e73..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.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 dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_knowledge_base call in the KnowledgeBases 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::Dialogflow::V2::KnowledgeBases::Client#update_knowledge_base. -# -def update_knowledge_base - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new - - # Call the update_knowledge_base method. - result = client.update_knowledge_base request - - # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. - p result -end -# [END dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb deleted file mode 100644 index 91afa9b9c512..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/analyze_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 dialogflow_v2_generated_Participants_AnalyzeContent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the analyze_content call in the Participants 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::Dialogflow::V2::Participants::Client#analyze_content. -# -def analyze_content - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new - - # Call the analyze_content method. - result = client.analyze_content request - - # The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse. - p result -end -# [END dialogflow_v2_generated_Participants_AnalyzeContent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb deleted file mode 100644 index a3103291d1e4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/create_participant.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 dialogflow_v2_generated_Participants_CreateParticipant_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_participant call in the Participants 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::Dialogflow::V2::Participants::Client#create_participant. -# -def create_participant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new - - # Call the create_participant method. - result = client.create_participant request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. - p result -end -# [END dialogflow_v2_generated_Participants_CreateParticipant_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb deleted file mode 100644 index 6ec37dc378eb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/get_participant.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 dialogflow_v2_generated_Participants_GetParticipant_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_participant call in the Participants 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::Dialogflow::V2::Participants::Client#get_participant. -# -def get_participant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new - - # Call the get_participant method. - result = client.get_participant request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. - p result -end -# [END dialogflow_v2_generated_Participants_GetParticipant_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb deleted file mode 100644 index 080296c6b533..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/list_participants.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 dialogflow_v2_generated_Participants_ListParticipants_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_participants call in the Participants 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::Dialogflow::V2::Participants::Client#list_participants. -# -def list_participants - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new - - # Call the list_participants method. - result = client.list_participants 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::Dialogflow::V2::Participant. - p item - end -end -# [END dialogflow_v2_generated_Participants_ListParticipants_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb deleted file mode 100644 index 93facb5b275e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_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 dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the streaming_analyze_content call in the Participants 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::Dialogflow::V2::Participants::Client#streaming_analyze_content. -# -def streaming_analyze_content - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the streaming_analyze_content method to start streaming. - output = client.streaming_analyze_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::Dialogflow::V2::StreamingAnalyzeContentRequest.new - input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse - output.each do |current_response| - p current_response - end -end -# [END dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb deleted file mode 100644 index 538f29e332f3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.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 dialogflow_v2_generated_Participants_SuggestArticles_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the suggest_articles call in the Participants 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::Dialogflow::V2::Participants::Client#suggest_articles. -# -def suggest_articles - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new - - # Call the suggest_articles method. - result = client.suggest_articles request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse. - p result -end -# [END dialogflow_v2_generated_Participants_SuggestArticles_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb deleted file mode 100644 index e3da7a83ee05..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.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 dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the suggest_faq_answers call in the Participants 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::Dialogflow::V2::Participants::Client#suggest_faq_answers. -# -def suggest_faq_answers - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new - - # Call the suggest_faq_answers method. - result = client.suggest_faq_answers request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse. - p result -end -# [END dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_knowledge_assist.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_knowledge_assist.rb deleted file mode 100644 index 536be88d1feb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_knowledge_assist.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 dialogflow_v2_generated_Participants_SuggestKnowledgeAssist_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the suggest_knowledge_assist call in the Participants 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::Dialogflow::V2::Participants::Client#suggest_knowledge_assist. -# -def suggest_knowledge_assist - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new - - # Call the suggest_knowledge_assist method. - result = client.suggest_knowledge_assist request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse. - p result -end -# [END dialogflow_v2_generated_Participants_SuggestKnowledgeAssist_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb deleted file mode 100644 index fac97edf6d89..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.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 dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the suggest_smart_replies call in the Participants 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::Dialogflow::V2::Participants::Client#suggest_smart_replies. -# -def suggest_smart_replies - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new - - # Call the suggest_smart_replies method. - result = client.suggest_smart_replies request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse. - p result -end -# [END dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb deleted file mode 100644 index 77c489b6dee2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/participants/update_participant.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 dialogflow_v2_generated_Participants_UpdateParticipant_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_participant call in the Participants 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::Dialogflow::V2::Participants::Client#update_participant. -# -def update_participant - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Participants::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new - - # Call the update_participant method. - result = client.update_participant request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. - p result -end -# [END dialogflow_v2_generated_Participants_UpdateParticipant_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb deleted file mode 100644 index 3d17c9351982..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.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 dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_session_entity_type call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#create_session_entity_type. -# -def create_session_entity_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new - - # Call the create_session_entity_type method. - result = client.create_session_entity_type request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. - p result -end -# [END dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb deleted file mode 100644 index a204361de978..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.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 dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_session_entity_type call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#delete_session_entity_type. -# -def delete_session_entity_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new - - # Call the delete_session_entity_type method. - result = client.delete_session_entity_type request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb deleted file mode 100644 index ba65d947e45d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.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 dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_session_entity_type call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#get_session_entity_type. -# -def get_session_entity_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new - - # Call the get_session_entity_type method. - result = client.get_session_entity_type request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. - p result -end -# [END dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb deleted file mode 100644 index 95a29e9ad076..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.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 dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_session_entity_types call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types. -# -def list_session_entity_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new - - # Call the list_session_entity_types method. - result = client.list_session_entity_types 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::Dialogflow::V2::SessionEntityType. - p item - end -end -# [END dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb deleted file mode 100644 index 59940a81d6e2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.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 dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_session_entity_type call in the SessionEntityTypes 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::Dialogflow::V2::SessionEntityTypes::Client#update_session_entity_type. -# -def update_session_entity_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new - - # Call the update_session_entity_type method. - result = client.update_session_entity_type request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. - p result -end -# [END dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb deleted file mode 100644 index 09af6a248ce9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.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 dialogflow_v2_generated_Sessions_DetectIntent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the detect_intent call in the Sessions 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::Dialogflow::V2::Sessions::Client#detect_intent. -# -def detect_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Sessions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DetectIntentRequest.new - - # Call the detect_intent method. - result = client.detect_intent request - - # The returned object is of type Google::Cloud::Dialogflow::V2::DetectIntentResponse. - p result -end -# [END dialogflow_v2_generated_Sessions_DetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb deleted file mode 100644 index 74afa7ff9efe..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.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 dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the streaming_detect_intent call in the Sessions 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::Dialogflow::V2::Sessions::Client#streaming_detect_intent. -# -def streaming_detect_intent - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Sessions::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the streaming_detect_intent method to start streaming. - output = client.streaming_detect_intent 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::Dialogflow::V2::StreamingDetectIntentRequest.new - input << Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse - output.each do |current_response| - p current_response - end -end -# [END dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/create_sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/create_sip_trunk.rb deleted file mode 100644 index 9d69dd0f4f31..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/create_sip_trunk.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 dialogflow_v2_generated_SipTrunks_CreateSipTrunk_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_sip_trunk call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#create_sip_trunk. -# -def create_sip_trunk - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new - - # Call the create_sip_trunk method. - result = client.create_sip_trunk request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. - p result -end -# [END dialogflow_v2_generated_SipTrunks_CreateSipTrunk_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/delete_sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/delete_sip_trunk.rb deleted file mode 100644 index b19bf83621a0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/delete_sip_trunk.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 dialogflow_v2_generated_SipTrunks_DeleteSipTrunk_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_sip_trunk call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#delete_sip_trunk. -# -def delete_sip_trunk - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new - - # Call the delete_sip_trunk method. - result = client.delete_sip_trunk request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_SipTrunks_DeleteSipTrunk_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/get_sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/get_sip_trunk.rb deleted file mode 100644 index 94e56b866ff4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/get_sip_trunk.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 dialogflow_v2_generated_SipTrunks_GetSipTrunk_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_sip_trunk call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#get_sip_trunk. -# -def get_sip_trunk - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new - - # Call the get_sip_trunk method. - result = client.get_sip_trunk request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. - p result -end -# [END dialogflow_v2_generated_SipTrunks_GetSipTrunk_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/list_sip_trunks.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/list_sip_trunks.rb deleted file mode 100644 index 30579a778ccf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/list_sip_trunks.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 dialogflow_v2_generated_SipTrunks_ListSipTrunks_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_sip_trunks call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#list_sip_trunks. -# -def list_sip_trunks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.new - - # Call the list_sip_trunks method. - result = client.list_sip_trunks 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::Dialogflow::V2::SipTrunk. - p item - end -end -# [END dialogflow_v2_generated_SipTrunks_ListSipTrunks_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/update_sip_trunk.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/update_sip_trunk.rb deleted file mode 100644 index 4b4b85fc8603..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/sip_trunks/update_sip_trunk.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 dialogflow_v2_generated_SipTrunks_UpdateSipTrunk_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_sip_trunk call in the SipTrunks 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::Dialogflow::V2::SipTrunks::Client#update_sip_trunk. -# -def update_sip_trunk - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::SipTrunks::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new - - # Call the update_sip_trunk method. - result = client.update_sip_trunk request - - # The returned object is of type Google::Cloud::Dialogflow::V2::SipTrunk. - p result -end -# [END dialogflow_v2_generated_SipTrunks_UpdateSipTrunk_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json deleted file mode 100644 index cbb9635bad3c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json +++ /dev/null @@ -1,5215 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-dialogflow-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.dialogflow.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "dialogflow_v2_generated_Agents_GetAgent_sync", - "title": "Snippet for the get_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#get_agent.", - "file": "agents/get_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_agent", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#get_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Agent", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" - }, - "method": { - "short_name": "GetAgent", - "full_name": "google.cloud.dialogflow.v2.Agents.GetAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.v2.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Agents_SetAgent_sync", - "title": "Snippet for the set_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#set_agent.", - "file": "agents/set_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_agent", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#set_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::SetAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Agent", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" - }, - "method": { - "short_name": "SetAgent", - "full_name": "google.cloud.dialogflow.v2.Agents.SetAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.v2.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Agents_DeleteAgent_sync", - "title": "Snippet for the delete_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#delete_agent.", - "file": "agents/delete_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_agent", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#delete_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" - }, - "method": { - "short_name": "DeleteAgent", - "full_name": "google.cloud.dialogflow.v2.Agents.DeleteAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.v2.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Agents_SearchAgents_sync", - "title": "Snippet for the search_agents call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#search_agents.", - "file": "agents/search_agents.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_agents", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#search_agents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::SearchAgentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SearchAgentsResponse", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" - }, - "method": { - "short_name": "SearchAgents", - "full_name": "google.cloud.dialogflow.v2.Agents.SearchAgents", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.v2.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Agents_TrainAgent_sync", - "title": "Snippet for the train_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#train_agent.", - "file": "agents/train_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "train_agent", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::TrainAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" - }, - "method": { - "short_name": "TrainAgent", - "full_name": "google.cloud.dialogflow.v2.Agents.TrainAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.v2.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Agents_ExportAgent_sync", - "title": "Snippet for the export_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#export_agent.", - "file": "agents/export_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_agent", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#export_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ExportAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" - }, - "method": { - "short_name": "ExportAgent", - "full_name": "google.cloud.dialogflow.v2.Agents.ExportAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.v2.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Agents_ImportAgent_sync", - "title": "Snippet for the import_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#import_agent.", - "file": "agents/import_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_agent", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#import_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ImportAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" - }, - "method": { - "short_name": "ImportAgent", - "full_name": "google.cloud.dialogflow.v2.Agents.ImportAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.v2.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Agents_RestoreAgent_sync", - "title": "Snippet for the restore_agent call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#restore_agent.", - "file": "agents/restore_agent.rb", - "language": "RUBY", - "client_method": { - "short_name": "restore_agent", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#restore_agent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::RestoreAgentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" - }, - "method": { - "short_name": "RestoreAgent", - "full_name": "google.cloud.dialogflow.v2.Agents.RestoreAgent", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.v2.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Agents_GetValidationResult_sync", - "title": "Snippet for the get_validation_result call in the Agents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Agents::Client#get_validation_result.", - "file": "agents/get_validation_result.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_validation_result", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client#get_validation_result", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetValidationResultRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ValidationResult", - "client": { - "short_name": "Agents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Agents::Client" - }, - "method": { - "short_name": "GetValidationResult", - "full_name": "google.cloud.dialogflow.v2.Agents.GetValidationResult", - "service": { - "short_name": "Agents", - "full_name": "google.cloud.dialogflow.v2.Agents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Tools_CreateTool_sync", - "title": "Snippet for the create_tool call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#create_tool.", - "file": "tools/create_tool.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_tool", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#create_tool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateToolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Tool", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" - }, - "method": { - "short_name": "CreateTool", - "full_name": "google.cloud.dialogflow.v2.Tools.CreateTool", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.v2.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Tools_GetTool_sync", - "title": "Snippet for the get_tool call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#get_tool.", - "file": "tools/get_tool.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_tool", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#get_tool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetToolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Tool", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" - }, - "method": { - "short_name": "GetTool", - "full_name": "google.cloud.dialogflow.v2.Tools.GetTool", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.v2.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Tools_ListTools_sync", - "title": "Snippet for the list_tools call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#list_tools.", - "file": "tools/list_tools.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tools", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#list_tools", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListToolsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListToolsResponse", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" - }, - "method": { - "short_name": "ListTools", - "full_name": "google.cloud.dialogflow.v2.Tools.ListTools", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.v2.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Tools_DeleteTool_sync", - "title": "Snippet for the delete_tool call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#delete_tool.", - "file": "tools/delete_tool.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_tool", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#delete_tool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteToolRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" - }, - "method": { - "short_name": "DeleteTool", - "full_name": "google.cloud.dialogflow.v2.Tools.DeleteTool", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.v2.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Tools_UpdateTool_sync", - "title": "Snippet for the update_tool call in the Tools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Tools::Client#update_tool.", - "file": "tools/update_tool.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_tool", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client#update_tool", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateToolRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Tool", - "client": { - "short_name": "Tools::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Tools::Client" - }, - "method": { - "short_name": "UpdateTool", - "full_name": "google.cloud.dialogflow.v2.Tools.UpdateTool", - "service": { - "short_name": "Tools", - "full_name": "google.cloud.dialogflow.v2.Tools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Generators_CreateGenerator_sync", - "title": "Snippet for the create_generator call in the Generators service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#create_generator.", - "file": "generators/create_generator.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_generator", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#create_generator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Generator", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" - }, - "method": { - "short_name": "CreateGenerator", - "full_name": "google.cloud.dialogflow.v2.Generators.CreateGenerator", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.v2.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Generators_GetGenerator_sync", - "title": "Snippet for the get_generator call in the Generators service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#get_generator.", - "file": "generators/get_generator.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_generator", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#get_generator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetGeneratorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Generator", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" - }, - "method": { - "short_name": "GetGenerator", - "full_name": "google.cloud.dialogflow.v2.Generators.GetGenerator", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.v2.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Generators_ListGenerators_sync", - "title": "Snippet for the list_generators call in the Generators service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#list_generators.", - "file": "generators/list_generators.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_generators", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#list_generators", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" - }, - "method": { - "short_name": "ListGenerators", - "full_name": "google.cloud.dialogflow.v2.Generators.ListGenerators", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.v2.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Generators_DeleteGenerator_sync", - "title": "Snippet for the delete_generator call in the Generators service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#delete_generator.", - "file": "generators/delete_generator.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_generator", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#delete_generator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" - }, - "method": { - "short_name": "DeleteGenerator", - "full_name": "google.cloud.dialogflow.v2.Generators.DeleteGenerator", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.v2.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Generators_UpdateGenerator_sync", - "title": "Snippet for the update_generator call in the Generators service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Generators::Client#update_generator.", - "file": "generators/update_generator.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_generator", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client#update_generator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Generator", - "client": { - "short_name": "Generators::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Generators::Client" - }, - "method": { - "short_name": "UpdateGenerator", - "full_name": "google.cloud.dialogflow.v2.Generators.UpdateGenerator", - "service": { - "short_name": "Generators", - "full_name": "google.cloud.dialogflow.v2.Generators" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Contexts_ListContexts_sync", - "title": "Snippet for the list_contexts call in the Contexts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#list_contexts.", - "file": "contexts/list_contexts.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_contexts", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#list_contexts", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListContextsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListContextsResponse", - "client": { - "short_name": "Contexts::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" - }, - "method": { - "short_name": "ListContexts", - "full_name": "google.cloud.dialogflow.v2.Contexts.ListContexts", - "service": { - "short_name": "Contexts", - "full_name": "google.cloud.dialogflow.v2.Contexts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Contexts_GetContext_sync", - "title": "Snippet for the get_context call in the Contexts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#get_context.", - "file": "contexts/get_context.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_context", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#get_context", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetContextRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Context", - "client": { - "short_name": "Contexts::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" - }, - "method": { - "short_name": "GetContext", - "full_name": "google.cloud.dialogflow.v2.Contexts.GetContext", - "service": { - "short_name": "Contexts", - "full_name": "google.cloud.dialogflow.v2.Contexts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Contexts_CreateContext_sync", - "title": "Snippet for the create_context call in the Contexts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#create_context.", - "file": "contexts/create_context.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_context", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#create_context", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateContextRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Context", - "client": { - "short_name": "Contexts::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" - }, - "method": { - "short_name": "CreateContext", - "full_name": "google.cloud.dialogflow.v2.Contexts.CreateContext", - "service": { - "short_name": "Contexts", - "full_name": "google.cloud.dialogflow.v2.Contexts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Contexts_UpdateContext_sync", - "title": "Snippet for the update_context call in the Contexts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#update_context.", - "file": "contexts/update_context.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_context", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#update_context", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateContextRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Context", - "client": { - "short_name": "Contexts::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" - }, - "method": { - "short_name": "UpdateContext", - "full_name": "google.cloud.dialogflow.v2.Contexts.UpdateContext", - "service": { - "short_name": "Contexts", - "full_name": "google.cloud.dialogflow.v2.Contexts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Contexts_DeleteContext_sync", - "title": "Snippet for the delete_context call in the Contexts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#delete_context.", - "file": "contexts/delete_context.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_context", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#delete_context", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteContextRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Contexts::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" - }, - "method": { - "short_name": "DeleteContext", - "full_name": "google.cloud.dialogflow.v2.Contexts.DeleteContext", - "service": { - "short_name": "Contexts", - "full_name": "google.cloud.dialogflow.v2.Contexts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Contexts_DeleteAllContexts_sync", - "title": "Snippet for the delete_all_contexts call in the Contexts service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Contexts::Client#delete_all_contexts.", - "file": "contexts/delete_all_contexts.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_all_contexts", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client#delete_all_contexts", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Contexts::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Contexts::Client" - }, - "method": { - "short_name": "DeleteAllContexts", - "full_name": "google.cloud.dialogflow.v2.Contexts.DeleteAllContexts", - "service": { - "short_name": "Contexts", - "full_name": "google.cloud.dialogflow.v2.Contexts" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Intents_ListIntents_sync", - "title": "Snippet for the list_intents call in the Intents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#list_intents.", - "file": "intents/list_intents.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_intents", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#list_intents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListIntentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListIntentsResponse", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" - }, - "method": { - "short_name": "ListIntents", - "full_name": "google.cloud.dialogflow.v2.Intents.ListIntents", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.v2.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Intents_GetIntent_sync", - "title": "Snippet for the get_intent call in the Intents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#get_intent.", - "file": "intents/get_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_intent", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#get_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Intent", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" - }, - "method": { - "short_name": "GetIntent", - "full_name": "google.cloud.dialogflow.v2.Intents.GetIntent", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.v2.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Intents_CreateIntent_sync", - "title": "Snippet for the create_intent call in the Intents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#create_intent.", - "file": "intents/create_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_intent", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#create_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Intent", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" - }, - "method": { - "short_name": "CreateIntent", - "full_name": "google.cloud.dialogflow.v2.Intents.CreateIntent", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.v2.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Intents_UpdateIntent_sync", - "title": "Snippet for the update_intent call in the Intents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#update_intent.", - "file": "intents/update_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_intent", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#update_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Intent", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" - }, - "method": { - "short_name": "UpdateIntent", - "full_name": "google.cloud.dialogflow.v2.Intents.UpdateIntent", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.v2.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Intents_DeleteIntent_sync", - "title": "Snippet for the delete_intent call in the Intents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#delete_intent.", - "file": "intents/delete_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_intent", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#delete_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" - }, - "method": { - "short_name": "DeleteIntent", - "full_name": "google.cloud.dialogflow.v2.Intents.DeleteIntent", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.v2.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Intents_BatchUpdateIntents_sync", - "title": "Snippet for the batch_update_intents call in the Intents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents.", - "file": "intents/batch_update_intents.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_update_intents", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" - }, - "method": { - "short_name": "BatchUpdateIntents", - "full_name": "google.cloud.dialogflow.v2.Intents.BatchUpdateIntents", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.v2.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Intents_BatchDeleteIntents_sync", - "title": "Snippet for the batch_delete_intents call in the Intents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Intents::Client#batch_delete_intents.", - "file": "intents/batch_delete_intents.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_delete_intents", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client#batch_delete_intents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Intents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Intents::Client" - }, - "method": { - "short_name": "BatchDeleteIntents", - "full_name": "google.cloud.dialogflow.v2.Intents.BatchDeleteIntents", - "service": { - "short_name": "Intents", - "full_name": "google.cloud.dialogflow.v2.Intents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync", - "title": "Snippet for the list_entity_types call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#list_entity_types.", - "file": "entity_types/list_entity_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_entity_types", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#list_entity_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "ListEntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_GetEntityType_sync", - "title": "Snippet for the get_entity_type call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#get_entity_type.", - "file": "entity_types/get_entity_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_entity_type", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#get_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::EntityType", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "GetEntityType", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.GetEntityType", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_CreateEntityType_sync", - "title": "Snippet for the create_entity_type call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#create_entity_type.", - "file": "entity_types/create_entity_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_entity_type", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#create_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::EntityType", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "CreateEntityType", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.CreateEntityType", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync", - "title": "Snippet for the update_entity_type call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#update_entity_type.", - "file": "entity_types/update_entity_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_entity_type", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#update_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::EntityType", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "UpdateEntityType", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync", - "title": "Snippet for the delete_entity_type call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#delete_entity_type.", - "file": "entity_types/delete_entity_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_entity_type", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#delete_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "DeleteEntityType", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.DeleteEntityType", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync", - "title": "Snippet for the batch_update_entity_types call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types.", - "file": "entity_types/batch_update_entity_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_update_entity_types", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "BatchUpdateEntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync", - "title": "Snippet for the batch_delete_entity_types call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entity_types.", - "file": "entity_types/batch_delete_entity_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_delete_entity_types", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entity_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "BatchDeleteEntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypes", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync", - "title": "Snippet for the batch_create_entities call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_create_entities.", - "file": "entity_types/batch_create_entities.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_create_entities", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_create_entities", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "BatchCreateEntities", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntities", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync", - "title": "Snippet for the batch_update_entities call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entities.", - "file": "entity_types/batch_update_entities.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_update_entities", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entities", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "BatchUpdateEntities", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntities", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync", - "title": "Snippet for the batch_delete_entities call in the EntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entities.", - "file": "entity_types/batch_delete_entities.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_delete_entities", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entities", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EntityTypes::Client" - }, - "method": { - "short_name": "BatchDeleteEntities", - "full_name": "google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntities", - "service": { - "short_name": "EntityTypes", - "full_name": "google.cloud.dialogflow.v2.EntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync", - "title": "Snippet for the list_session_entity_types call in the SessionEntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types.", - "file": "session_entity_types/list_session_entity_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_session_entity_types", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" - }, - "method": { - "short_name": "ListSessionEntityTypes", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync", - "title": "Snippet for the get_session_entity_type call in the SessionEntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#get_session_entity_type.", - "file": "session_entity_types/get_session_entity_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_session_entity_type", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#get_session_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SessionEntityType", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" - }, - "method": { - "short_name": "GetSessionEntityType", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityType", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync", - "title": "Snippet for the create_session_entity_type call in the SessionEntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#create_session_entity_type.", - "file": "session_entity_types/create_session_entity_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_session_entity_type", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#create_session_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SessionEntityType", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" - }, - "method": { - "short_name": "CreateSessionEntityType", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityType", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync", - "title": "Snippet for the update_session_entity_type call in the SessionEntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#update_session_entity_type.", - "file": "session_entity_types/update_session_entity_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_session_entity_type", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#update_session_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SessionEntityType", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" - }, - "method": { - "short_name": "UpdateSessionEntityType", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityType", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync", - "title": "Snippet for the delete_session_entity_type call in the SessionEntityTypes service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#delete_session_entity_type.", - "file": "session_entity_types/delete_session_entity_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_session_entity_type", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#delete_session_entity_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SessionEntityTypes::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client" - }, - "method": { - "short_name": "DeleteSessionEntityType", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityType", - "service": { - "short_name": "SessionEntityTypes", - "full_name": "google.cloud.dialogflow.v2.SessionEntityTypes" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Sessions_DetectIntent_sync", - "title": "Snippet for the detect_intent call in the Sessions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent.", - "file": "sessions/detect_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "detect_intent", - "full_name": "::Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DetectIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::DetectIntentResponse", - "client": { - "short_name": "Sessions::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Sessions::Client" - }, - "method": { - "short_name": "DetectIntent", - "full_name": "google.cloud.dialogflow.v2.Sessions.DetectIntent", - "service": { - "short_name": "Sessions", - "full_name": "google.cloud.dialogflow.v2.Sessions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync", - "title": "Snippet for the streaming_detect_intent call in the Sessions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent.", - "file": "sessions/streaming_detect_intent.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_detect_intent", - "full_name": "::Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse", - "client": { - "short_name": "Sessions::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Sessions::Client" - }, - "method": { - "short_name": "StreamingDetectIntent", - "full_name": "google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent", - "service": { - "short_name": "Sessions", - "full_name": "google.cloud.dialogflow.v2.Sessions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_CreateParticipant_sync", - "title": "Snippet for the create_participant call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#create_participant.", - "file": "participants/create_participant.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_participant", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#create_participant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateParticipantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Participant", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "CreateParticipant", - "full_name": "google.cloud.dialogflow.v2.Participants.CreateParticipant", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_GetParticipant_sync", - "title": "Snippet for the get_participant call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#get_participant.", - "file": "participants/get_participant.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_participant", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#get_participant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetParticipantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Participant", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "GetParticipant", - "full_name": "google.cloud.dialogflow.v2.Participants.GetParticipant", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_ListParticipants_sync", - "title": "Snippet for the list_participants call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#list_participants.", - "file": "participants/list_participants.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_participants", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#list_participants", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListParticipantsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListParticipantsResponse", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "ListParticipants", - "full_name": "google.cloud.dialogflow.v2.Participants.ListParticipants", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_UpdateParticipant_sync", - "title": "Snippet for the update_participant call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#update_participant.", - "file": "participants/update_participant.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_participant", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#update_participant", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Participant", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "UpdateParticipant", - "full_name": "google.cloud.dialogflow.v2.Participants.UpdateParticipant", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_AnalyzeContent_sync", - "title": "Snippet for the analyze_content call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content.", - "file": "participants/analyze_content.rb", - "language": "RUBY", - "client_method": { - "short_name": "analyze_content", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "AnalyzeContent", - "full_name": "google.cloud.dialogflow.v2.Participants.AnalyzeContent", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync", - "title": "Snippet for the streaming_analyze_content call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content.", - "file": "participants/streaming_analyze_content.rb", - "language": "RUBY", - "client_method": { - "short_name": "streaming_analyze_content", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "StreamingAnalyzeContent", - "full_name": "google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_SuggestArticles_sync", - "title": "Snippet for the suggest_articles call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles.", - "file": "participants/suggest_articles.rb", - "language": "RUBY", - "client_method": { - "short_name": "suggest_articles", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "SuggestArticles", - "full_name": "google.cloud.dialogflow.v2.Participants.SuggestArticles", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync", - "title": "Snippet for the suggest_faq_answers call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#suggest_faq_answers.", - "file": "participants/suggest_faq_answers.rb", - "language": "RUBY", - "client_method": { - "short_name": "suggest_faq_answers", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_faq_answers", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "SuggestFaqAnswers", - "full_name": "google.cloud.dialogflow.v2.Participants.SuggestFaqAnswers", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_SuggestSmartReplies_sync", - "title": "Snippet for the suggest_smart_replies call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#suggest_smart_replies.", - "file": "participants/suggest_smart_replies.rb", - "language": "RUBY", - "client_method": { - "short_name": "suggest_smart_replies", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_smart_replies", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "SuggestSmartReplies", - "full_name": "google.cloud.dialogflow.v2.Participants.SuggestSmartReplies", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Participants_SuggestKnowledgeAssist_sync", - "title": "Snippet for the suggest_knowledge_assist call in the Participants service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist.", - "file": "participants/suggest_knowledge_assist.rb", - "language": "RUBY", - "client_method": { - "short_name": "suggest_knowledge_assist", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_knowledge_assist", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse", - "client": { - "short_name": "Participants::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" - }, - "method": { - "short_name": "SuggestKnowledgeAssist", - "full_name": "google.cloud.dialogflow.v2.Participants.SuggestKnowledgeAssist", - "service": { - "short_name": "Participants", - "full_name": "google.cloud.dialogflow.v2.Participants" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync", - "title": "Snippet for the list_answer_records call in the AnswerRecords service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records.", - "file": "answer_records/list_answer_records.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_answer_records", - "full_name": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse", - "client": { - "short_name": "AnswerRecords::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client" - }, - "method": { - "short_name": "ListAnswerRecords", - "full_name": "google.cloud.dialogflow.v2.AnswerRecords.ListAnswerRecords", - "service": { - "short_name": "AnswerRecords", - "full_name": "google.cloud.dialogflow.v2.AnswerRecords" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync", - "title": "Snippet for the update_answer_record call in the AnswerRecords service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record.", - "file": "answer_records/update_answer_record.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_answer_record", - "full_name": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::AnswerRecord", - "client": { - "short_name": "AnswerRecords::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::AnswerRecords::Client" - }, - "method": { - "short_name": "UpdateAnswerRecord", - "full_name": "google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord", - "service": { - "short_name": "AnswerRecords", - "full_name": "google.cloud.dialogflow.v2.AnswerRecords" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync", - "title": "Snippet for the list_conversation_profiles call in the ConversationProfiles service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles.", - "file": "conversation_profiles/list_conversation_profiles.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_conversation_profiles", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse", - "client": { - "short_name": "ConversationProfiles::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" - }, - "method": { - "short_name": "ListConversationProfiles", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.ListConversationProfiles", - "service": { - "short_name": "ConversationProfiles", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync", - "title": "Snippet for the get_conversation_profile call in the ConversationProfiles service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile.", - "file": "conversation_profiles/get_conversation_profile.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_conversation_profile", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ConversationProfile", - "client": { - "short_name": "ConversationProfiles::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" - }, - "method": { - "short_name": "GetConversationProfile", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile", - "service": { - "short_name": "ConversationProfiles", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync", - "title": "Snippet for the create_conversation_profile call in the ConversationProfiles service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#create_conversation_profile.", - "file": "conversation_profiles/create_conversation_profile.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_conversation_profile", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#create_conversation_profile", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ConversationProfile", - "client": { - "short_name": "ConversationProfiles::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" - }, - "method": { - "short_name": "CreateConversationProfile", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.CreateConversationProfile", - "service": { - "short_name": "ConversationProfiles", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync", - "title": "Snippet for the update_conversation_profile call in the ConversationProfiles service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#update_conversation_profile.", - "file": "conversation_profiles/update_conversation_profile.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_conversation_profile", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#update_conversation_profile", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ConversationProfile", - "client": { - "short_name": "ConversationProfiles::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" - }, - "method": { - "short_name": "UpdateConversationProfile", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.UpdateConversationProfile", - "service": { - "short_name": "ConversationProfiles", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync", - "title": "Snippet for the delete_conversation_profile call in the ConversationProfiles service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#delete_conversation_profile.", - "file": "conversation_profiles/delete_conversation_profile.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_conversation_profile", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#delete_conversation_profile", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ConversationProfiles::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" - }, - "method": { - "short_name": "DeleteConversationProfile", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.DeleteConversationProfile", - "service": { - "short_name": "ConversationProfiles", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync", - "title": "Snippet for the set_suggestion_feature_config call in the ConversationProfiles service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config.", - "file": "conversation_profiles/set_suggestion_feature_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_suggestion_feature_config", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationProfiles::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" - }, - "method": { - "short_name": "SetSuggestionFeatureConfig", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.SetSuggestionFeatureConfig", - "service": { - "short_name": "ConversationProfiles", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync", - "title": "Snippet for the clear_suggestion_feature_config call in the ConversationProfiles service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config.", - "file": "conversation_profiles/clear_suggestion_feature_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "clear_suggestion_feature_config", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationProfiles::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client" - }, - "method": { - "short_name": "ClearSuggestionFeatureConfig", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles.ClearSuggestionFeatureConfig", - "service": { - "short_name": "ConversationProfiles", - "full_name": "google.cloud.dialogflow.v2.ConversationProfiles" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_CreateConversation_sync", - "title": "Snippet for the create_conversation call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#create_conversation.", - "file": "conversations/create_conversation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_conversation", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#create_conversation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateConversationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Conversation", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "CreateConversation", - "full_name": "google.cloud.dialogflow.v2.Conversations.CreateConversation", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_ListConversations_sync", - "title": "Snippet for the list_conversations call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#list_conversations.", - "file": "conversations/list_conversations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_conversations", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#list_conversations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListConversationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationsResponse", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "ListConversations", - "full_name": "google.cloud.dialogflow.v2.Conversations.ListConversations", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_GetConversation_sync", - "title": "Snippet for the get_conversation call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#get_conversation.", - "file": "conversations/get_conversation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_conversation", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#get_conversation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetConversationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Conversation", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "GetConversation", - "full_name": "google.cloud.dialogflow.v2.Conversations.GetConversation", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_CompleteConversation_sync", - "title": "Snippet for the complete_conversation call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#complete_conversation.", - "file": "conversations/complete_conversation.rb", - "language": "RUBY", - "client_method": { - "short_name": "complete_conversation", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#complete_conversation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CompleteConversationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Conversation", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "CompleteConversation", - "full_name": "google.cloud.dialogflow.v2.Conversations.CompleteConversation", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_IngestContextReferences_sync", - "title": "Snippet for the ingest_context_references call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#ingest_context_references.", - "file": "conversations/ingest_context_references.rb", - "language": "RUBY", - "client_method": { - "short_name": "ingest_context_references", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#ingest_context_references", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "IngestContextReferences", - "full_name": "google.cloud.dialogflow.v2.Conversations.IngestContextReferences", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_ListMessages_sync", - "title": "Snippet for the list_messages call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages.", - "file": "conversations/list_messages.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_messages", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListMessagesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListMessagesResponse", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "ListMessages", - "full_name": "google.cloud.dialogflow.v2.Conversations.ListMessages", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_SuggestConversationSummary_sync", - "title": "Snippet for the suggest_conversation_summary call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#suggest_conversation_summary.", - "file": "conversations/suggest_conversation_summary.rb", - "language": "RUBY", - "client_method": { - "short_name": "suggest_conversation_summary", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#suggest_conversation_summary", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "SuggestConversationSummary", - "full_name": "google.cloud.dialogflow.v2.Conversations.SuggestConversationSummary", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_GenerateStatelessSummary_sync", - "title": "Snippet for the generate_stateless_summary call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_summary.", - "file": "conversations/generate_stateless_summary.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_stateless_summary", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_summary", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "GenerateStatelessSummary", - "full_name": "google.cloud.dialogflow.v2.Conversations.GenerateStatelessSummary", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_sync", - "title": "Snippet for the generate_stateless_suggestion call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion.", - "file": "conversations/generate_stateless_suggestion.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_stateless_suggestion", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_stateless_suggestion", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "GenerateStatelessSuggestion", - "full_name": "google.cloud.dialogflow.v2.Conversations.GenerateStatelessSuggestion", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_SearchKnowledge_sync", - "title": "Snippet for the search_knowledge call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#search_knowledge.", - "file": "conversations/search_knowledge.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_knowledge", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#search_knowledge", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "SearchKnowledge", - "full_name": "google.cloud.dialogflow.v2.Conversations.SearchKnowledge", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Conversations_GenerateSuggestions_sync", - "title": "Snippet for the generate_suggestions call in the Conversations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Conversations::Client#generate_suggestions.", - "file": "conversations/generate_suggestions.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_suggestions", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client#generate_suggestions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse", - "client": { - "short_name": "Conversations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Conversations::Client" - }, - "method": { - "short_name": "GenerateSuggestions", - "full_name": "google.cloud.dialogflow.v2.Conversations.GenerateSuggestions", - "service": { - "short_name": "Conversations", - "full_name": "google.cloud.dialogflow.v2.Conversations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync", - "title": "Snippet for the create_conversation_dataset call in the ConversationDatasets service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#create_conversation_dataset.", - "file": "conversation_datasets/create_conversation_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_conversation_dataset", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#create_conversation_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationDatasets::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" - }, - "method": { - "short_name": "CreateConversationDataset", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.CreateConversationDataset", - "service": { - "short_name": "ConversationDatasets", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync", - "title": "Snippet for the get_conversation_dataset call in the ConversationDatasets service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#get_conversation_dataset.", - "file": "conversation_datasets/get_conversation_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_conversation_dataset", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#get_conversation_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ConversationDataset", - "client": { - "short_name": "ConversationDatasets::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" - }, - "method": { - "short_name": "GetConversationDataset", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.GetConversationDataset", - "service": { - "short_name": "ConversationDatasets", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync", - "title": "Snippet for the list_conversation_datasets call in the ConversationDatasets service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets.", - "file": "conversation_datasets/list_conversation_datasets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_conversation_datasets", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse", - "client": { - "short_name": "ConversationDatasets::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" - }, - "method": { - "short_name": "ListConversationDatasets", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets", - "service": { - "short_name": "ConversationDatasets", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync", - "title": "Snippet for the delete_conversation_dataset call in the ConversationDatasets service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#delete_conversation_dataset.", - "file": "conversation_datasets/delete_conversation_dataset.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_conversation_dataset", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#delete_conversation_dataset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationDatasets::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" - }, - "method": { - "short_name": "DeleteConversationDataset", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.DeleteConversationDataset", - "service": { - "short_name": "ConversationDatasets", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync", - "title": "Snippet for the import_conversation_data call in the ConversationDatasets service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data.", - "file": "conversation_datasets/import_conversation_data.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_conversation_data", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationDatasets::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client" - }, - "method": { - "short_name": "ImportConversationData", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData", - "service": { - "short_name": "ConversationDatasets", - "full_name": "google.cloud.dialogflow.v2.ConversationDatasets" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync", - "title": "Snippet for the create_conversation_model call in the ConversationModels service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model.", - "file": "conversation_models/create_conversation_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_conversation_model", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationModels::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" - }, - "method": { - "short_name": "CreateConversationModel", - "full_name": "google.cloud.dialogflow.v2.ConversationModels.CreateConversationModel", - "service": { - "short_name": "ConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationModels_GetConversationModel_sync", - "title": "Snippet for the get_conversation_model call in the ConversationModels service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model.", - "file": "conversation_models/get_conversation_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_conversation_model", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetConversationModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ConversationModel", - "client": { - "short_name": "ConversationModels::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" - }, - "method": { - "short_name": "GetConversationModel", - "full_name": "google.cloud.dialogflow.v2.ConversationModels.GetConversationModel", - "service": { - "short_name": "ConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationModels_ListConversationModels_sync", - "title": "Snippet for the list_conversation_models call in the ConversationModels service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_models.", - "file": "conversation_models/list_conversation_models.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_conversation_models", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_models", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse", - "client": { - "short_name": "ConversationModels::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" - }, - "method": { - "short_name": "ListConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels.ListConversationModels", - "service": { - "short_name": "ConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync", - "title": "Snippet for the delete_conversation_model call in the ConversationModels service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#delete_conversation_model.", - "file": "conversation_models/delete_conversation_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_conversation_model", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#delete_conversation_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationModels::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" - }, - "method": { - "short_name": "DeleteConversationModel", - "full_name": "google.cloud.dialogflow.v2.ConversationModels.DeleteConversationModel", - "service": { - "short_name": "ConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync", - "title": "Snippet for the deploy_conversation_model call in the ConversationModels service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model.", - "file": "conversation_models/deploy_conversation_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "deploy_conversation_model", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationModels::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" - }, - "method": { - "short_name": "DeployConversationModel", - "full_name": "google.cloud.dialogflow.v2.ConversationModels.DeployConversationModel", - "service": { - "short_name": "ConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync", - "title": "Snippet for the undeploy_conversation_model call in the ConversationModels service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model.", - "file": "conversation_models/undeploy_conversation_model.rb", - "language": "RUBY", - "client_method": { - "short_name": "undeploy_conversation_model", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationModels::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" - }, - "method": { - "short_name": "UndeployConversationModel", - "full_name": "google.cloud.dialogflow.v2.ConversationModels.UndeployConversationModel", - "service": { - "short_name": "ConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync", - "title": "Snippet for the get_conversation_model_evaluation call in the ConversationModels service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model_evaluation.", - "file": "conversation_models/get_conversation_model_evaluation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_conversation_model_evaluation", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model_evaluation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation", - "client": { - "short_name": "ConversationModels::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" - }, - "method": { - "short_name": "GetConversationModelEvaluation", - "full_name": "google.cloud.dialogflow.v2.ConversationModels.GetConversationModelEvaluation", - "service": { - "short_name": "ConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync", - "title": "Snippet for the list_conversation_model_evaluations call in the ConversationModels service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations.", - "file": "conversation_models/list_conversation_model_evaluations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_conversation_model_evaluations", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse", - "client": { - "short_name": "ConversationModels::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" - }, - "method": { - "short_name": "ListConversationModelEvaluations", - "full_name": "google.cloud.dialogflow.v2.ConversationModels.ListConversationModelEvaluations", - "service": { - "short_name": "ConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync", - "title": "Snippet for the create_conversation_model_evaluation call in the ConversationModels service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation.", - "file": "conversation_models/create_conversation_model_evaluation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_conversation_model_evaluation", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ConversationModels::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::ConversationModels::Client" - }, - "method": { - "short_name": "CreateConversationModelEvaluation", - "full_name": "google.cloud.dialogflow.v2.ConversationModels.CreateConversationModelEvaluation", - "service": { - "short_name": "ConversationModels", - "full_name": "google.cloud.dialogflow.v2.ConversationModels" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Documents_ListDocuments_sync", - "title": "Snippet for the list_documents call in the Documents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#list_documents.", - "file": "documents/list_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_documents", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#list_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListDocumentsResponse", - "client": { - "short_name": "Documents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" - }, - "method": { - "short_name": "ListDocuments", - "full_name": "google.cloud.dialogflow.v2.Documents.ListDocuments", - "service": { - "short_name": "Documents", - "full_name": "google.cloud.dialogflow.v2.Documents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Documents_GetDocument_sync", - "title": "Snippet for the get_document call in the Documents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#get_document.", - "file": "documents/get_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_document", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#get_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Document", - "client": { - "short_name": "Documents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" - }, - "method": { - "short_name": "GetDocument", - "full_name": "google.cloud.dialogflow.v2.Documents.GetDocument", - "service": { - "short_name": "Documents", - "full_name": "google.cloud.dialogflow.v2.Documents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Documents_CreateDocument_sync", - "title": "Snippet for the create_document call in the Documents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#create_document.", - "file": "documents/create_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_document", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#create_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Documents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" - }, - "method": { - "short_name": "CreateDocument", - "full_name": "google.cloud.dialogflow.v2.Documents.CreateDocument", - "service": { - "short_name": "Documents", - "full_name": "google.cloud.dialogflow.v2.Documents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Documents_ImportDocuments_sync", - "title": "Snippet for the import_documents call in the Documents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#import_documents.", - "file": "documents/import_documents.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_documents", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#import_documents", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Documents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" - }, - "method": { - "short_name": "ImportDocuments", - "full_name": "google.cloud.dialogflow.v2.Documents.ImportDocuments", - "service": { - "short_name": "Documents", - "full_name": "google.cloud.dialogflow.v2.Documents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Documents_DeleteDocument_sync", - "title": "Snippet for the delete_document call in the Documents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#delete_document.", - "file": "documents/delete_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_document", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#delete_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Documents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" - }, - "method": { - "short_name": "DeleteDocument", - "full_name": "google.cloud.dialogflow.v2.Documents.DeleteDocument", - "service": { - "short_name": "Documents", - "full_name": "google.cloud.dialogflow.v2.Documents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Documents_UpdateDocument_sync", - "title": "Snippet for the update_document call in the Documents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#update_document.", - "file": "documents/update_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_document", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#update_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Documents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" - }, - "method": { - "short_name": "UpdateDocument", - "full_name": "google.cloud.dialogflow.v2.Documents.UpdateDocument", - "service": { - "short_name": "Documents", - "full_name": "google.cloud.dialogflow.v2.Documents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Documents_ReloadDocument_sync", - "title": "Snippet for the reload_document call in the Documents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#reload_document.", - "file": "documents/reload_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "reload_document", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#reload_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Documents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" - }, - "method": { - "short_name": "ReloadDocument", - "full_name": "google.cloud.dialogflow.v2.Documents.ReloadDocument", - "service": { - "short_name": "Documents", - "full_name": "google.cloud.dialogflow.v2.Documents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Documents_ExportDocument_sync", - "title": "Snippet for the export_document call in the Documents service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Documents::Client#export_document.", - "file": "documents/export_document.rb", - "language": "RUBY", - "client_method": { - "short_name": "export_document", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client#export_document", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ExportDocumentRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Documents::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Documents::Client" - }, - "method": { - "short_name": "ExportDocument", - "full_name": "google.cloud.dialogflow.v2.Documents.ExportDocument", - "service": { - "short_name": "Documents", - "full_name": "google.cloud.dialogflow.v2.Documents" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EncryptionSpecService_GetEncryptionSpec_sync", - "title": "Snippet for the get_encryption_spec call in the EncryptionSpecService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client#get_encryption_spec.", - "file": "encryption_spec_service/get_encryption_spec.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_encryption_spec", - "full_name": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client#get_encryption_spec", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::EncryptionSpec", - "client": { - "short_name": "EncryptionSpecService::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client" - }, - "method": { - "short_name": "GetEncryptionSpec", - "full_name": "google.cloud.dialogflow.v2.EncryptionSpecService.GetEncryptionSpec", - "service": { - "short_name": "EncryptionSpecService", - "full_name": "google.cloud.dialogflow.v2.EncryptionSpecService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_EncryptionSpecService_InitializeEncryptionSpec_sync", - "title": "Snippet for the initialize_encryption_spec call in the EncryptionSpecService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client#initialize_encryption_spec.", - "file": "encryption_spec_service/initialize_encryption_spec.rb", - "language": "RUBY", - "client_method": { - "short_name": "initialize_encryption_spec", - "full_name": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client#initialize_encryption_spec", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "EncryptionSpecService::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client" - }, - "method": { - "short_name": "InitializeEncryptionSpec", - "full_name": "google.cloud.dialogflow.v2.EncryptionSpecService.InitializeEncryptionSpec", - "service": { - "short_name": "EncryptionSpecService", - "full_name": "google.cloud.dialogflow.v2.EncryptionSpecService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Fulfillments_GetFulfillment_sync", - "title": "Snippet for the get_fulfillment call in the Fulfillments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Fulfillments::Client#get_fulfillment.", - "file": "fulfillments/get_fulfillment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_fulfillment", - "full_name": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client#get_fulfillment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Fulfillment", - "client": { - "short_name": "Fulfillments::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client" - }, - "method": { - "short_name": "GetFulfillment", - "full_name": "google.cloud.dialogflow.v2.Fulfillments.GetFulfillment", - "service": { - "short_name": "Fulfillments", - "full_name": "google.cloud.dialogflow.v2.Fulfillments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync", - "title": "Snippet for the update_fulfillment call in the Fulfillments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Fulfillments::Client#update_fulfillment.", - "file": "fulfillments/update_fulfillment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_fulfillment", - "full_name": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client#update_fulfillment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Fulfillment", - "client": { - "short_name": "Fulfillments::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Fulfillments::Client" - }, - "method": { - "short_name": "UpdateFulfillment", - "full_name": "google.cloud.dialogflow.v2.Fulfillments.UpdateFulfillment", - "service": { - "short_name": "Fulfillments", - "full_name": "google.cloud.dialogflow.v2.Fulfillments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Environments_ListEnvironments_sync", - "title": "Snippet for the list_environments call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#list_environments.", - "file": "environments/list_environments.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_environments", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#list_environments", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" - }, - "method": { - "short_name": "ListEnvironments", - "full_name": "google.cloud.dialogflow.v2.Environments.ListEnvironments", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.v2.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Environments_GetEnvironment_sync", - "title": "Snippet for the get_environment call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#get_environment.", - "file": "environments/get_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_environment", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Environment", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" - }, - "method": { - "short_name": "GetEnvironment", - "full_name": "google.cloud.dialogflow.v2.Environments.GetEnvironment", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.v2.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Environments_CreateEnvironment_sync", - "title": "Snippet for the create_environment call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#create_environment.", - "file": "environments/create_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_environment", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#create_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Environment", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" - }, - "method": { - "short_name": "CreateEnvironment", - "full_name": "google.cloud.dialogflow.v2.Environments.CreateEnvironment", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.v2.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Environments_UpdateEnvironment_sync", - "title": "Snippet for the update_environment call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#update_environment.", - "file": "environments/update_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_environment", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#update_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Environment", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" - }, - "method": { - "short_name": "UpdateEnvironment", - "full_name": "google.cloud.dialogflow.v2.Environments.UpdateEnvironment", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.v2.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Environments_DeleteEnvironment_sync", - "title": "Snippet for the delete_environment call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#delete_environment.", - "file": "environments/delete_environment.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_environment", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#delete_environment", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" - }, - "method": { - "short_name": "DeleteEnvironment", - "full_name": "google.cloud.dialogflow.v2.Environments.DeleteEnvironment", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.v2.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync", - "title": "Snippet for the get_environment_history call in the Environments service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Environments::Client#get_environment_history.", - "file": "environments/get_environment_history.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_environment_history", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client#get_environment_history", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::EnvironmentHistory", - "client": { - "short_name": "Environments::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Environments::Client" - }, - "method": { - "short_name": "GetEnvironmentHistory", - "full_name": "google.cloud.dialogflow.v2.Environments.GetEnvironmentHistory", - "service": { - "short_name": "Environments", - "full_name": "google.cloud.dialogflow.v2.Environments" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_GeneratorEvaluations_CreateGeneratorEvaluation_sync", - "title": "Snippet for the create_generator_evaluation call in the GeneratorEvaluations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#create_generator_evaluation.", - "file": "generator_evaluations/create_generator_evaluation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_generator_evaluation", - "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#create_generator_evaluation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "GeneratorEvaluations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client" - }, - "method": { - "short_name": "CreateGeneratorEvaluation", - "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations.CreateGeneratorEvaluation", - "service": { - "short_name": "GeneratorEvaluations", - "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_GeneratorEvaluations_GetGeneratorEvaluation_sync", - "title": "Snippet for the get_generator_evaluation call in the GeneratorEvaluations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#get_generator_evaluation.", - "file": "generator_evaluations/get_generator_evaluation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_generator_evaluation", - "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#get_generator_evaluation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluation", - "client": { - "short_name": "GeneratorEvaluations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client" - }, - "method": { - "short_name": "GetGeneratorEvaluation", - "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations.GetGeneratorEvaluation", - "service": { - "short_name": "GeneratorEvaluations", - "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_GeneratorEvaluations_ListGeneratorEvaluations_sync", - "title": "Snippet for the list_generator_evaluations call in the GeneratorEvaluations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#list_generator_evaluations.", - "file": "generator_evaluations/list_generator_evaluations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_generator_evaluations", - "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#list_generator_evaluations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse", - "client": { - "short_name": "GeneratorEvaluations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client" - }, - "method": { - "short_name": "ListGeneratorEvaluations", - "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations.ListGeneratorEvaluations", - "service": { - "short_name": "GeneratorEvaluations", - "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_GeneratorEvaluations_DeleteGeneratorEvaluation_sync", - "title": "Snippet for the delete_generator_evaluation call in the GeneratorEvaluations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#delete_generator_evaluation.", - "file": "generator_evaluations/delete_generator_evaluation.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_generator_evaluation", - "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client#delete_generator_evaluation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "GeneratorEvaluations::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client" - }, - "method": { - "short_name": "DeleteGeneratorEvaluation", - "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations.DeleteGeneratorEvaluation", - "service": { - "short_name": "GeneratorEvaluations", - "full_name": "google.cloud.dialogflow.v2.GeneratorEvaluations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync", - "title": "Snippet for the list_knowledge_bases call in the KnowledgeBases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases.", - "file": "knowledge_bases/list_knowledge_bases.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_knowledge_bases", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse", - "client": { - "short_name": "KnowledgeBases::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" - }, - "method": { - "short_name": "ListKnowledgeBases", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.ListKnowledgeBases", - "service": { - "short_name": "KnowledgeBases", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync", - "title": "Snippet for the get_knowledge_base call in the KnowledgeBases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#get_knowledge_base.", - "file": "knowledge_bases/get_knowledge_base.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_knowledge_base", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#get_knowledge_base", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::KnowledgeBase", - "client": { - "short_name": "KnowledgeBases::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" - }, - "method": { - "short_name": "GetKnowledgeBase", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.GetKnowledgeBase", - "service": { - "short_name": "KnowledgeBases", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync", - "title": "Snippet for the create_knowledge_base call in the KnowledgeBases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#create_knowledge_base.", - "file": "knowledge_bases/create_knowledge_base.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_knowledge_base", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#create_knowledge_base", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::KnowledgeBase", - "client": { - "short_name": "KnowledgeBases::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" - }, - "method": { - "short_name": "CreateKnowledgeBase", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.CreateKnowledgeBase", - "service": { - "short_name": "KnowledgeBases", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync", - "title": "Snippet for the delete_knowledge_base call in the KnowledgeBases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#delete_knowledge_base.", - "file": "knowledge_bases/delete_knowledge_base.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_knowledge_base", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#delete_knowledge_base", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "KnowledgeBases::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" - }, - "method": { - "short_name": "DeleteKnowledgeBase", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.DeleteKnowledgeBase", - "service": { - "short_name": "KnowledgeBases", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync", - "title": "Snippet for the update_knowledge_base call in the KnowledgeBases service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#update_knowledge_base.", - "file": "knowledge_bases/update_knowledge_base.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_knowledge_base", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#update_knowledge_base", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::KnowledgeBase", - "client": { - "short_name": "KnowledgeBases::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client" - }, - "method": { - "short_name": "UpdateKnowledgeBase", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases.UpdateKnowledgeBase", - "service": { - "short_name": "KnowledgeBases", - "full_name": "google.cloud.dialogflow.v2.KnowledgeBases" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SipTrunks_CreateSipTrunk_sync", - "title": "Snippet for the create_sip_trunk call in the SipTrunks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#create_sip_trunk.", - "file": "sip_trunks/create_sip_trunk.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_sip_trunk", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#create_sip_trunk", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SipTrunk", - "client": { - "short_name": "SipTrunks::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" - }, - "method": { - "short_name": "CreateSipTrunk", - "full_name": "google.cloud.dialogflow.v2.SipTrunks.CreateSipTrunk", - "service": { - "short_name": "SipTrunks", - "full_name": "google.cloud.dialogflow.v2.SipTrunks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SipTrunks_DeleteSipTrunk_sync", - "title": "Snippet for the delete_sip_trunk call in the SipTrunks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#delete_sip_trunk.", - "file": "sip_trunks/delete_sip_trunk.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_sip_trunk", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#delete_sip_trunk", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SipTrunks::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" - }, - "method": { - "short_name": "DeleteSipTrunk", - "full_name": "google.cloud.dialogflow.v2.SipTrunks.DeleteSipTrunk", - "service": { - "short_name": "SipTrunks", - "full_name": "google.cloud.dialogflow.v2.SipTrunks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SipTrunks_ListSipTrunks_sync", - "title": "Snippet for the list_sip_trunks call in the SipTrunks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#list_sip_trunks.", - "file": "sip_trunks/list_sip_trunks.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sip_trunks", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#list_sip_trunks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse", - "client": { - "short_name": "SipTrunks::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" - }, - "method": { - "short_name": "ListSipTrunks", - "full_name": "google.cloud.dialogflow.v2.SipTrunks.ListSipTrunks", - "service": { - "short_name": "SipTrunks", - "full_name": "google.cloud.dialogflow.v2.SipTrunks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SipTrunks_GetSipTrunk_sync", - "title": "Snippet for the get_sip_trunk call in the SipTrunks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#get_sip_trunk.", - "file": "sip_trunks/get_sip_trunk.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_sip_trunk", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#get_sip_trunk", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SipTrunk", - "client": { - "short_name": "SipTrunks::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" - }, - "method": { - "short_name": "GetSipTrunk", - "full_name": "google.cloud.dialogflow.v2.SipTrunks.GetSipTrunk", - "service": { - "short_name": "SipTrunks", - "full_name": "google.cloud.dialogflow.v2.SipTrunks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_SipTrunks_UpdateSipTrunk_sync", - "title": "Snippet for the update_sip_trunk call in the SipTrunks service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::SipTrunks::Client#update_sip_trunk.", - "file": "sip_trunks/update_sip_trunk.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_sip_trunk", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client#update_sip_trunk", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::SipTrunk", - "client": { - "short_name": "SipTrunks::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::SipTrunks::Client" - }, - "method": { - "short_name": "UpdateSipTrunk", - "full_name": "google.cloud.dialogflow.v2.SipTrunks.UpdateSipTrunk", - "service": { - "short_name": "SipTrunks", - "full_name": "google.cloud.dialogflow.v2.SipTrunks" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Versions_ListVersions_sync", - "title": "Snippet for the list_versions call in the Versions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#list_versions.", - "file": "versions/list_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_versions", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#list_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::ListVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::ListVersionsResponse", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" - }, - "method": { - "short_name": "ListVersions", - "full_name": "google.cloud.dialogflow.v2.Versions.ListVersions", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.v2.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Versions_GetVersion_sync", - "title": "Snippet for the get_version call in the Versions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#get_version.", - "file": "versions/get_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_version", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#get_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::GetVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Version", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" - }, - "method": { - "short_name": "GetVersion", - "full_name": "google.cloud.dialogflow.v2.Versions.GetVersion", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.v2.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Versions_CreateVersion_sync", - "title": "Snippet for the create_version call in the Versions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#create_version.", - "file": "versions/create_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_version", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#create_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::CreateVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Version", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" - }, - "method": { - "short_name": "CreateVersion", - "full_name": "google.cloud.dialogflow.v2.Versions.CreateVersion", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.v2.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Versions_UpdateVersion_sync", - "title": "Snippet for the update_version call in the Versions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#update_version.", - "file": "versions/update_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_version", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#update_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::UpdateVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Dialogflow::V2::Version", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" - }, - "method": { - "short_name": "UpdateVersion", - "full_name": "google.cloud.dialogflow.v2.Versions.UpdateVersion", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.v2.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "dialogflow_v2_generated_Versions_DeleteVersion_sync", - "title": "Snippet for the delete_version call in the Versions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Dialogflow::V2::Versions::Client#delete_version.", - "file": "versions/delete_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_version", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client#delete_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Dialogflow::V2::DeleteVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Versions::Client", - "full_name": "::Google::Cloud::Dialogflow::V2::Versions::Client" - }, - "method": { - "short_name": "DeleteVersion", - "full_name": "google.cloud.dialogflow.v2.Versions.DeleteVersion", - "service": { - "short_name": "Versions", - "full_name": "google.cloud.dialogflow.v2.Versions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/create_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/create_tool.rb deleted file mode 100644 index 9c37709895de..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/create_tool.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 dialogflow_v2_generated_Tools_CreateTool_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_tool call in the Tools 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::Dialogflow::V2::Tools::Client#create_tool. -# -def create_tool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Tools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateToolRequest.new - - # Call the create_tool method. - result = client.create_tool request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. - p result -end -# [END dialogflow_v2_generated_Tools_CreateTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/delete_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/delete_tool.rb deleted file mode 100644 index 3d32f46f5a25..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/delete_tool.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 dialogflow_v2_generated_Tools_DeleteTool_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_tool call in the Tools 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::Dialogflow::V2::Tools::Client#delete_tool. -# -def delete_tool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Tools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteToolRequest.new - - # Call the delete_tool method. - result = client.delete_tool request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_Tools_DeleteTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/get_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/get_tool.rb deleted file mode 100644 index 890099d79715..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/get_tool.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 dialogflow_v2_generated_Tools_GetTool_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_tool call in the Tools 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::Dialogflow::V2::Tools::Client#get_tool. -# -def get_tool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Tools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetToolRequest.new - - # Call the get_tool method. - result = client.get_tool request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. - p result -end -# [END dialogflow_v2_generated_Tools_GetTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/list_tools.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/list_tools.rb deleted file mode 100644 index f0146a19c307..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/list_tools.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 dialogflow_v2_generated_Tools_ListTools_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_tools call in the Tools 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::Dialogflow::V2::Tools::Client#list_tools. -# -def list_tools - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Tools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListToolsRequest.new - - # Call the list_tools method. - result = client.list_tools 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::Dialogflow::V2::Tool. - p item - end -end -# [END dialogflow_v2_generated_Tools_ListTools_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/update_tool.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/update_tool.rb deleted file mode 100644 index d0de3f591e1e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/tools/update_tool.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 dialogflow_v2_generated_Tools_UpdateTool_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_tool call in the Tools 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::Dialogflow::V2::Tools::Client#update_tool. -# -def update_tool - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Tools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateToolRequest.new - - # Call the update_tool method. - result = client.update_tool request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Tool. - p result -end -# [END dialogflow_v2_generated_Tools_UpdateTool_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/create_version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/create_version.rb deleted file mode 100644 index 0f1816b5f8da..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/create_version.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 dialogflow_v2_generated_Versions_CreateVersion_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the create_version call in the Versions 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::Dialogflow::V2::Versions::Client#create_version. -# -def create_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::CreateVersionRequest.new - - # Call the create_version method. - result = client.create_version request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Version. - p result -end -# [END dialogflow_v2_generated_Versions_CreateVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb deleted file mode 100644 index dd6b98be1c70..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/delete_version.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 dialogflow_v2_generated_Versions_DeleteVersion_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the delete_version call in the Versions 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::Dialogflow::V2::Versions::Client#delete_version. -# -def delete_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new - - # Call the delete_version method. - result = client.delete_version request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END dialogflow_v2_generated_Versions_DeleteVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/get_version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/get_version.rb deleted file mode 100644 index ab37f93925db..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/get_version.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 dialogflow_v2_generated_Versions_GetVersion_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the get_version call in the Versions 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::Dialogflow::V2::Versions::Client#get_version. -# -def get_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::GetVersionRequest.new - - # Call the get_version method. - result = client.get_version request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Version. - p result -end -# [END dialogflow_v2_generated_Versions_GetVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb deleted file mode 100644 index a7976a2a05e4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/list_versions.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 dialogflow_v2_generated_Versions_ListVersions_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the list_versions call in the Versions 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::Dialogflow::V2::Versions::Client#list_versions. -# -def list_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::ListVersionsRequest.new - - # Call the list_versions method. - result = client.list_versions 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::Dialogflow::V2::Version. - p item - end -end -# [END dialogflow_v2_generated_Versions_ListVersions_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/update_version.rb b/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/update_version.rb deleted file mode 100644 index ec630cbf260d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/snippets/versions/update_version.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 dialogflow_v2_generated_Versions_UpdateVersion_sync] -require "google/cloud/dialogflow/v2" - -## -# Snippet for the update_version call in the Versions 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::Dialogflow::V2::Versions::Client#update_version. -# -def update_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Dialogflow::V2::Versions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new - - # Call the update_version method. - result = client.update_version request - - # The returned object is of type Google::Cloud::Dialogflow::V2::Version. - p result -end -# [END dialogflow_v2_generated_Versions_UpdateVersion_sync] diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_operations_test.rb deleted file mode 100644 index 1c34bdaceec5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_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/dialogflow/v2/agent_pb" -require "google/cloud/dialogflow/v2/agent_services_pb" -require "google/cloud/dialogflow/v2/agents" - -class ::Google::Cloud::Dialogflow::V2::Agents::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 - c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Agents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb deleted file mode 100644 index b193742e1549..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_paths_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/agents" - -class ::Google::Cloud::Dialogflow::V2::Agents::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_agent_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0" - assert_equal "projects/value0/agent", path - - path = client.agent_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/agent", 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::Dialogflow::V2::Agents::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_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::Dialogflow::V2::Agents::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-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb deleted file mode 100644 index bf58bab734bb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_rest_test.rb +++ /dev/null @@ -1,592 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/agent_pb" -require "google/cloud/dialogflow/v2/agents/rest" - - -class ::Google::Cloud::Dialogflow::V2::Agents::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_agent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Agent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - get_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_get_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_agent({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_agent parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_agent ::Google::Cloud::Dialogflow::V2::GetAgentRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_agent({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_agent(::Google::Cloud::Dialogflow::V2::GetAgentRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_agent_client_stub.call_count - end - end - end - - def test_set_agent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Agent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - agent = {} - update_mask = {} - - set_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_set_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.set_agent({ agent: agent, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.set_agent agent: agent, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.set_agent ::Google::Cloud::Dialogflow::V2::SetAgentRequest.new(agent: agent, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.set_agent({ agent: agent, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.set_agent(::Google::Cloud::Dialogflow::V2::SetAgentRequest.new(agent: agent, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_agent_client_stub.call_count - end - end - end - - def test_delete_agent - # 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. - parent = "hello world" - - delete_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_delete_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_agent({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_agent parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_agent ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_agent({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_agent(::Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_agent_client_stub.call_count - end - end - end - - def test_search_agents - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse.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" - - search_agents_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_search_agents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_agents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.search_agents({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.search_agents parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.search_agents ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest.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 - c.search_agents({ 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 - c.search_agents(::Google::Cloud::Dialogflow::V2::SearchAgentsRequest.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, search_agents_client_stub.call_count - end - end - end - - def test_train_agent - # 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" - - train_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_train_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, train_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.train_agent({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.train_agent parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.train_agent ::Google::Cloud::Dialogflow::V2::TrainAgentRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.train_agent({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.train_agent(::Google::Cloud::Dialogflow::V2::TrainAgentRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, train_agent_client_stub.call_count - end - end - end - - def test_export_agent - # 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" - agent_uri = "hello world" - - export_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_export_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.export_agent({ parent: parent, agent_uri: agent_uri }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.export_agent parent: parent, agent_uri: agent_uri do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.export_agent ::Google::Cloud::Dialogflow::V2::ExportAgentRequest.new(parent: parent, agent_uri: agent_uri) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.export_agent({ parent: parent, agent_uri: agent_uri }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.export_agent(::Google::Cloud::Dialogflow::V2::ExportAgentRequest.new(parent: parent, agent_uri: agent_uri), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_agent_client_stub.call_count - end - end - end - - def test_import_agent - # 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" - agent_uri = "hello world" - - import_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_import_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.import_agent({ parent: parent, agent_uri: agent_uri }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.import_agent parent: parent, agent_uri: agent_uri do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.import_agent ::Google::Cloud::Dialogflow::V2::ImportAgentRequest.new(parent: parent, agent_uri: agent_uri) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.import_agent({ parent: parent, agent_uri: agent_uri }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.import_agent(::Google::Cloud::Dialogflow::V2::ImportAgentRequest.new(parent: parent, agent_uri: agent_uri), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_agent_client_stub.call_count - end - end - end - - def test_restore_agent - # 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" - agent_uri = "hello world" - - restore_agent_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_restore_agent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, restore_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.restore_agent({ parent: parent, agent_uri: agent_uri }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.restore_agent parent: parent, agent_uri: agent_uri do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.restore_agent ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new(parent: parent, agent_uri: agent_uri) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.restore_agent({ parent: parent, agent_uri: agent_uri }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.restore_agent(::Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new(parent: parent, agent_uri: agent_uri), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, restore_agent_client_stub.call_count - end - end - end - - def test_get_validation_result - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ValidationResult.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - language_code = "hello world" - - get_validation_result_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::Dialogflow::V2::Agents::Rest::ServiceStub.stub :transcode_get_validation_result_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_validation_result_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_validation_result({ parent: parent, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_validation_result parent: parent, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_validation_result ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new(parent: parent, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_validation_result({ parent: parent, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_validation_result(::Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new(parent: parent, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_validation_result_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::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb deleted file mode 100644 index 7e9217d8375f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/agents_test.rb +++ /dev/null @@ -1,681 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/agent_pb" -require "google/cloud/dialogflow/v2/agents" - -class ::Google::Cloud::Dialogflow::V2::Agents::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_agent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Agent.new - grpc_operation = GRPC::ActiveCall::Operation.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" - - get_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetAgentRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_agent({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_agent parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_agent ::Google::Cloud::Dialogflow::V2::GetAgentRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_agent({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_agent(::Google::Cloud::Dialogflow::V2::GetAgentRequest.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, get_agent_client_stub.call_rpc_count - end - end - - def test_set_agent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Agent.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - agent = {} - update_mask = {} - - set_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::SetAgentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Agent), request["agent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.set_agent({ agent: agent, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.set_agent agent: agent, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.set_agent ::Google::Cloud::Dialogflow::V2::SetAgentRequest.new(agent: agent, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.set_agent({ agent: agent, 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 - c.set_agent(::Google::Cloud::Dialogflow::V2::SetAgentRequest.new(agent: agent, 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, set_agent_client_stub.call_rpc_count - end - end - - def test_delete_agent - # 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. - parent = "hello world" - - delete_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_agent({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_agent parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_agent ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_agent({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_agent(::Google::Cloud::Dialogflow::V2::DeleteAgentRequest.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, delete_agent_client_stub.call_rpc_count - end - end - - def test_search_agents - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - - search_agents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_agents, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, 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, search_agents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.search_agents({ 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 - c.search_agents 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 - c.search_agents ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest.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 - c.search_agents({ 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 - c.search_agents(::Google::Cloud::Dialogflow::V2::SearchAgentsRequest.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, search_agents_client_stub.call_rpc_count - end - end - - def test_train_agent - # 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" - - train_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :train_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::TrainAgentRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, train_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.train_agent({ 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 - c.train_agent 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 - c.train_agent ::Google::Cloud::Dialogflow::V2::TrainAgentRequest.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 - c.train_agent({ 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 - c.train_agent(::Google::Cloud::Dialogflow::V2::TrainAgentRequest.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, train_agent_client_stub.call_rpc_count - end - end - - def test_export_agent - # 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" - agent_uri = "hello world" - - export_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ExportAgentRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["agent_uri"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.export_agent({ parent: parent, agent_uri: agent_uri }) 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 - c.export_agent parent: parent, agent_uri: agent_uri 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 - c.export_agent ::Google::Cloud::Dialogflow::V2::ExportAgentRequest.new(parent: parent, agent_uri: agent_uri) 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 - c.export_agent({ parent: parent, agent_uri: agent_uri }, 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 - c.export_agent(::Google::Cloud::Dialogflow::V2::ExportAgentRequest.new(parent: parent, agent_uri: agent_uri), 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, export_agent_client_stub.call_rpc_count - end - end - - def test_import_agent - # 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" - agent_uri = "hello world" - - import_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ImportAgentRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["agent_uri"] - assert_equal :agent_uri, request.agent - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.import_agent({ parent: parent, agent_uri: agent_uri }) 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 - c.import_agent parent: parent, agent_uri: agent_uri 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 - c.import_agent ::Google::Cloud::Dialogflow::V2::ImportAgentRequest.new(parent: parent, agent_uri: agent_uri) 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 - c.import_agent({ parent: parent, agent_uri: agent_uri }, 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 - c.import_agent(::Google::Cloud::Dialogflow::V2::ImportAgentRequest.new(parent: parent, agent_uri: agent_uri), 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_agent_client_stub.call_rpc_count - end - end - - def test_restore_agent - # 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" - agent_uri = "hello world" - - restore_agent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :restore_agent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["agent_uri"] - assert_equal :agent_uri, request.agent - refute_nil options - end - - Gapic::ServiceStub.stub :new, restore_agent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.restore_agent({ parent: parent, agent_uri: agent_uri }) 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 - c.restore_agent parent: parent, agent_uri: agent_uri 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 - c.restore_agent ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new(parent: parent, agent_uri: agent_uri) 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 - c.restore_agent({ parent: parent, agent_uri: agent_uri }, 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 - c.restore_agent(::Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new(parent: parent, agent_uri: agent_uri), 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, restore_agent_client_stub.call_rpc_count - end - end - - def test_get_validation_result - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ValidationResult.new - grpc_operation = GRPC::ActiveCall::Operation.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" - language_code = "hello world" - - get_validation_result_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_validation_result, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_validation_result_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_validation_result({ parent: parent, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_validation_result parent: parent, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_validation_result ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new(parent: parent, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_validation_result({ parent: parent, language_code: language_code }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_validation_result(::Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new(parent: parent, language_code: language_code), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_validation_result_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::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Agents::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::Dialogflow::V2::Agents::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::V2::Agents::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb deleted file mode 100644 index 1b571bda6bd3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_paths_test.rb +++ /dev/null @@ -1,157 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/answer_records" - -class ::Google::Cloud::Dialogflow::V2::AnswerRecords::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_record_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.answer_record_path project: "value0", answer_record: "value1" - assert_equal "projects/value0/answerRecords/value1", path - - path = client.answer_record_path project: "value0", location: "value1", answer_record: "value2" - assert_equal "projects/value0/locations/value1/answerRecords/value2", path - end - end - - def test_app_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.app_path project: "value0", location: "value1", app: "value2" - assert_equal "projects/value0/locations/value1/apps/value2", path - end - end - - def test_context_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.context_path project: "value0", session: "value1", context: "value2" - assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path - - path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path - - path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" - assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path - - path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/value5", path - end - end - - def test_intent_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intent_path project: "value0", intent: "value1" - assert_equal "projects/value0/agent/intents/value1", path - - path = client.intent_path project: "value0", location: "value1", intent: "value2" - assert_equal "projects/value0/locations/value1/agent/intents/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::Dialogflow::V2::AnswerRecords::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_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::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tool_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", tool: "value2" - assert_equal "projects/value0/locations/value1/tools/value2", path - - path = client.tool_path project: "value0", location: "value1", app: "value2", tool: "value3" - assert_equal "projects/value0/locations/value1/apps/value2/tools/value3", path - end - end - - def test_toolset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.toolset_path project: "value0", location: "value1", app: "value2", toolset: "value3" - assert_equal "projects/value0/locations/value1/apps/value2/toolsets/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_rest_test.rb deleted file mode 100644 index 00bc34fcbeb0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_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/dialogflow/v2/answer_record_pb" -require "google/cloud/dialogflow/v2/answer_records/rest" - - -class ::Google::Cloud::Dialogflow::V2::AnswerRecords::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_answer_records - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse.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" - page_size = 42 - page_token = "hello world" - - list_answer_records_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::Dialogflow::V2::AnswerRecords::Rest::ServiceStub.stub :transcode_list_answer_records_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_answer_records_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_answer_records({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_answer_records parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_answer_records ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.list_answer_records({ parent: parent, filter: filter, 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 - c.list_answer_records(::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new(parent: parent, filter: filter, 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_answer_records_client_stub.call_count - end - end - end - - def test_update_answer_record - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::AnswerRecord.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - answer_record = {} - update_mask = {} - - update_answer_record_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::Dialogflow::V2::AnswerRecords::Rest::ServiceStub.stub :transcode_update_answer_record_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_answer_record_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_answer_record({ answer_record: answer_record, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_answer_record answer_record: answer_record, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_answer_record ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new(answer_record: answer_record, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_answer_record({ answer_record: answer_record, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_answer_record(::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new(answer_record: answer_record, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_answer_record_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::Dialogflow::V2::AnswerRecords::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::Dialogflow::V2::AnswerRecords::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb deleted file mode 100644 index 28acedb01580..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/answer_records_test.rb +++ /dev/null @@ -1,233 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/answer_record_pb" -require "google/cloud/dialogflow/v2/answer_records" - -class ::Google::Cloud::Dialogflow::V2::AnswerRecords::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_answer_records - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - page_size = 42 - page_token = "hello world" - - list_answer_records_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_answer_records, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_answer_records_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_answer_records({ parent: parent, filter: filter, 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 - c.list_answer_records parent: parent, filter: filter, 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 - c.list_answer_records ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new(parent: parent, filter: filter, 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 - c.list_answer_records({ parent: parent, filter: filter, 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 - c.list_answer_records(::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new(parent: parent, filter: filter, 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_answer_records_client_stub.call_rpc_count - end - end - - def test_update_answer_record - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::AnswerRecord.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - answer_record = {} - update_mask = {} - - update_answer_record_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_answer_record, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AnswerRecord), request["answer_record"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_answer_record_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_answer_record({ answer_record: answer_record, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_answer_record answer_record: answer_record, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_answer_record ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new(answer_record: answer_record, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_answer_record({ answer_record: answer_record, 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 - c.update_answer_record(::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new(answer_record: answer_record, 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_answer_record_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::Dialogflow::V2::AnswerRecords::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::Dialogflow::V2::AnswerRecords::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::Dialogflow::V2::AnswerRecords::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::AnswerRecords::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_paths_test.rb deleted file mode 100644 index 238a7b3db9cb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_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/dialogflow/v2/contexts" - -class ::Google::Cloud::Dialogflow::V2::Contexts::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_context_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.context_path project: "value0", session: "value1", context: "value2" - assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path - - path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path - - path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" - assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path - - path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/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::Dialogflow::V2::Contexts::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", session: "value1" - assert_equal "projects/value0/agent/sessions/value1", path - - path = client.session_path project: "value0", environment: "value1", user: "value2", session: "value3" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3", path - - path = client.session_path project: "value0", location: "value1", session: "value2" - assert_equal "projects/value0/locations/value1/agent/sessions/value2", path - - path = client.session_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb deleted file mode 100644 index fb1751003f6e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_rest_test.rb +++ /dev/null @@ -1,427 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/context_pb" -require "google/cloud/dialogflow/v2/contexts/rest" - - -class ::Google::Cloud::Dialogflow::V2::Contexts::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_contexts - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListContextsResponse.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_contexts_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_list_contexts_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_contexts_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_contexts({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_contexts parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_contexts ::Google::Cloud::Dialogflow::V2::ListContextsRequest.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 - c.list_contexts({ 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 - c.list_contexts(::Google::Cloud::Dialogflow::V2::ListContextsRequest.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_contexts_client_stub.call_count - end - end - end - - def test_get_context - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Context.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_context_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_get_context_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_context_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_context({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_context name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_context ::Google::Cloud::Dialogflow::V2::GetContextRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_context({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_context(::Google::Cloud::Dialogflow::V2::GetContextRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_context_client_stub.call_count - end - end - end - - def test_create_context - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Context.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - context = {} - - create_context_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_create_context_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_context_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_context({ parent: parent, context: context }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_context parent: parent, context: context do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_context ::Google::Cloud::Dialogflow::V2::CreateContextRequest.new(parent: parent, context: context) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_context({ parent: parent, context: context }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_context(::Google::Cloud::Dialogflow::V2::CreateContextRequest.new(parent: parent, context: context), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_context_client_stub.call_count - end - end - end - - def test_update_context - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Context.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - context = {} - update_mask = {} - - update_context_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_update_context_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_context_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_context({ context: context, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_context context: context, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_context ::Google::Cloud::Dialogflow::V2::UpdateContextRequest.new(context: context, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_context({ context: context, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_context(::Google::Cloud::Dialogflow::V2::UpdateContextRequest.new(context: context, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_context_client_stub.call_count - end - end - end - - def test_delete_context - # 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_context_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_delete_context_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_context_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_context({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_context name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_context ::Google::Cloud::Dialogflow::V2::DeleteContextRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_context({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_context(::Google::Cloud::Dialogflow::V2::DeleteContextRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_context_client_stub.call_count - end - end - end - - def test_delete_all_contexts - # 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. - parent = "hello world" - - delete_all_contexts_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::Dialogflow::V2::Contexts::Rest::ServiceStub.stub :transcode_delete_all_contexts_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_all_contexts_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_all_contexts({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_all_contexts parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_all_contexts ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_all_contexts({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_all_contexts(::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_all_contexts_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::Dialogflow::V2::Contexts::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::Dialogflow::V2::Contexts::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb deleted file mode 100644 index 62b95cdcb9ee..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/contexts_test.rb +++ /dev/null @@ -1,465 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/context_pb" -require "google/cloud/dialogflow/v2/contexts" - -class ::Google::Cloud::Dialogflow::V2::Contexts::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_contexts - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListContextsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_contexts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_contexts, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListContextsRequest, 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_contexts_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_contexts({ 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 - c.list_contexts 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 - c.list_contexts ::Google::Cloud::Dialogflow::V2::ListContextsRequest.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 - c.list_contexts({ 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 - c.list_contexts(::Google::Cloud::Dialogflow::V2::ListContextsRequest.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_contexts_client_stub.call_rpc_count - end - end - - def test_get_context - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Context.new - grpc_operation = GRPC::ActiveCall::Operation.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_context_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_context, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetContextRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_context_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_context({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_context name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_context ::Google::Cloud::Dialogflow::V2::GetContextRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_context({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_context(::Google::Cloud::Dialogflow::V2::GetContextRequest.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_context_client_stub.call_rpc_count - end - end - - def test_create_context - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Context.new - grpc_operation = GRPC::ActiveCall::Operation.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" - context = {} - - create_context_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_context, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateContextRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Context), request["context"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_context_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_context({ parent: parent, context: context }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_context parent: parent, context: context do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_context ::Google::Cloud::Dialogflow::V2::CreateContextRequest.new(parent: parent, context: context) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_context({ parent: parent, context: context }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_context(::Google::Cloud::Dialogflow::V2::CreateContextRequest.new(parent: parent, context: context), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_context_client_stub.call_rpc_count - end - end - - def test_update_context - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Context.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - context = {} - update_mask = {} - - update_context_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_context, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateContextRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Context), request["context"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_context_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_context({ context: context, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_context context: context, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_context ::Google::Cloud::Dialogflow::V2::UpdateContextRequest.new(context: context, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_context({ context: context, 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 - c.update_context(::Google::Cloud::Dialogflow::V2::UpdateContextRequest.new(context: context, 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_context_client_stub.call_rpc_count - end - end - - def test_delete_context - # 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_context_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_context, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteContextRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_context_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_context({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_context name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_context ::Google::Cloud::Dialogflow::V2::DeleteContextRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_context({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_context(::Google::Cloud::Dialogflow::V2::DeleteContextRequest.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_context_client_stub.call_rpc_count - end - end - - def test_delete_all_contexts - # 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. - parent = "hello world" - - delete_all_contexts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_all_contexts, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_all_contexts_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Contexts::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_all_contexts({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_all_contexts parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_all_contexts ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_all_contexts({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_all_contexts(::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.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, delete_all_contexts_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::Dialogflow::V2::Contexts::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::Dialogflow::V2::Contexts::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::Dialogflow::V2::Contexts::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Contexts::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_operations_test.rb deleted file mode 100644 index 6e77e97f16f2..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_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/dialogflow/v2/conversation_dataset_pb" -require "google/cloud/dialogflow/v2/conversation_dataset_services_pb" -require "google/cloud/dialogflow/v2/conversation_datasets" - -class ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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 - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_paths_test.rb deleted file mode 100644 index 548adf925bdb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_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/dialogflow/v2/conversation_datasets" - -class ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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_conversation_dataset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_dataset_path project: "value0", location: "value1", conversation_dataset: "value2" - assert_equal "projects/value0/locations/value1/conversationDatasets/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::Dialogflow::V2::ConversationDatasets::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-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb deleted file mode 100644 index 16b7c2072cd3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_rest_test.rb +++ /dev/null @@ -1,373 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_dataset_pb" -require "google/cloud/dialogflow/v2/conversation_datasets/rest" - - -class ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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_conversation_dataset - # 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" - conversation_dataset = {} - - create_conversation_dataset_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_create_conversation_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_conversation_dataset_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_conversation_dataset({ parent: parent, conversation_dataset: conversation_dataset }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_conversation_dataset parent: parent, conversation_dataset: conversation_dataset do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_conversation_dataset ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new(parent: parent, conversation_dataset: conversation_dataset) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_conversation_dataset({ parent: parent, conversation_dataset: conversation_dataset }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_conversation_dataset(::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new(parent: parent, conversation_dataset: conversation_dataset), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_conversation_dataset_client_stub.call_count - end - end - end - - def test_get_conversation_dataset - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ConversationDataset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_conversation_dataset_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_get_conversation_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_conversation_dataset_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_conversation_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_conversation_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_conversation_dataset ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_conversation_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_conversation_dataset(::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_conversation_dataset_client_stub.call_count - end - end - end - - def test_list_conversation_datasets - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse.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_conversation_datasets_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_list_conversation_datasets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_conversation_datasets_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_conversation_datasets({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_conversation_datasets parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_conversation_datasets ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.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 - c.list_conversation_datasets({ 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 - c.list_conversation_datasets(::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.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_conversation_datasets_client_stub.call_count - end - end - end - - def test_delete_conversation_dataset - # 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_conversation_dataset_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_delete_conversation_dataset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_conversation_dataset_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_conversation_dataset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_conversation_dataset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_conversation_dataset ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_conversation_dataset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_conversation_dataset(::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_conversation_dataset_client_stub.call_count - end - end - end - - def test_import_conversation_data - # 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" - input_config = {} - - import_conversation_data_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::Dialogflow::V2::ConversationDatasets::Rest::ServiceStub.stub :transcode_import_conversation_data_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_conversation_data_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.import_conversation_data({ name: name, input_config: input_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.import_conversation_data name: name, input_config: input_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.import_conversation_data ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new(name: name, input_config: input_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.import_conversation_data({ name: name, input_config: input_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.import_conversation_data(::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new(name: name, input_config: input_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_conversation_data_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::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb deleted file mode 100644 index 28dc7773b094..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_datasets_test.rb +++ /dev/null @@ -1,436 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_dataset_pb" -require "google/cloud/dialogflow/v2/conversation_datasets" - -class ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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_conversation_dataset - # 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" - conversation_dataset = {} - - create_conversation_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_conversation_dataset, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationDataset), request["conversation_dataset"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_conversation_dataset_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_conversation_dataset({ parent: parent, conversation_dataset: conversation_dataset }) 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 - c.create_conversation_dataset parent: parent, conversation_dataset: conversation_dataset 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 - c.create_conversation_dataset ::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new(parent: parent, conversation_dataset: conversation_dataset) 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 - c.create_conversation_dataset({ parent: parent, conversation_dataset: conversation_dataset }, 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 - c.create_conversation_dataset(::Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new(parent: parent, conversation_dataset: conversation_dataset), 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_conversation_dataset_client_stub.call_rpc_count - end - end - - def test_get_conversation_dataset - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationDataset.new - grpc_operation = GRPC::ActiveCall::Operation.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_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_conversation_dataset, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_conversation_dataset_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_conversation_dataset({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_conversation_dataset name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_conversation_dataset ::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_conversation_dataset({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_conversation_dataset(::Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.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_dataset_client_stub.call_rpc_count - end - end - - def test_list_conversation_datasets - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_conversation_datasets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_conversation_datasets, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest, 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_conversation_datasets_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_conversation_datasets({ 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 - c.list_conversation_datasets 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 - c.list_conversation_datasets ::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.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 - c.list_conversation_datasets({ 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 - c.list_conversation_datasets(::Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.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_conversation_datasets_client_stub.call_rpc_count - end - end - - def test_delete_conversation_dataset - # 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_conversation_dataset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_conversation_dataset, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_conversation_dataset_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_conversation_dataset({ 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 - c.delete_conversation_dataset 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 - c.delete_conversation_dataset ::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.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 - c.delete_conversation_dataset({ 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 - c.delete_conversation_dataset(::Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.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_conversation_dataset_client_stub.call_rpc_count - end - end - - def test_import_conversation_data - # 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" - input_config = {} - - import_conversation_data_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_conversation_data, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::InputConfig), request["input_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_conversation_data_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.import_conversation_data({ name: name, input_config: input_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 - c.import_conversation_data name: name, input_config: input_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 - c.import_conversation_data ::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new(name: name, input_config: input_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 - c.import_conversation_data({ name: name, input_config: input_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 - c.import_conversation_data(::Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new(name: name, input_config: input_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_conversation_data_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::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationDatasets::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::Dialogflow::V2::ConversationDatasets::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationDatasets::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_operations_test.rb deleted file mode 100644 index 0d5bb6d559b3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_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/dialogflow/v2/conversation_model_pb" -require "google/cloud/dialogflow/v2/conversation_model_services_pb" -require "google/cloud/dialogflow/v2/conversation_models" - -class ::Google::Cloud::Dialogflow::V2::ConversationModels::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 - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb deleted file mode 100644 index 37cd99f74d32..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_paths_test.rb +++ /dev/null @@ -1,100 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_models" - -class ::Google::Cloud::Dialogflow::V2::ConversationModels::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_conversation_dataset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_dataset_path project: "value0", location: "value1", conversation_dataset: "value2" - assert_equal "projects/value0/locations/value1/conversationDatasets/value2", path - end - end - - def test_conversation_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_model_path project: "value0", location: "value1", conversation_model: "value2" - assert_equal "projects/value0/locations/value1/conversationModels/value2", path - - path = client.conversation_model_path project: "value0", conversation_model: "value1" - assert_equal "projects/value0/conversationModels/value1", path - end - end - - def test_conversation_model_evaluation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_model_evaluation_path project: "value0", conversation_model: "value1", evaluation: "value2" - assert_equal "projects/value0/conversationModels/value1/evaluations/value2", path - - path = client.conversation_model_evaluation_path project: "value0", location: "value1", conversation_model: "value2", evaluation: "value3" - assert_equal "projects/value0/locations/value1/conversationModels/value2/evaluations/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::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", knowledge_base: "value1", document: "value2" - assert_equal "projects/value0/knowledgeBases/value1/documents/value2", path - - path = client.document_path project: "value0", location: "value1", knowledge_base: "value2", document: "value3" - assert_equal "projects/value0/locations/value1/knowledgeBases/value2/documents/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.rb deleted file mode 100644 index 58498f82b936..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_rest_test.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 "helper" -require "gapic/rest" -require "google/cloud/dialogflow/v2/conversation_model_pb" -require "google/cloud/dialogflow/v2/conversation_models/rest" - - -class ::Google::Cloud::Dialogflow::V2::ConversationModels::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_conversation_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. - parent = "hello world" - conversation_model = {} - - create_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_create_conversation_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_conversation_model({ parent: parent, conversation_model: conversation_model }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_conversation_model parent: parent, conversation_model: conversation_model do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_conversation_model ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new(parent: parent, conversation_model: conversation_model) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_conversation_model({ parent: parent, conversation_model: conversation_model }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_conversation_model(::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new(parent: parent, conversation_model: conversation_model), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_conversation_model_client_stub.call_count - end - end - end - - def test_get_conversation_model - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ConversationModel.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_get_conversation_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_conversation_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_conversation_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_conversation_model ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_conversation_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_conversation_model(::Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_conversation_model_client_stub.call_count - end - end - end - - def test_list_conversation_models - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse.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_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_list_conversation_models_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_conversation_models_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_conversation_models({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_conversation_models parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_conversation_models ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.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 - c.list_conversation_models({ 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 - c.list_conversation_models(::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.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_conversation_models_client_stub.call_count - end - end - end - - def test_delete_conversation_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. - name = "hello world" - - delete_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_delete_conversation_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_conversation_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_conversation_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_conversation_model ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_conversation_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_conversation_model(::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_conversation_model_client_stub.call_count - end - end - end - - def test_deploy_conversation_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. - name = "hello world" - - deploy_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_deploy_conversation_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, deploy_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.deploy_conversation_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.deploy_conversation_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.deploy_conversation_model ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.deploy_conversation_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.deploy_conversation_model(::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, deploy_conversation_model_client_stub.call_count - end - end - end - - def test_undeploy_conversation_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. - name = "hello world" - - undeploy_conversation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_undeploy_conversation_model_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undeploy_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.undeploy_conversation_model({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.undeploy_conversation_model name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.undeploy_conversation_model ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.undeploy_conversation_model({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.undeploy_conversation_model(::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undeploy_conversation_model_client_stub.call_count - end - end - end - - def test_get_conversation_model_evaluation - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_conversation_model_evaluation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_get_conversation_model_evaluation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_conversation_model_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_conversation_model_evaluation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_conversation_model_evaluation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_conversation_model_evaluation ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_conversation_model_evaluation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_conversation_model_evaluation(::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_conversation_model_evaluation_client_stub.call_count - end - end - end - - def test_list_conversation_model_evaluations - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse.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_conversation_model_evaluations_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_list_conversation_model_evaluations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_conversation_model_evaluations_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_conversation_model_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_conversation_model_evaluations parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_conversation_model_evaluations ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.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 - c.list_conversation_model_evaluations({ 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 - c.list_conversation_model_evaluations(::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.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_conversation_model_evaluations_client_stub.call_count - end - end - end - - def test_create_conversation_model_evaluation - # 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" - conversation_model_evaluation = {} - - create_conversation_model_evaluation_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::Dialogflow::V2::ConversationModels::Rest::ServiceStub.stub :transcode_create_conversation_model_evaluation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_conversation_model_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_conversation_model_evaluation({ parent: parent, conversation_model_evaluation: conversation_model_evaluation }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_conversation_model_evaluation parent: parent, conversation_model_evaluation: conversation_model_evaluation do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_conversation_model_evaluation ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new(parent: parent, conversation_model_evaluation: conversation_model_evaluation) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_conversation_model_evaluation({ parent: parent, conversation_model_evaluation: conversation_model_evaluation }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_conversation_model_evaluation(::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new(parent: parent, conversation_model_evaluation: conversation_model_evaluation), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_conversation_model_evaluation_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::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb deleted file mode 100644 index 5ad5b77dc1b1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_models_test.rb +++ /dev/null @@ -1,687 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_model_pb" -require "google/cloud/dialogflow/v2/conversation_models" - -class ::Google::Cloud::Dialogflow::V2::ConversationModels::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_conversation_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. - parent = "hello world" - conversation_model = {} - - create_conversation_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_conversation_model, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationModel), request["conversation_model"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_conversation_model({ parent: parent, conversation_model: conversation_model }) 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 - c.create_conversation_model parent: parent, conversation_model: conversation_model 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 - c.create_conversation_model ::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new(parent: parent, conversation_model: conversation_model) 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 - c.create_conversation_model({ parent: parent, conversation_model: conversation_model }, 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 - c.create_conversation_model(::Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new(parent: parent, conversation_model: conversation_model), 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_conversation_model_client_stub.call_rpc_count - end - end - - def test_get_conversation_model - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationModel.new - grpc_operation = GRPC::ActiveCall::Operation.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_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_conversation_model, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_conversation_model({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_conversation_model name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_conversation_model ::Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_conversation_model({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_conversation_model(::Google::Cloud::Dialogflow::V2::GetConversationModelRequest.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_model_client_stub.call_rpc_count - end - end - - def test_list_conversation_models - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListConversationModelsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_conversation_models_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_conversation_models, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest, 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_conversation_models_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_conversation_models({ 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 - c.list_conversation_models 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 - c.list_conversation_models ::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.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 - c.list_conversation_models({ 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 - c.list_conversation_models(::Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.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_conversation_models_client_stub.call_rpc_count - end - end - - def test_delete_conversation_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. - name = "hello world" - - delete_conversation_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_conversation_model, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_conversation_model({ 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 - c.delete_conversation_model 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 - c.delete_conversation_model ::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.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 - c.delete_conversation_model({ 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 - c.delete_conversation_model(::Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.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_conversation_model_client_stub.call_rpc_count - end - end - - def test_deploy_conversation_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. - name = "hello world" - - deploy_conversation_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :deploy_conversation_model, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, deploy_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.deploy_conversation_model({ 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 - c.deploy_conversation_model 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 - c.deploy_conversation_model ::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.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 - c.deploy_conversation_model({ 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 - c.deploy_conversation_model(::Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.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, deploy_conversation_model_client_stub.call_rpc_count - end - end - - def test_undeploy_conversation_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. - name = "hello world" - - undeploy_conversation_model_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undeploy_conversation_model, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undeploy_conversation_model_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.undeploy_conversation_model({ 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 - c.undeploy_conversation_model 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 - c.undeploy_conversation_model ::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.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 - c.undeploy_conversation_model({ 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 - c.undeploy_conversation_model(::Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.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, undeploy_conversation_model_client_stub.call_rpc_count - end - end - - def test_get_conversation_model_evaluation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation.new - grpc_operation = GRPC::ActiveCall::Operation.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_model_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_conversation_model_evaluation, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_conversation_model_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_conversation_model_evaluation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_conversation_model_evaluation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_conversation_model_evaluation ::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_conversation_model_evaluation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_conversation_model_evaluation(::Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.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_model_evaluation_client_stub.call_rpc_count - end - end - - def test_list_conversation_model_evaluations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_conversation_model_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_conversation_model_evaluations, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest, 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_conversation_model_evaluations_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_conversation_model_evaluations({ 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 - c.list_conversation_model_evaluations 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 - c.list_conversation_model_evaluations ::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.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 - c.list_conversation_model_evaluations({ 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 - c.list_conversation_model_evaluations(::Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.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_conversation_model_evaluations_client_stub.call_rpc_count - end - end - - def test_create_conversation_model_evaluation - # 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" - conversation_model_evaluation = {} - - create_conversation_model_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_conversation_model_evaluation, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation), request["conversation_model_evaluation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_conversation_model_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_conversation_model_evaluation({ parent: parent, conversation_model_evaluation: conversation_model_evaluation }) 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 - c.create_conversation_model_evaluation parent: parent, conversation_model_evaluation: conversation_model_evaluation 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 - c.create_conversation_model_evaluation ::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new(parent: parent, conversation_model_evaluation: conversation_model_evaluation) 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 - c.create_conversation_model_evaluation({ parent: parent, conversation_model_evaluation: conversation_model_evaluation }, 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 - c.create_conversation_model_evaluation(::Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new(parent: parent, conversation_model_evaluation: conversation_model_evaluation), 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_conversation_model_evaluation_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::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationModels::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::Dialogflow::V2::ConversationModels::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationModels::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_operations_test.rb deleted file mode 100644 index d6a34c793ce8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_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/dialogflow/v2/conversation_profile_pb" -require "google/cloud/dialogflow/v2/conversation_profile_services_pb" -require "google/cloud/dialogflow/v2/conversation_profiles" - -class ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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 - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb deleted file mode 100644 index 3676a8730d69..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_paths_test.rb +++ /dev/null @@ -1,178 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_profiles" - -class ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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_agent_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0" - assert_equal "projects/value0/agent", path - - path = client.agent_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/agent", path - end - end - - def test_cx_security_settings_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cx_security_settings_path project: "value0", location: "value1", security_settings: "value2" - assert_equal "projects/value0/locations/value1/securitySettings/value2", path - end - end - - def test_conversation_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_model_path project: "value0", location: "value1", conversation_model: "value2" - assert_equal "projects/value0/locations/value1/conversationModels/value2", path - - path = client.conversation_model_path project: "value0", conversation_model: "value1" - assert_equal "projects/value0/conversationModels/value1", path - end - end - - def test_conversation_profile_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_profile_path project: "value0", conversation_profile: "value1" - assert_equal "projects/value0/conversationProfiles/value1", path - - path = client.conversation_profile_path project: "value0", location: "value1", conversation_profile: "value2" - assert_equal "projects/value0/locations/value1/conversationProfiles/value2", 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::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", knowledge_base: "value1", document: "value2" - assert_equal "projects/value0/knowledgeBases/value1/documents/value2", path - - path = client.document_path project: "value0", location: "value1", knowledge_base: "value2", document: "value3" - assert_equal "projects/value0/locations/value1/knowledgeBases/value2/documents/value3", path - end - end - - def test_generator_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_path project: "value0", location: "value1", generator: "value2" - assert_equal "projects/value0/locations/value1/generators/value2", path - end - end - - def test_knowledge_base_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.knowledge_base_path project: "value0", knowledge_base: "value1" - assert_equal "projects/value0/knowledgeBases/value1", path - - path = client.knowledge_base_path project: "value0", location: "value1", knowledge_base: "value2" - assert_equal "projects/value0/locations/value1/knowledgeBases/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::Dialogflow::V2::ConversationProfiles::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_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", path - 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::Dialogflow::V2::ConversationProfiles::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-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb deleted file mode 100644 index c12e81f5bde8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_rest_test.rb +++ /dev/null @@ -1,485 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_profile_pb" -require "google/cloud/dialogflow/v2/conversation_profiles/rest" - - -class ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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_conversation_profiles - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse.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_conversation_profiles_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_list_conversation_profiles_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_conversation_profiles_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_conversation_profiles({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_conversation_profiles parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_conversation_profiles ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.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 - c.list_conversation_profiles({ 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 - c.list_conversation_profiles(::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.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_conversation_profiles_client_stub.call_count - end - end - end - - def test_get_conversation_profile - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_conversation_profile_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_get_conversation_profile_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_conversation_profile_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_conversation_profile({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_conversation_profile name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_conversation_profile ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_conversation_profile({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_conversation_profile(::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_conversation_profile_client_stub.call_count - end - end - end - - def test_create_conversation_profile - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - conversation_profile = {} - - create_conversation_profile_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_create_conversation_profile_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_conversation_profile_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_conversation_profile({ parent: parent, conversation_profile: conversation_profile }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_conversation_profile parent: parent, conversation_profile: conversation_profile do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_conversation_profile ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new(parent: parent, conversation_profile: conversation_profile) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_conversation_profile({ parent: parent, conversation_profile: conversation_profile }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_conversation_profile(::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new(parent: parent, conversation_profile: conversation_profile), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_conversation_profile_client_stub.call_count - end - end - end - - def test_update_conversation_profile - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - conversation_profile = {} - update_mask = {} - - update_conversation_profile_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_update_conversation_profile_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_conversation_profile_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_conversation_profile({ conversation_profile: conversation_profile, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_conversation_profile conversation_profile: conversation_profile, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_conversation_profile ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new(conversation_profile: conversation_profile, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_conversation_profile({ conversation_profile: conversation_profile, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_conversation_profile(::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new(conversation_profile: conversation_profile, 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_profile_client_stub.call_count - end - end - end - - def test_delete_conversation_profile - # 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_profile_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_delete_conversation_profile_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_conversation_profile_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_conversation_profile({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_conversation_profile name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_conversation_profile ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_conversation_profile({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_conversation_profile(::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_conversation_profile_client_stub.call_count - end - end - end - - def test_set_suggestion_feature_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. - conversation_profile = "hello world" - participant_role = :ROLE_UNSPECIFIED - suggestion_feature_config = {} - - set_suggestion_feature_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_set_suggestion_feature_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_suggestion_feature_config_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.set_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.set_suggestion_feature_config conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.set_suggestion_feature_config ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.set_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.set_suggestion_feature_config(::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_suggestion_feature_config_client_stub.call_count - end - end - end - - def test_clear_suggestion_feature_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. - conversation_profile = "hello world" - participant_role = :ROLE_UNSPECIFIED - suggestion_feature_type = :TYPE_UNSPECIFIED - - clear_suggestion_feature_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::Dialogflow::V2::ConversationProfiles::Rest::ServiceStub.stub :transcode_clear_suggestion_feature_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, clear_suggestion_feature_config_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.clear_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.clear_suggestion_feature_config conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.clear_suggestion_feature_config ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.clear_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.clear_suggestion_feature_config(::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, clear_suggestion_feature_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::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb deleted file mode 100644 index 5647d2a482d0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversation_profiles_test.rb +++ /dev/null @@ -1,555 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_profile_pb" -require "google/cloud/dialogflow/v2/conversation_profiles" - -class ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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_conversation_profiles - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListConversationProfilesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_conversation_profiles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_conversation_profiles, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest, 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_conversation_profiles_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_conversation_profiles({ 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 - c.list_conversation_profiles 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 - c.list_conversation_profiles ::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.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 - c.list_conversation_profiles({ 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 - c.list_conversation_profiles(::Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.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_conversation_profiles_client_stub.call_rpc_count - end - end - - def test_get_conversation_profile - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new - grpc_operation = GRPC::ActiveCall::Operation.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_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_conversation_profile, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_conversation_profile_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_conversation_profile({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_conversation_profile name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_conversation_profile ::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_conversation_profile({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_conversation_profile(::Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.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_profile_client_stub.call_rpc_count - end - end - - def test_create_conversation_profile - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new - grpc_operation = GRPC::ActiveCall::Operation.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_profile = {} - - create_conversation_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_conversation_profile, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationProfile), request["conversation_profile"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_conversation_profile_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_conversation_profile({ parent: parent, conversation_profile: conversation_profile }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_conversation_profile parent: parent, conversation_profile: conversation_profile do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_conversation_profile ::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new(parent: parent, conversation_profile: conversation_profile) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_conversation_profile({ parent: parent, conversation_profile: conversation_profile }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_conversation_profile(::Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new(parent: parent, conversation_profile: conversation_profile), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_conversation_profile_client_stub.call_rpc_count - end - end - - def test_update_conversation_profile - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ConversationProfile.new - grpc_operation = GRPC::ActiveCall::Operation.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_profile = {} - update_mask = {} - - update_conversation_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_conversation_profile, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationProfile), request["conversation_profile"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_conversation_profile_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_conversation_profile({ conversation_profile: conversation_profile, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_conversation_profile conversation_profile: conversation_profile, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_conversation_profile ::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new(conversation_profile: conversation_profile, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_conversation_profile({ conversation_profile: conversation_profile, 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 - c.update_conversation_profile(::Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new(conversation_profile: conversation_profile, 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_profile_client_stub.call_rpc_count - end - end - - def test_delete_conversation_profile - # 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_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_conversation_profile, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_conversation_profile_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_conversation_profile({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_conversation_profile name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_conversation_profile ::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_conversation_profile({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_conversation_profile(::Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.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_profile_client_stub.call_rpc_count - end - end - - def test_set_suggestion_feature_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. - conversation_profile = "hello world" - participant_role = :ROLE_UNSPECIFIED - suggestion_feature_config = {} - - set_suggestion_feature_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_suggestion_feature_config, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest, request - assert_equal "hello world", request["conversation_profile"] - assert_equal :ROLE_UNSPECIFIED, request["participant_role"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionFeatureConfig), request["suggestion_feature_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_suggestion_feature_config_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.set_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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 - c.set_suggestion_feature_config conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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 - c.set_suggestion_feature_config ::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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 - c.set_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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 - c.set_suggestion_feature_config(::Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_config: suggestion_feature_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, set_suggestion_feature_config_client_stub.call_rpc_count - end - end - - def test_clear_suggestion_feature_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. - conversation_profile = "hello world" - participant_role = :ROLE_UNSPECIFIED - suggestion_feature_type = :TYPE_UNSPECIFIED - - clear_suggestion_feature_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :clear_suggestion_feature_config, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest, request - assert_equal "hello world", request["conversation_profile"] - assert_equal :ROLE_UNSPECIFIED, request["participant_role"] - assert_equal :TYPE_UNSPECIFIED, request["suggestion_feature_type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, clear_suggestion_feature_config_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.clear_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type }) 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 - c.clear_suggestion_feature_config conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type 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 - c.clear_suggestion_feature_config ::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type) 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 - c.clear_suggestion_feature_config({ conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type }, 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 - c.clear_suggestion_feature_config(::Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new(conversation_profile: conversation_profile, participant_role: participant_role, suggestion_feature_type: suggestion_feature_type), 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, clear_suggestion_feature_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::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationProfiles::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::Dialogflow::V2::ConversationProfiles::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::V2::ConversationProfiles::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb deleted file mode 100644 index 761bf3173e36..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_paths_test.rb +++ /dev/null @@ -1,262 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversations" - -class ::Google::Cloud::Dialogflow::V2::Conversations::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_agent_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0" - assert_equal "projects/value0/agent", path - - path = client.agent_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/agent", path - end - end - - def test_app_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.app_path project: "value0", location: "value1", app: "value2" - assert_equal "projects/value0/locations/value1/apps/value2", path - end - end - - def test_cx_security_settings_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cx_security_settings_path project: "value0", location: "value1", security_settings: "value2" - assert_equal "projects/value0/locations/value1/securitySettings/value2", 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::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_path project: "value0", conversation: "value1" - assert_equal "projects/value0/conversations/value1", path - - path = client.conversation_path project: "value0", location: "value1", conversation: "value2" - assert_equal "projects/value0/locations/value1/conversations/value2", path - end - end - - def test_conversation_model_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_model_path project: "value0", location: "value1", conversation_model: "value2" - assert_equal "projects/value0/locations/value1/conversationModels/value2", path - - path = client.conversation_model_path project: "value0", conversation_model: "value1" - assert_equal "projects/value0/conversationModels/value1", path - end - end - - def test_conversation_profile_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_profile_path project: "value0", conversation_profile: "value1" - assert_equal "projects/value0/conversationProfiles/value1", path - - path = client.conversation_profile_path project: "value0", location: "value1", conversation_profile: "value2" - assert_equal "projects/value0/locations/value1/conversationProfiles/value2", 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::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - 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 - - path = client.data_store_path project: "value0", location: "value1", data_store: "value2" - assert_equal "projects/value0/locations/value1/dataStores/value2", 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::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", knowledge_base: "value1", document: "value2" - assert_equal "projects/value0/knowledgeBases/value1/documents/value2", path - - path = client.document_path project: "value0", location: "value1", knowledge_base: "value2", document: "value3" - assert_equal "projects/value0/locations/value1/knowledgeBases/value2/documents/value3", path - end - end - - def test_generator_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_path project: "value0", location: "value1", generator: "value2" - assert_equal "projects/value0/locations/value1/generators/value2", path - end - end - - def test_knowledge_base_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.knowledge_base_path project: "value0", knowledge_base: "value1" - assert_equal "projects/value0/knowledgeBases/value1", path - - path = client.knowledge_base_path project: "value0", location: "value1", knowledge_base: "value2" - assert_equal "projects/value0/locations/value1/knowledgeBases/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::Dialogflow::V2::Conversations::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_message_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.message_path project: "value0", conversation: "value1", message: "value2" - assert_equal "projects/value0/conversations/value1/messages/value2", path - - path = client.message_path project: "value0", location: "value1", conversation: "value2", message: "value3" - assert_equal "projects/value0/locations/value1/conversations/value2/messages/value3", path - end - end - - def test_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", path - 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::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tool_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", tool: "value2" - assert_equal "projects/value0/locations/value1/tools/value2", path - - path = client.tool_path project: "value0", location: "value1", app: "value2", tool: "value3" - assert_equal "projects/value0/locations/value1/apps/value2/tools/value3", path - end - end - - def test_toolset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.toolset_path project: "value0", location: "value1", app: "value2", toolset: "value3" - assert_equal "projects/value0/locations/value1/apps/value2/toolsets/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb deleted file mode 100644 index 4f7911dab6f5..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_rest_test.rb +++ /dev/null @@ -1,724 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_pb" -require "google/cloud/dialogflow/v2/conversations/rest" - - -class ::Google::Cloud::Dialogflow::V2::Conversations::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_conversation - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Conversation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - conversation = {} - conversation_id = "hello world" - - 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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_create_conversation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_conversation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_conversation({ parent: parent, conversation: conversation, conversation_id: conversation_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_conversation parent: parent, conversation: conversation, conversation_id: conversation_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_conversation ::Google::Cloud::Dialogflow::V2::CreateConversationRequest.new(parent: parent, conversation: conversation, conversation_id: conversation_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_conversation({ parent: parent, conversation: conversation, conversation_id: conversation_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_conversation(::Google::Cloud::Dialogflow::V2::CreateConversationRequest.new(parent: parent, conversation: conversation, conversation_id: conversation_id), 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_list_conversations - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::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" - - 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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_list_conversations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_conversations_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_conversations({ 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 - c.list_conversations 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 - c.list_conversations ::Google::Cloud::Dialogflow::V2::ListConversationsRequest.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 - c.list_conversations({ 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 - c.list_conversations(::Google::Cloud::Dialogflow::V2::ListConversationsRequest.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_conversations_client_stub.call_count - end - end - end - - def test_get_conversation - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_get_conversation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_conversation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_conversation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_conversation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_conversation ::Google::Cloud::Dialogflow::V2::GetConversationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_conversation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_conversation(::Google::Cloud::Dialogflow::V2::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_complete_conversation - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Conversation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - complete_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_complete_conversation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, complete_conversation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.complete_conversation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.complete_conversation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.complete_conversation ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.complete_conversation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.complete_conversation(::Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, complete_conversation_client_stub.call_count - end - end - end - - def test_ingest_context_references - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - conversation = "hello world" - context_references = {} - - ingest_context_references_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_ingest_context_references_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, ingest_context_references_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.ingest_context_references({ conversation: conversation, context_references: context_references }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.ingest_context_references conversation: conversation, context_references: context_references do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.ingest_context_references ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new(conversation: conversation, context_references: context_references) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.ingest_context_references({ conversation: conversation, context_references: context_references }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.ingest_context_references(::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new(conversation: conversation, context_references: context_references), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, ingest_context_references_client_stub.call_count - end - end - end - - def test_list_messages - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListMessagesResponse.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" - page_size = 42 - page_token = "hello world" - - list_messages_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_list_messages_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_messages_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_messages({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_messages parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_messages ::Google::Cloud::Dialogflow::V2::ListMessagesRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.list_messages({ parent: parent, filter: filter, 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 - c.list_messages(::Google::Cloud::Dialogflow::V2::ListMessagesRequest.new(parent: parent, filter: filter, 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_messages_client_stub.call_count - end - end - end - - def test_suggest_conversation_summary - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - conversation = "hello world" - latest_message = "hello world" - context_size = 42 - assist_query_params = {} - - suggest_conversation_summary_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_suggest_conversation_summary_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, suggest_conversation_summary_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.suggest_conversation_summary({ conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.suggest_conversation_summary conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.suggest_conversation_summary ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new(conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.suggest_conversation_summary({ conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.suggest_conversation_summary(::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new(conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, suggest_conversation_summary_client_stub.call_count - end - end - end - - def test_generate_stateless_summary - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - stateless_conversation = {} - conversation_profile = {} - latest_message = "hello world" - max_context_size = 42 - - generate_stateless_summary_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_generate_stateless_summary_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_stateless_summary_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.generate_stateless_summary({ stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.generate_stateless_summary stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.generate_stateless_summary ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new(stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.generate_stateless_summary({ stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.generate_stateless_summary(::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new(stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_stateless_summary_client_stub.call_count - end - end - end - - def test_generate_stateless_suggestion - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - generator = {} - context_references = {} - conversation_context = {} - trigger_events = [:TRIGGER_EVENT_UNSPECIFIED] - security_settings = "hello world" - - generate_stateless_suggestion_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_generate_stateless_suggestion_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_stateless_suggestion_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.generate_stateless_suggestion({ parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.generate_stateless_suggestion parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.generate_stateless_suggestion ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new(parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.generate_stateless_suggestion({ parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.generate_stateless_suggestion(::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new(parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_stateless_suggestion_client_stub.call_count - end - end - end - - def test_search_knowledge - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - query = {} - conversation_profile = "hello world" - session_id = "hello world" - conversation = "hello world" - latest_message = "hello world" - query_source = :QUERY_SOURCE_UNSPECIFIED - end_user_metadata = {} - search_config = {} - exact_search = true - - search_knowledge_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_search_knowledge_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_knowledge_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.search_knowledge({ parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.search_knowledge parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.search_knowledge ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new(parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.search_knowledge({ parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.search_knowledge(::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new(parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_knowledge_client_stub.call_count - end - end - end - - def test_generate_suggestions - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - conversation = "hello world" - latest_message = "hello world" - trigger_events = [:TRIGGER_EVENT_UNSPECIFIED] - - generate_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::Dialogflow::V2::Conversations::Rest::ServiceStub.stub :transcode_generate_suggestions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_suggestions_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.generate_suggestions({ conversation: conversation, latest_message: latest_message, trigger_events: trigger_events }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.generate_suggestions conversation: conversation, latest_message: latest_message, trigger_events: trigger_events do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.generate_suggestions ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new(conversation: conversation, latest_message: latest_message, trigger_events: trigger_events) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.generate_suggestions({ conversation: conversation, latest_message: latest_message, trigger_events: trigger_events }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.generate_suggestions(::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new(conversation: conversation, latest_message: latest_message, trigger_events: trigger_events), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_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::Dialogflow::V2::Conversations::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::Dialogflow::V2::Conversations::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb deleted file mode 100644 index e47901da7441..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/conversations_test.rb +++ /dev/null @@ -1,815 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/conversation_pb" -require "google/cloud/dialogflow/v2/conversations" - -class ::Google::Cloud::Dialogflow::V2::Conversations::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_conversation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::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 = {} - conversation_id = "hello world" - - create_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_conversation, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateConversationRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Conversation), request["conversation"] - assert_equal "hello world", request["conversation_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_conversation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_conversation({ parent: parent, conversation: conversation, conversation_id: conversation_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_conversation parent: parent, conversation: conversation, conversation_id: conversation_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_conversation ::Google::Cloud::Dialogflow::V2::CreateConversationRequest.new(parent: parent, conversation: conversation, conversation_id: conversation_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_conversation({ parent: parent, conversation: conversation, conversation_id: conversation_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_conversation(::Google::Cloud::Dialogflow::V2::CreateConversationRequest.new(parent: parent, conversation: conversation, conversation_id: conversation_id), 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_list_conversations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::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" - - list_conversations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_conversations, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::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"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_conversations_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_conversations({ 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 - c.list_conversations 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 - c.list_conversations ::Google::Cloud::Dialogflow::V2::ListConversationsRequest.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 - c.list_conversations({ 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 - c.list_conversations(::Google::Cloud::Dialogflow::V2::ListConversationsRequest.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_conversations_client_stub.call_rpc_count - end - end - - def test_get_conversation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::GetConversationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_conversation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_conversation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_conversation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_conversation ::Google::Cloud::Dialogflow::V2::GetConversationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.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 - c.get_conversation(::Google::Cloud::Dialogflow::V2::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_complete_conversation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::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" - - complete_conversation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :complete_conversation, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, complete_conversation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.complete_conversation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.complete_conversation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.complete_conversation ::Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.complete_conversation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.complete_conversation(::Google::Cloud::Dialogflow::V2::CompleteConversationRequest.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, complete_conversation_client_stub.call_rpc_count - end - end - - def test_ingest_context_references - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::IngestContextReferencesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - context_references = {} - - ingest_context_references_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :ingest_context_references, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest, request - assert_equal "hello world", request["conversation"] - assert_equal({}, request["context_references"].to_h) - refute_nil options - end - - Gapic::ServiceStub.stub :new, ingest_context_references_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.ingest_context_references({ conversation: conversation, context_references: context_references }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.ingest_context_references conversation: conversation, context_references: context_references do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.ingest_context_references ::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new(conversation: conversation, context_references: context_references) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.ingest_context_references({ conversation: conversation, context_references: context_references }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.ingest_context_references(::Google::Cloud::Dialogflow::V2::IngestContextReferencesRequest.new(conversation: conversation, context_references: context_references), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, ingest_context_references_client_stub.call_rpc_count - end - end - - def test_list_messages - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListMessagesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - page_size = 42 - page_token = "hello world" - - list_messages_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_messages, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListMessagesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_messages_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_messages({ parent: parent, filter: filter, 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 - c.list_messages parent: parent, filter: filter, 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 - c.list_messages ::Google::Cloud::Dialogflow::V2::ListMessagesRequest.new(parent: parent, filter: filter, 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 - c.list_messages({ parent: parent, filter: filter, 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 - c.list_messages(::Google::Cloud::Dialogflow::V2::ListMessagesRequest.new(parent: parent, filter: filter, 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_messages_client_stub.call_rpc_count - end - end - - def test_suggest_conversation_summary - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - latest_message = "hello world" - context_size = 42 - assist_query_params = {} - - suggest_conversation_summary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :suggest_conversation_summary, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest, request - assert_equal "hello world", request["conversation"] - assert_equal "hello world", request["latest_message"] - assert_equal 42, request["context_size"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), request["assist_query_params"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, suggest_conversation_summary_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.suggest_conversation_summary({ conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.suggest_conversation_summary conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.suggest_conversation_summary ::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new(conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.suggest_conversation_summary({ conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.suggest_conversation_summary(::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new(conversation: conversation, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, suggest_conversation_summary_client_stub.call_rpc_count - end - end - - def test_generate_stateless_summary - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - stateless_conversation = {} - conversation_profile = {} - latest_message = "hello world" - max_context_size = 42 - - generate_stateless_summary_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_stateless_summary, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest::MinimalConversation), request["stateless_conversation"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationProfile), request["conversation_profile"] - assert_equal "hello world", request["latest_message"] - assert_equal 42, request["max_context_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_stateless_summary_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.generate_stateless_summary({ stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.generate_stateless_summary stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.generate_stateless_summary ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new(stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.generate_stateless_summary({ stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.generate_stateless_summary(::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new(stateless_conversation: stateless_conversation, conversation_profile: conversation_profile, latest_message: latest_message, max_context_size: max_context_size), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_stateless_summary_client_stub.call_rpc_count - end - end - - def test_generate_stateless_suggestion - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - generator = {} - context_references = {} - conversation_context = {} - trigger_events = [:TRIGGER_EVENT_UNSPECIFIED] - security_settings = "hello world" - - generate_stateless_suggestion_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_stateless_suggestion, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Generator), request["generator"] - assert_equal :generator, request.generator_resource - assert_equal({}, request["context_references"].to_h) - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ConversationContext), request["conversation_context"] - assert_equal [:TRIGGER_EVENT_UNSPECIFIED], request["trigger_events"] - assert_equal "hello world", request["security_settings"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_stateless_suggestion_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.generate_stateless_suggestion({ parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.generate_stateless_suggestion parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.generate_stateless_suggestion ::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new(parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.generate_stateless_suggestion({ parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.generate_stateless_suggestion(::Google::Cloud::Dialogflow::V2::GenerateStatelessSuggestionRequest.new(parent: parent, generator: generator, context_references: context_references, conversation_context: conversation_context, trigger_events: trigger_events, security_settings: security_settings), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_stateless_suggestion_client_stub.call_rpc_count - end - end - - def test_search_knowledge - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - query = {} - conversation_profile = "hello world" - session_id = "hello world" - conversation = "hello world" - latest_message = "hello world" - query_source = :QUERY_SOURCE_UNSPECIFIED - end_user_metadata = {} - search_config = {} - exact_search = true - - search_knowledge_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_knowledge, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::TextInput), request["query"] - assert_equal "hello world", request["conversation_profile"] - assert_equal "hello world", request["session_id"] - assert_equal "hello world", request["conversation"] - assert_equal "hello world", request["latest_message"] - assert_equal :QUERY_SOURCE_UNSPECIFIED, request["query_source"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["end_user_metadata"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest::SearchConfig), request["search_config"] - assert_equal true, request["exact_search"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_knowledge_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.search_knowledge({ parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.search_knowledge parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.search_knowledge ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new(parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.search_knowledge({ parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.search_knowledge(::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new(parent: parent, query: query, conversation_profile: conversation_profile, session_id: session_id, conversation: conversation, latest_message: latest_message, query_source: query_source, end_user_metadata: end_user_metadata, search_config: search_config, exact_search: exact_search), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_knowledge_client_stub.call_rpc_count - end - end - - def test_generate_suggestions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - latest_message = "hello world" - trigger_events = [:TRIGGER_EVENT_UNSPECIFIED] - - generate_suggestions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_suggestions, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest, request - assert_equal "hello world", request["conversation"] - assert_equal "hello world", request["latest_message"] - assert_equal [:TRIGGER_EVENT_UNSPECIFIED], request["trigger_events"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_suggestions_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.generate_suggestions({ conversation: conversation, latest_message: latest_message, trigger_events: trigger_events }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.generate_suggestions conversation: conversation, latest_message: latest_message, trigger_events: trigger_events do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.generate_suggestions ::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new(conversation: conversation, latest_message: latest_message, trigger_events: trigger_events) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.generate_suggestions({ conversation: conversation, latest_message: latest_message, trigger_events: trigger_events }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.generate_suggestions(::Google::Cloud::Dialogflow::V2::GenerateSuggestionsRequest.new(conversation: conversation, latest_message: latest_message, trigger_events: trigger_events), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_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::Dialogflow::V2::Conversations::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::Dialogflow::V2::Conversations::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::Dialogflow::V2::Conversations::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Conversations::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_operations_test.rb deleted file mode 100644 index f250723d2be3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_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/dialogflow/v2/document_pb" -require "google/cloud/dialogflow/v2/document_services_pb" -require "google/cloud/dialogflow/v2/documents" - -class ::Google::Cloud::Dialogflow::V2::Documents::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 - c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Documents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_paths_test.rb deleted file mode 100644 index 25179732e8c7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_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/dialogflow/v2/documents" - -class ::Google::Cloud::Dialogflow::V2::Documents::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_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::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.document_path project: "value0", knowledge_base: "value1", document: "value2" - assert_equal "projects/value0/knowledgeBases/value1/documents/value2", path - - path = client.document_path project: "value0", location: "value1", knowledge_base: "value2", document: "value3" - assert_equal "projects/value0/locations/value1/knowledgeBases/value2/documents/value3", path - end - end - - def test_knowledge_base_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.knowledge_base_path project: "value0", knowledge_base: "value1" - assert_equal "projects/value0/knowledgeBases/value1", path - - path = client.knowledge_base_path project: "value0", location: "value1", knowledge_base: "value2" - assert_equal "projects/value0/locations/value1/knowledgeBases/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb deleted file mode 100644 index 5f9051d968a4..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_rest_test.rb +++ /dev/null @@ -1,545 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/document_pb" -require "google/cloud/dialogflow/v2/documents/rest" - - -class ::Google::Cloud::Dialogflow::V2::Documents::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_documents - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::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" - filter = "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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_list_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_documents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_documents({ 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 - c.list_documents 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 - c.list_documents ::Google::Cloud::Dialogflow::V2::ListDocumentsRequest.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 - c.list_documents({ 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 - c.list_documents(::Google::Cloud::Dialogflow::V2::ListDocumentsRequest.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_documents_client_stub.call_count - end - end - end - - def test_get_document - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_get_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_document({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_document name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_document ::Google::Cloud::Dialogflow::V2::GetDocumentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_document({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_document(::Google::Cloud::Dialogflow::V2::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_create_document - # 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" - document = {} - - 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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_create_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_document({ parent: parent, document: document }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_document parent: parent, document: document do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_document ::Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new(parent: parent, document: document) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_document({ parent: parent, document: document }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_document(::Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new(parent: parent, document: document), 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_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. - parent = "hello world" - gcs_source = {} - document_template = {} - import_gcs_custom_metadata = 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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_import_documents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_documents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.import_documents({ parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.import_documents parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.import_documents ::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new(parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.import_documents({ parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.import_documents(::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new(parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata), 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_delete_document - # 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_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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_delete_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_document({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_document name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_document ::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_document({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_document(::Google::Cloud::Dialogflow::V2::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_update_document - # 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. - document = {} - 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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_update_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_document({ document: document, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_document document: document, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_document ::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new(document: document, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_document({ document: document, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_document(::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new(document: document, 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_reload_document - # 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" - content_uri = "hello world" - import_gcs_custom_metadata = true - smart_messaging_partial_update = true - - reload_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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_reload_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reload_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.reload_document({ name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.reload_document name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.reload_document ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new(name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.reload_document({ name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.reload_document(::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new(name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reload_document_client_stub.call_count - end - end - end - - def test_export_document - # 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" - gcs_destination = {} - export_full_content = true - smart_messaging_partial_update = true - - export_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::Dialogflow::V2::Documents::Rest::ServiceStub.stub :transcode_export_document_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, export_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.export_document({ name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.export_document name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.export_document ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new(name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.export_document({ name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.export_document(::Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new(name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, export_document_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::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb deleted file mode 100644 index 691ae755215c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/documents_test.rb +++ /dev/null @@ -1,648 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/document_pb" -require "google/cloud/dialogflow/v2/documents" - -class ::Google::Cloud::Dialogflow::V2::Documents::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_documents - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::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" - filter = "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::Dialogflow::V2::ListDocumentsRequest, 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_documents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_documents({ 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 - c.list_documents 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 - c.list_documents ::Google::Cloud::Dialogflow::V2::ListDocumentsRequest.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 - c.list_documents({ 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 - c.list_documents(::Google::Cloud::Dialogflow::V2::ListDocumentsRequest.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_documents_client_stub.call_rpc_count - end - end - - def test_get_document - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::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::Dialogflow::V2::GetDocumentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_document({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_document name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_document ::Google::Cloud::Dialogflow::V2::GetDocumentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.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 - c.get_document(::Google::Cloud::Dialogflow::V2::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_create_document - # 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" - document = {} - - create_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_document, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateDocumentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Document), request["document"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_document({ parent: parent, document: document }) 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 - c.create_document parent: parent, document: document 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 - c.create_document ::Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new(parent: parent, document: document) 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 - c.create_document({ parent: parent, document: document }, 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 - c.create_document(::Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new(parent: parent, document: document), 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_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. - parent = "hello world" - gcs_source = {} - document_template = {} - import_gcs_custom_metadata = 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::Dialogflow::V2::ImportDocumentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::GcsSources), request["gcs_source"] - assert_equal :gcs_source, request.source - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::ImportDocumentTemplate), request["document_template"] - assert_equal true, request["import_gcs_custom_metadata"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_documents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.import_documents({ parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata }) 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 - c.import_documents parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata 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 - c.import_documents ::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new(parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata) 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 - c.import_documents({ parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata }, 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 - c.import_documents(::Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new(parent: parent, gcs_source: gcs_source, document_template: document_template, import_gcs_custom_metadata: import_gcs_custom_metadata), 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_delete_document - # 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_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_document, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_document({ 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 - c.delete_document 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 - c.delete_document ::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.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 - c.delete_document({ 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 - c.delete_document(::Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.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_document_client_stub.call_rpc_count - end - end - - def test_update_document - # 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. - document = {} - 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::Dialogflow::V2::UpdateDocumentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Document), request["document"] - 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 - c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_document({ document: document, update_mask: update_mask }) 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 - c.update_document document: document, update_mask: update_mask 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 - c.update_document ::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new(document: document, update_mask: update_mask) 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 - c.update_document({ document: document, update_mask: update_mask }, 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 - c.update_document(::Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new(document: document, update_mask: update_mask), 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_document_client_stub.call_rpc_count - end - end - - def test_reload_document - # 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" - content_uri = "hello world" - import_gcs_custom_metadata = true - smart_messaging_partial_update = true - - reload_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reload_document, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["content_uri"] - assert_equal :content_uri, request.source - assert_equal true, request["import_gcs_custom_metadata"] - assert_equal true, request["smart_messaging_partial_update"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reload_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.reload_document({ name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update }) 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 - c.reload_document name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update 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 - c.reload_document ::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new(name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update) 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 - c.reload_document({ name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update }, 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 - c.reload_document(::Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new(name: name, content_uri: content_uri, import_gcs_custom_metadata: import_gcs_custom_metadata, smart_messaging_partial_update: smart_messaging_partial_update), 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, reload_document_client_stub.call_rpc_count - end - end - - def test_export_document - # 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" - gcs_destination = {} - export_full_content = true - smart_messaging_partial_update = true - - export_document_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :export_document, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::GcsDestination), request["gcs_destination"] - assert_equal :gcs_destination, request.destination - assert_equal true, request["export_full_content"] - assert_equal true, request["smart_messaging_partial_update"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, export_document_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.export_document({ name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update }) 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 - c.export_document name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update 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 - c.export_document ::Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new(name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update) 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 - c.export_document({ name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update }, 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 - c.export_document(::Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new(name: name, gcs_destination: gcs_destination, export_full_content: export_full_content, smart_messaging_partial_update: smart_messaging_partial_update), 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, export_document_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::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Documents::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::Dialogflow::V2::Documents::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::V2::Documents::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_operations_test.rb deleted file mode 100644 index 79ee72e1d1eb..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/encryption_spec_pb" -require "google/cloud/dialogflow/v2/encryption_spec_services_pb" -require "google/cloud/dialogflow/v2/encryption_spec_service" - -class ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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 - c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_paths_test.rb deleted file mode 100644 index 5741e3b25302..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_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/dialogflow/v2/encryption_spec_service" - -class ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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_encryption_spec_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.encryption_spec_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/encryptionSpec", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_rest_test.rb deleted file mode 100644 index a27919780fac..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_rest_test.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! - -require "helper" -require "gapic/rest" -require "google/cloud/dialogflow/v2/encryption_spec_pb" -require "google/cloud/dialogflow/v2/encryption_spec_service/rest" - - -class ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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_encryption_spec - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::EncryptionSpec.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_encryption_spec_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::Dialogflow::V2::EncryptionSpecService::Rest::ServiceStub.stub :transcode_get_encryption_spec_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_encryption_spec_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_encryption_spec({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_encryption_spec name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_encryption_spec ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_encryption_spec({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_encryption_spec(::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_encryption_spec_client_stub.call_count - end - end - end - - def test_initialize_encryption_spec - # 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. - encryption_spec = {} - - initialize_encryption_spec_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::Dialogflow::V2::EncryptionSpecService::Rest::ServiceStub.stub :transcode_initialize_encryption_spec_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, initialize_encryption_spec_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.initialize_encryption_spec({ encryption_spec: encryption_spec }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.initialize_encryption_spec encryption_spec: encryption_spec do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.initialize_encryption_spec ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new(encryption_spec: encryption_spec) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.initialize_encryption_spec({ encryption_spec: encryption_spec }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.initialize_encryption_spec(::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new(encryption_spec: encryption_spec), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, initialize_encryption_spec_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::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_test.rb deleted file mode 100644 index ee38aa1ad0c9..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/encryption_spec_service_test.rb +++ /dev/null @@ -1,239 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/encryption_spec_pb" -require "google/cloud/dialogflow/v2/encryption_spec_service" - -class ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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_encryption_spec - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::EncryptionSpec.new - grpc_operation = GRPC::ActiveCall::Operation.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_encryption_spec_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_encryption_spec, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_encryption_spec_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_encryption_spec({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_encryption_spec name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_encryption_spec ::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_encryption_spec({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_encryption_spec(::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.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_encryption_spec_client_stub.call_rpc_count - end - end - - def test_initialize_encryption_spec - # 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. - encryption_spec = {} - - initialize_encryption_spec_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :initialize_encryption_spec, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::EncryptionSpec), request["encryption_spec"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, initialize_encryption_spec_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.initialize_encryption_spec({ encryption_spec: encryption_spec }) 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 - c.initialize_encryption_spec encryption_spec: encryption_spec 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 - c.initialize_encryption_spec ::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new(encryption_spec: encryption_spec) 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 - c.initialize_encryption_spec({ encryption_spec: encryption_spec }, 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 - c.initialize_encryption_spec(::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new(encryption_spec: encryption_spec), 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, initialize_encryption_spec_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::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::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::Dialogflow::V2::EncryptionSpecService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_operations_test.rb deleted file mode 100644 index 540375d99656..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_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/dialogflow/v2/entity_type_pb" -require "google/cloud/dialogflow/v2/entity_type_services_pb" -require "google/cloud/dialogflow/v2/entity_types" - -class ::Google::Cloud::Dialogflow::V2::EntityTypes::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 - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_paths_test.rb deleted file mode 100644 index 7770fc0cb21e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_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/dialogflow/v2/entity_types" - -class ::Google::Cloud::Dialogflow::V2::EntityTypes::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_agent_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0" - assert_equal "projects/value0/agent", path - - path = client.agent_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/agent", path - end - end - - def test_entity_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.entity_type_path project: "value0", entity_type: "value1" - assert_equal "projects/value0/agent/entityTypes/value1", path - - path = client.entity_type_path project: "value0", location: "value1", entity_type: "value2" - assert_equal "projects/value0/locations/value1/agent/entityTypes/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb deleted file mode 100644 index d7686ee630ac..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_rest_test.rb +++ /dev/null @@ -1,658 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/entity_type_pb" -require "google/cloud/dialogflow/v2/entity_types/rest" - - -class ::Google::Cloud::Dialogflow::V2::EntityTypes::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_entity_types - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - language_code = "hello world" - page_size = 42 - page_token = "hello world" - - list_entity_types_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_list_entity_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_entity_types_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_entity_types({ parent: parent, language_code: language_code, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_entity_types parent: parent, language_code: language_code, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_entity_types ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new(parent: parent, language_code: language_code, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.list_entity_types({ parent: parent, language_code: language_code, 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 - c.list_entity_types(::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new(parent: parent, language_code: language_code, 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_entity_types_client_stub.call_count - end - end - end - - def test_get_entity_type - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::EntityType.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - language_code = "hello world" - - get_entity_type_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_get_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_entity_type({ name: name, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_entity_type name: name, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_entity_type ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new(name: name, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_entity_type({ name: name, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_entity_type(::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new(name: name, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_entity_type_client_stub.call_count - end - end - end - - def test_create_entity_type - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::EntityType.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - entity_type = {} - language_code = "hello world" - - create_entity_type_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_create_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_entity_type({ parent: parent, entity_type: entity_type, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_entity_type parent: parent, entity_type: entity_type, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_entity_type ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new(parent: parent, entity_type: entity_type, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_entity_type({ parent: parent, entity_type: entity_type, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_entity_type(::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new(parent: parent, entity_type: entity_type, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_entity_type_client_stub.call_count - end - end - end - - def test_update_entity_type - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::EntityType.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - entity_type = {} - language_code = "hello world" - update_mask = {} - - update_entity_type_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_update_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_entity_type({ entity_type: entity_type, language_code: language_code, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_entity_type entity_type: entity_type, language_code: language_code, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_entity_type ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new(entity_type: entity_type, language_code: language_code, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_entity_type({ entity_type: entity_type, language_code: language_code, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_entity_type(::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new(entity_type: entity_type, language_code: language_code, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_entity_type_client_stub.call_count - end - end - end - - def test_delete_entity_type - # 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_entity_type_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_delete_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_entity_type({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_entity_type name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_entity_type ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_entity_type({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_entity_type(::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_entity_type_client_stub.call_count - end - end - end - - def test_batch_update_entity_types - # 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" - entity_type_batch_uri = "hello world" - language_code = "hello world" - update_mask = {} - - batch_update_entity_types_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_update_entity_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_update_entity_types_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.batch_update_entity_types({ parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.batch_update_entity_types parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.batch_update_entity_types ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new(parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.batch_update_entity_types({ parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.batch_update_entity_types(::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new(parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_update_entity_types_client_stub.call_count - end - end - end - - def test_batch_delete_entity_types - # 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" - entity_type_names = ["hello world"] - - batch_delete_entity_types_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_delete_entity_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_delete_entity_types_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.batch_delete_entity_types({ parent: parent, entity_type_names: entity_type_names }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.batch_delete_entity_types parent: parent, entity_type_names: entity_type_names do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.batch_delete_entity_types ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new(parent: parent, entity_type_names: entity_type_names) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.batch_delete_entity_types({ parent: parent, entity_type_names: entity_type_names }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.batch_delete_entity_types(::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new(parent: parent, entity_type_names: entity_type_names), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_delete_entity_types_client_stub.call_count - end - end - end - - def test_batch_create_entities - # 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" - entities = [{}] - language_code = "hello world" - - batch_create_entities_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_create_entities_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_create_entities_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.batch_create_entities({ parent: parent, entities: entities, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.batch_create_entities parent: parent, entities: entities, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.batch_create_entities ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.batch_create_entities({ parent: parent, entities: entities, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.batch_create_entities(::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_create_entities_client_stub.call_count - end - end - end - - def test_batch_update_entities - # 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" - entities = [{}] - language_code = "hello world" - update_mask = {} - - batch_update_entities_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_update_entities_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_update_entities_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.batch_update_entities({ parent: parent, entities: entities, language_code: language_code, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.batch_update_entities parent: parent, entities: entities, language_code: language_code, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.batch_update_entities ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.batch_update_entities({ parent: parent, entities: entities, language_code: language_code, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.batch_update_entities(::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_update_entities_client_stub.call_count - end - end - end - - def test_batch_delete_entities - # 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" - entity_values = ["hello world"] - language_code = "hello world" - - batch_delete_entities_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::Dialogflow::V2::EntityTypes::Rest::ServiceStub.stub :transcode_batch_delete_entities_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_delete_entities_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.batch_delete_entities({ parent: parent, entity_values: entity_values, language_code: language_code }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.batch_delete_entities parent: parent, entity_values: entity_values, language_code: language_code do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.batch_delete_entities ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new(parent: parent, entity_values: entity_values, language_code: language_code) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.batch_delete_entities({ parent: parent, entity_values: entity_values, language_code: language_code }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.batch_delete_entities(::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new(parent: parent, entity_values: entity_values, language_code: language_code), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_delete_entities_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::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb deleted file mode 100644 index b500addee8a3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/entity_types_test.rb +++ /dev/null @@ -1,767 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/entity_type_pb" -require "google/cloud/dialogflow/v2/entity_types" - -class ::Google::Cloud::Dialogflow::V2::EntityTypes::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_entity_types - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - language_code = "hello world" - page_size = 42 - page_token = "hello world" - - list_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_entity_types, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["language_code"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_entity_types_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_entity_types({ parent: parent, language_code: language_code, 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 - c.list_entity_types parent: parent, language_code: language_code, 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 - c.list_entity_types ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new(parent: parent, language_code: language_code, 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 - c.list_entity_types({ parent: parent, language_code: language_code, 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 - c.list_entity_types(::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new(parent: parent, language_code: language_code, 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_entity_types_client_stub.call_rpc_count - end - end - - def test_get_entity_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::EntityType.new - grpc_operation = GRPC::ActiveCall::Operation.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" - language_code = "hello world" - - get_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_entity_type, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_entity_type({ name: name, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_entity_type name: name, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_entity_type ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new(name: name, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_entity_type({ name: name, language_code: language_code }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_entity_type(::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new(name: name, language_code: language_code), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_entity_type_client_stub.call_rpc_count - end - end - - def test_create_entity_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::EntityType.new - grpc_operation = GRPC::ActiveCall::Operation.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" - entity_type = {} - language_code = "hello world" - - create_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_entity_type, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::EntityType), request["entity_type"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_entity_type({ parent: parent, entity_type: entity_type, language_code: language_code }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_entity_type parent: parent, entity_type: entity_type, language_code: language_code do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_entity_type ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new(parent: parent, entity_type: entity_type, language_code: language_code) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_entity_type({ parent: parent, entity_type: entity_type, language_code: language_code }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_entity_type(::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new(parent: parent, entity_type: entity_type, language_code: language_code), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_entity_type_client_stub.call_rpc_count - end - end - - def test_update_entity_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::EntityType.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - entity_type = {} - language_code = "hello world" - update_mask = {} - - update_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_entity_type, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::EntityType), request["entity_type"] - assert_equal "hello world", request["language_code"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_entity_type({ entity_type: entity_type, language_code: language_code, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_entity_type entity_type: entity_type, language_code: language_code, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_entity_type ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new(entity_type: entity_type, language_code: language_code, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_entity_type({ entity_type: entity_type, language_code: language_code, 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 - c.update_entity_type(::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new(entity_type: entity_type, language_code: language_code, 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_entity_type_client_stub.call_rpc_count - end - end - - def test_delete_entity_type - # 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_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_entity_type, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_entity_type({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_entity_type name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_entity_type ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_entity_type({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_entity_type(::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.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_entity_type_client_stub.call_rpc_count - end - end - - def test_batch_update_entity_types - # 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" - entity_type_batch_uri = "hello world" - language_code = "hello world" - update_mask = {} - - batch_update_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_update_entity_types, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["entity_type_batch_uri"] - assert_equal :entity_type_batch_uri, request.entity_type_batch - assert_equal "hello world", request["language_code"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_update_entity_types_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.batch_update_entity_types({ parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask }) 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 - c.batch_update_entity_types parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask 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 - c.batch_update_entity_types ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new(parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask) 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 - c.batch_update_entity_types({ parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask }, 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 - c.batch_update_entity_types(::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new(parent: parent, entity_type_batch_uri: entity_type_batch_uri, language_code: language_code, update_mask: update_mask), 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_entity_types_client_stub.call_rpc_count - end - end - - def test_batch_delete_entity_types - # 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" - entity_type_names = ["hello world"] - - batch_delete_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_delete_entity_types, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["entity_type_names"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_delete_entity_types_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.batch_delete_entity_types({ parent: parent, entity_type_names: entity_type_names }) 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 - c.batch_delete_entity_types parent: parent, entity_type_names: entity_type_names 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 - c.batch_delete_entity_types ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new(parent: parent, entity_type_names: entity_type_names) 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 - c.batch_delete_entity_types({ parent: parent, entity_type_names: entity_type_names }, 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 - c.batch_delete_entity_types(::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new(parent: parent, entity_type_names: entity_type_names), 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_delete_entity_types_client_stub.call_rpc_count - end - end - - def test_batch_create_entities - # 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" - entities = [{}] - language_code = "hello world" - - batch_create_entities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_create_entities, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Dialogflow::V2::EntityType::Entity, request["entities"].first - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_create_entities_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.batch_create_entities({ parent: parent, entities: entities, language_code: language_code }) 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 - c.batch_create_entities parent: parent, entities: entities, language_code: language_code 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 - c.batch_create_entities ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code) 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 - c.batch_create_entities({ parent: parent, entities: entities, language_code: language_code }, 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 - c.batch_create_entities(::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code), 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_entities_client_stub.call_rpc_count - end - end - - def test_batch_update_entities - # 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" - entities = [{}] - language_code = "hello world" - update_mask = {} - - batch_update_entities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_update_entities, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Dialogflow::V2::EntityType::Entity, request["entities"].first - assert_equal "hello world", request["language_code"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_update_entities_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.batch_update_entities({ parent: parent, entities: entities, language_code: language_code, update_mask: update_mask }) 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 - c.batch_update_entities parent: parent, entities: entities, language_code: language_code, update_mask: update_mask 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 - c.batch_update_entities ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code, update_mask: update_mask) 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 - c.batch_update_entities({ parent: parent, entities: entities, language_code: language_code, update_mask: update_mask }, 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 - c.batch_update_entities(::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new(parent: parent, entities: entities, language_code: language_code, update_mask: update_mask), 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_entities_client_stub.call_rpc_count - end - end - - def test_batch_delete_entities - # 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" - entity_values = ["hello world"] - language_code = "hello world" - - batch_delete_entities_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_delete_entities, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, request - assert_equal "hello world", request["parent"] - assert_equal ["hello world"], request["entity_values"] - assert_equal "hello world", request["language_code"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_delete_entities_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.batch_delete_entities({ parent: parent, entity_values: entity_values, language_code: language_code }) 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 - c.batch_delete_entities parent: parent, entity_values: entity_values, language_code: language_code 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 - c.batch_delete_entities ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new(parent: parent, entity_values: entity_values, language_code: language_code) 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 - c.batch_delete_entities({ parent: parent, entity_values: entity_values, language_code: language_code }, 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 - c.batch_delete_entities(::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new(parent: parent, entity_values: entity_values, language_code: language_code), 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_delete_entities_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::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::EntityTypes::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::Dialogflow::V2::EntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::V2::EntityTypes::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_paths_test.rb deleted file mode 100644 index 9b04be0bfedd..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_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/dialogflow/v2/environments" - -class ::Google::Cloud::Dialogflow::V2::Environments::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_agent_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0" - assert_equal "projects/value0/agent", path - - path = client.agent_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/agent", path - end - end - - def test_environment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.environment_path project: "value0", environment: "value1" - assert_equal "projects/value0/agent/environments/value1", path - - path = client.environment_path project: "value0", location: "value1", environment: "value2" - assert_equal "projects/value0/locations/value1/agent/environments/value2", path - end - end - - def test_fulfillment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.fulfillment_path project: "value0" - assert_equal "projects/value0/agent/fulfillment", path - - path = client.fulfillment_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/agent/fulfillment", path - end - end - - def test_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.version_path project: "value0", version: "value1" - assert_equal "projects/value0/agent/versions/value1", path - - path = client.version_path project: "value0", location: "value1", version: "value2" - assert_equal "projects/value0/locations/value1/agent/versions/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb deleted file mode 100644 index a2374d556b56..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_rest_test.rb +++ /dev/null @@ -1,431 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/environment_pb" -require "google/cloud/dialogflow/v2/environments/rest" - - -class ::Google::Cloud::Dialogflow::V2::Environments::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_environments - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse.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_environments_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_list_environments_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_environments_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_environments({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_environments parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_environments ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.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 - c.list_environments({ 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 - c.list_environments(::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.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_environments_client_stub.call_count - end - end - end - - def test_get_environment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Environment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_environment_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_get_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_environment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_environment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_environment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_environment ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_environment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_environment(::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_environment_client_stub.call_count - end - end - end - - def test_create_environment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Environment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - environment = {} - environment_id = "hello world" - - create_environment_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_create_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_environment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_environment({ parent: parent, environment: environment, environment_id: environment_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_environment parent: parent, environment: environment, environment_id: environment_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_environment ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new(parent: parent, environment: environment, environment_id: environment_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_environment({ parent: parent, environment: environment, environment_id: environment_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_environment(::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new(parent: parent, environment: environment, environment_id: environment_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_environment_client_stub.call_count - end - end - end - - def test_update_environment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Environment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - environment = {} - update_mask = {} - allow_load_to_draft_and_discard_changes = true - - update_environment_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_update_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_environment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_environment({ environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_environment environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_environment ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_environment({ environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_environment(::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_environment_client_stub.call_count - end - end - end - - def test_delete_environment - # 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_environment_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_delete_environment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_environment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_environment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_environment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_environment ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_environment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_environment(::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_environment_client_stub.call_count - end - end - end - - def test_get_environment_history - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::EnvironmentHistory.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" - - get_environment_history_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::Dialogflow::V2::Environments::Rest::ServiceStub.stub :transcode_get_environment_history_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_environment_history_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_environment_history({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_environment_history parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_environment_history ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.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 - c.get_environment_history({ 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 - c.get_environment_history(::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.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, get_environment_history_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::Dialogflow::V2::Environments::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::Dialogflow::V2::Environments::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.rb deleted file mode 100644 index 68d88444600c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/environments_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/v2/environment_pb" -require "google/cloud/dialogflow/v2/environments" - -class ::Google::Cloud::Dialogflow::V2::Environments::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_environments - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_environments_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_environments, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, 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_environments_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_environments({ 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 - c.list_environments 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 - c.list_environments ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.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 - c.list_environments({ 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 - c.list_environments(::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.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_environments_client_stub.call_rpc_count - end - end - - def test_get_environment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Environment.new - grpc_operation = GRPC::ActiveCall::Operation.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_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_environment, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_environment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_environment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_environment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_environment ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_environment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_environment(::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.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_environment_client_stub.call_rpc_count - end - end - - def test_create_environment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Environment.new - grpc_operation = GRPC::ActiveCall::Operation.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" - environment = {} - environment_id = "hello world" - - create_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_environment, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Environment), request["environment"] - assert_equal "hello world", request["environment_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_environment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_environment({ parent: parent, environment: environment, environment_id: environment_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_environment parent: parent, environment: environment, environment_id: environment_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_environment ::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new(parent: parent, environment: environment, environment_id: environment_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_environment({ parent: parent, environment: environment, environment_id: environment_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_environment(::Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new(parent: parent, environment: environment, environment_id: environment_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_environment_client_stub.call_rpc_count - end - end - - def test_update_environment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Environment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - environment = {} - update_mask = {} - allow_load_to_draft_and_discard_changes = true - - update_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_environment, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Environment), request["environment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["allow_load_to_draft_and_discard_changes"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_environment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_environment({ environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_environment environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_environment ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_environment({ environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.update_environment(::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new(environment: environment, update_mask: update_mask, allow_load_to_draft_and_discard_changes: allow_load_to_draft_and_discard_changes), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_environment_client_stub.call_rpc_count - end - end - - def test_delete_environment - # 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_environment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_environment, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_environment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_environment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_environment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_environment ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_environment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_environment(::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.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_environment_client_stub.call_rpc_count - end - end - - def test_get_environment_history - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::EnvironmentHistory.new - grpc_operation = GRPC::ActiveCall::Operation.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" - - get_environment_history_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_environment_history, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest, 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, get_environment_history_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_environment_history({ 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 - c.get_environment_history 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 - c.get_environment_history ::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.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 - c.get_environment_history({ 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 - c.get_environment_history(::Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.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, get_environment_history_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::Dialogflow::V2::Environments::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::Dialogflow::V2::Environments::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::Dialogflow::V2::Environments::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Environments::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_paths_test.rb deleted file mode 100644 index 3c9cb3678141..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_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/dialogflow/v2/fulfillments" - -class ::Google::Cloud::Dialogflow::V2::Fulfillments::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_fulfillment_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.fulfillment_path project: "value0" - assert_equal "projects/value0/agent/fulfillment", path - - path = client.fulfillment_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/agent/fulfillment", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb deleted file mode 100644 index a35cef0b88b6..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_rest_test.rb +++ /dev/null @@ -1,208 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/fulfillment_pb" -require "google/cloud/dialogflow/v2/fulfillments/rest" - - -class ::Google::Cloud::Dialogflow::V2::Fulfillments::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_fulfillment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Fulfillment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_fulfillment_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::Dialogflow::V2::Fulfillments::Rest::ServiceStub.stub :transcode_get_fulfillment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_fulfillment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_fulfillment({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_fulfillment name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_fulfillment ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_fulfillment({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_fulfillment(::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_fulfillment_client_stub.call_count - end - end - end - - def test_update_fulfillment - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Fulfillment.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - fulfillment = {} - update_mask = {} - - update_fulfillment_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::Dialogflow::V2::Fulfillments::Rest::ServiceStub.stub :transcode_update_fulfillment_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_fulfillment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Fulfillments::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_fulfillment({ fulfillment: fulfillment, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_fulfillment fulfillment: fulfillment, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_fulfillment ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new(fulfillment: fulfillment, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_fulfillment({ fulfillment: fulfillment, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_fulfillment(::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new(fulfillment: fulfillment, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_fulfillment_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::Dialogflow::V2::Fulfillments::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::Dialogflow::V2::Fulfillments::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.rb deleted file mode 100644 index 5d8dabcf5b99..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/fulfillments_test.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! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/dialogflow/v2/fulfillment_pb" -require "google/cloud/dialogflow/v2/fulfillments" - -class ::Google::Cloud::Dialogflow::V2::Fulfillments::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_fulfillment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Fulfillment.new - grpc_operation = GRPC::ActiveCall::Operation.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_fulfillment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_fulfillment, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_fulfillment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_fulfillment({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_fulfillment name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_fulfillment ::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_fulfillment({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_fulfillment(::Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.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_fulfillment_client_stub.call_rpc_count - end - end - - def test_update_fulfillment - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Fulfillment.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - fulfillment = {} - update_mask = {} - - update_fulfillment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_fulfillment, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Fulfillment), request["fulfillment"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_fulfillment_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_fulfillment({ fulfillment: fulfillment, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_fulfillment fulfillment: fulfillment, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_fulfillment ::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new(fulfillment: fulfillment, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_fulfillment({ fulfillment: fulfillment, 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 - c.update_fulfillment(::Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new(fulfillment: fulfillment, 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_fulfillment_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::Dialogflow::V2::Fulfillments::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::Dialogflow::V2::Fulfillments::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::Dialogflow::V2::Fulfillments::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Fulfillments::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_operations_test.rb deleted file mode 100644 index 9623271b5940..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_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/dialogflow/v2/generator_evaluation_pb" -require "google/cloud/dialogflow/v2/generator_evaluation_services_pb" -require "google/cloud/dialogflow/v2/generator_evaluations" - -class ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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 - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_paths_test.rb deleted file mode 100644 index dc218735054b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_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/dialogflow/v2/generator_evaluations" - -class ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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_app_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.app_path project: "value0", location: "value1", app: "value2" - assert_equal "projects/value0/locations/value1/apps/value2", path - end - end - - def test_generator_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_path project: "value0", location: "value1", generator: "value2" - assert_equal "projects/value0/locations/value1/generators/value2", path - end - end - - def test_generator_evaluation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_evaluation_path project: "value0", location: "value1", generator: "value2", evaluation: "value3" - assert_equal "projects/value0/locations/value1/generators/value2/evaluations/value3", path - end - end - - def test_tool_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", tool: "value2" - assert_equal "projects/value0/locations/value1/tools/value2", path - - path = client.tool_path project: "value0", location: "value1", app: "value2", tool: "value3" - assert_equal "projects/value0/locations/value1/apps/value2/tools/value3", path - end - end - - def test_toolset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.toolset_path project: "value0", location: "value1", app: "value2", toolset: "value3" - assert_equal "projects/value0/locations/value1/apps/value2/toolsets/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_rest_test.rb deleted file mode 100644 index 84dd661cb81d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_rest_test.rb +++ /dev/null @@ -1,318 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/generator_evaluation_pb" -require "google/cloud/dialogflow/v2/generator_evaluations/rest" - - -class ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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_generator_evaluation - # 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" - generator_evaluation = {} - - create_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.stub :transcode_create_generator_evaluation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_generator_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_generator_evaluation({ parent: parent, generator_evaluation: generator_evaluation }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_generator_evaluation parent: parent, generator_evaluation: generator_evaluation do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_generator_evaluation ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new(parent: parent, generator_evaluation: generator_evaluation) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_generator_evaluation({ parent: parent, generator_evaluation: generator_evaluation }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_generator_evaluation(::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new(parent: parent, generator_evaluation: generator_evaluation), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_generator_evaluation_client_stub.call_count - end - end - end - - def test_get_generator_evaluation - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.stub :transcode_get_generator_evaluation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_generator_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_generator_evaluation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_generator_evaluation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_generator_evaluation ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_generator_evaluation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_generator_evaluation(::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_generator_evaluation_client_stub.call_count - end - end - end - - def test_list_generator_evaluations - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse.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_generator_evaluations_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::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.stub :transcode_list_generator_evaluations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_generator_evaluations_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_generator_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_generator_evaluations parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_generator_evaluations ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.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 - c.list_generator_evaluations({ 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 - c.list_generator_evaluations(::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.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_generator_evaluations_client_stub.call_count - end - end - end - - def test_delete_generator_evaluation - # 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_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::Rest::ServiceStub.stub :transcode_delete_generator_evaluation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_generator_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_generator_evaluation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_generator_evaluation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_generator_evaluation ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_generator_evaluation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_generator_evaluation(::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_test.rb deleted file mode 100644 index 5230c5804a9e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generator_evaluations_test.rb +++ /dev/null @@ -1,366 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/generator_evaluation_pb" -require "google/cloud/dialogflow/v2/generator_evaluations" - -class ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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_generator_evaluation - # 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" - generator_evaluation = {} - - create_generator_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_generator_evaluation, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation), request["generator_evaluation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_generator_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_generator_evaluation({ parent: parent, generator_evaluation: generator_evaluation }) 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 - c.create_generator_evaluation parent: parent, generator_evaluation: generator_evaluation 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 - c.create_generator_evaluation ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new(parent: parent, generator_evaluation: generator_evaluation) 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 - c.create_generator_evaluation({ parent: parent, generator_evaluation: generator_evaluation }, 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 - c.create_generator_evaluation(::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new(parent: parent, generator_evaluation: generator_evaluation), 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_generator_evaluation_client_stub.call_rpc_count - end - end - - def test_get_generator_evaluation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation.new - grpc_operation = GRPC::ActiveCall::Operation.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_generator_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_generator_evaluation, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_generator_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_generator_evaluation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_generator_evaluation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_generator_evaluation ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_generator_evaluation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_generator_evaluation(::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.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_generator_evaluation_client_stub.call_rpc_count - end - end - - def test_list_generator_evaluations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_generator_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_generator_evaluations, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest, 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_generator_evaluations_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_generator_evaluations({ 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 - c.list_generator_evaluations 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 - c.list_generator_evaluations ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.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 - c.list_generator_evaluations({ 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 - c.list_generator_evaluations(::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.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_generator_evaluations_client_stub.call_rpc_count - end - end - - def test_delete_generator_evaluation - # 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_generator_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_generator_evaluation, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_generator_evaluation_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_generator_evaluation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_generator_evaluation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_generator_evaluation ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_generator_evaluation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_generator_evaluation(::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.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_generator_evaluation_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::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::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::Dialogflow::V2::GeneratorEvaluations::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_paths_test.rb deleted file mode 100644 index 5854e75f9f37..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_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/dialogflow/v2/generators" - -class ::Google::Cloud::Dialogflow::V2::Generators::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_app_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.app_path project: "value0", location: "value1", app: "value2" - assert_equal "projects/value0/locations/value1/apps/value2", path - end - end - - def test_generator_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.generator_path project: "value0", location: "value1", generator: "value2" - assert_equal "projects/value0/locations/value1/generators/value2", path - 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::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_tool_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", tool: "value2" - assert_equal "projects/value0/locations/value1/tools/value2", path - - path = client.tool_path project: "value0", location: "value1", app: "value2", tool: "value3" - assert_equal "projects/value0/locations/value1/apps/value2/tools/value3", path - end - end - - def test_toolset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.toolset_path project: "value0", location: "value1", app: "value2", toolset: "value3" - assert_equal "projects/value0/locations/value1/apps/value2/toolsets/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_rest_test.rb deleted file mode 100644 index 3202e981c81e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_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/dialogflow/v2/generator_pb" -require "google/cloud/dialogflow/v2/generators/rest" - - -class ::Google::Cloud::Dialogflow::V2::Generators::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_generator - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Generator.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - generator = {} - generator_id = "hello world" - - create_generator_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_create_generator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_generator_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_generator({ parent: parent, generator: generator, generator_id: generator_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_generator parent: parent, generator: generator, generator_id: generator_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_generator ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new(parent: parent, generator: generator, generator_id: generator_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_generator({ parent: parent, generator: generator, generator_id: generator_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_generator(::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new(parent: parent, generator: generator, generator_id: generator_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_generator_client_stub.call_count - end - end - end - - def test_get_generator - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Generator.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_generator_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_get_generator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_generator_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_generator({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_generator name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_generator ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_generator({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_generator(::Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_generator_client_stub.call_count - end - end - end - - def test_list_generators - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse.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_generators_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_list_generators_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_generators_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_generators({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_generators parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_generators ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.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 - c.list_generators({ 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 - c.list_generators(::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.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_generators_client_stub.call_count - end - end - end - - def test_delete_generator - # 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_generator_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_delete_generator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_generator_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_generator({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_generator name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_generator ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_generator({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_generator(::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_generator_client_stub.call_count - end - end - end - - def test_update_generator - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Generator.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - generator = {} - update_mask = {} - - update_generator_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::Dialogflow::V2::Generators::Rest::ServiceStub.stub :transcode_update_generator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_generator_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_generator({ generator: generator, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_generator generator: generator, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_generator ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new(generator: generator, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_generator({ generator: generator, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_generator(::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new(generator: generator, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_generator_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::Dialogflow::V2::Generators::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::Dialogflow::V2::Generators::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_test.rb deleted file mode 100644 index 4647975e11d0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/generators_test.rb +++ /dev/null @@ -1,409 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/generator_pb" -require "google/cloud/dialogflow/v2/generators" - -class ::Google::Cloud::Dialogflow::V2::Generators::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_generator - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Generator.new - grpc_operation = GRPC::ActiveCall::Operation.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" - generator = {} - generator_id = "hello world" - - create_generator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_generator, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Generator), request["generator"] - assert_equal "hello world", request["generator_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_generator_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_generator({ parent: parent, generator: generator, generator_id: generator_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_generator parent: parent, generator: generator, generator_id: generator_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_generator ::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new(parent: parent, generator: generator, generator_id: generator_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_generator({ parent: parent, generator: generator, generator_id: generator_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_generator(::Google::Cloud::Dialogflow::V2::CreateGeneratorRequest.new(parent: parent, generator: generator, generator_id: generator_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_generator_client_stub.call_rpc_count - end - end - - def test_get_generator - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Generator.new - grpc_operation = GRPC::ActiveCall::Operation.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_generator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_generator, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_generator_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_generator({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_generator name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_generator ::Google::Cloud::Dialogflow::V2::GetGeneratorRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_generator({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_generator(::Google::Cloud::Dialogflow::V2::GetGeneratorRequest.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_generator_client_stub.call_rpc_count - end - end - - def test_list_generators - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListGeneratorsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_generators_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_generators, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest, 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_generators_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_generators({ 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 - c.list_generators 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 - c.list_generators ::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.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 - c.list_generators({ 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 - c.list_generators(::Google::Cloud::Dialogflow::V2::ListGeneratorsRequest.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_generators_client_stub.call_rpc_count - end - end - - def test_delete_generator - # 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_generator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_generator, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_generator_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_generator({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_generator name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_generator ::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_generator({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_generator(::Google::Cloud::Dialogflow::V2::DeleteGeneratorRequest.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_generator_client_stub.call_rpc_count - end - end - - def test_update_generator - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Generator.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - generator = {} - update_mask = {} - - update_generator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_generator, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Generator), request["generator"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_generator_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_generator({ generator: generator, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_generator generator: generator, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_generator ::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new(generator: generator, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_generator({ generator: generator, 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 - c.update_generator(::Google::Cloud::Dialogflow::V2::UpdateGeneratorRequest.new(generator: generator, 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_generator_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::Dialogflow::V2::Generators::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::Dialogflow::V2::Generators::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::Dialogflow::V2::Generators::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Generators::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_operations_test.rb deleted file mode 100644 index 2b3deb5fd6b1..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_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/dialogflow/v2/intent_pb" -require "google/cloud/dialogflow/v2/intent_services_pb" -require "google/cloud/dialogflow/v2/intents" - -class ::Google::Cloud::Dialogflow::V2::Intents::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 - c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::Dialogflow::V2::Intents::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_paths_test.rb deleted file mode 100644 index 3b92d86f739c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_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/dialogflow/v2/intents" - -class ::Google::Cloud::Dialogflow::V2::Intents::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_agent_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0" - assert_equal "projects/value0/agent", path - - path = client.agent_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/agent", path - end - end - - def test_context_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.context_path project: "value0", session: "value1", context: "value2" - assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path - - path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path - - path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" - assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path - - path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/value5", path - end - end - - def test_intent_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intent_path project: "value0", intent: "value1" - assert_equal "projects/value0/agent/intents/value1", path - - path = client.intent_path project: "value0", location: "value1", intent: "value2" - assert_equal "projects/value0/locations/value1/agent/intents/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb deleted file mode 100644 index a69d18c94ba0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_rest_test.rb +++ /dev/null @@ -1,494 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/intent_pb" -require "google/cloud/dialogflow/v2/intents/rest" - - -class ::Google::Cloud::Dialogflow::V2::Intents::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_intents - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListIntentsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - language_code = "hello world" - intent_view = :INTENT_VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_intents_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_list_intents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_intents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_intents({ parent: parent, language_code: language_code, intent_view: intent_view, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_intents parent: parent, language_code: language_code, intent_view: intent_view, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_intents ::Google::Cloud::Dialogflow::V2::ListIntentsRequest.new(parent: parent, language_code: language_code, intent_view: intent_view, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.list_intents({ parent: parent, language_code: language_code, intent_view: intent_view, 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 - c.list_intents(::Google::Cloud::Dialogflow::V2::ListIntentsRequest.new(parent: parent, language_code: language_code, intent_view: intent_view, 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_intents_client_stub.call_count - end - end - end - - def test_get_intent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Intent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - language_code = "hello world" - intent_view = :INTENT_VIEW_UNSPECIFIED - - get_intent_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_get_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_intent({ name: name, language_code: language_code, intent_view: intent_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_intent name: name, language_code: language_code, intent_view: intent_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_intent ::Google::Cloud::Dialogflow::V2::GetIntentRequest.new(name: name, language_code: language_code, intent_view: intent_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_intent({ name: name, language_code: language_code, intent_view: intent_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_intent(::Google::Cloud::Dialogflow::V2::GetIntentRequest.new(name: name, language_code: language_code, intent_view: intent_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_intent_client_stub.call_count - end - end - end - - def test_create_intent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Intent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - intent = {} - language_code = "hello world" - intent_view = :INTENT_VIEW_UNSPECIFIED - - create_intent_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_create_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_intent({ parent: parent, intent: intent, language_code: language_code, intent_view: intent_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_intent parent: parent, intent: intent, language_code: language_code, intent_view: intent_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_intent ::Google::Cloud::Dialogflow::V2::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code, intent_view: intent_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_intent({ parent: parent, intent: intent, language_code: language_code, intent_view: intent_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_intent(::Google::Cloud::Dialogflow::V2::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code, intent_view: intent_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_intent_client_stub.call_count - end - end - end - - def test_update_intent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Intent.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - intent = {} - language_code = "hello world" - update_mask = {} - intent_view = :INTENT_VIEW_UNSPECIFIED - - update_intent_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_update_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_intent intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_intent ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_intent(::Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_intent_client_stub.call_count - end - end - end - - def test_delete_intent - # 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_intent_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_delete_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_intent({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_intent name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_intent ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_intent({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_intent(::Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_intent_client_stub.call_count - end - end - end - - def test_batch_update_intents - # 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" - intent_batch_uri = "hello world" - language_code = "hello world" - update_mask = {} - intent_view = :INTENT_VIEW_UNSPECIFIED - - batch_update_intents_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_batch_update_intents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_update_intents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.batch_update_intents({ parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.batch_update_intents parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.batch_update_intents ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new(parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.batch_update_intents({ parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.batch_update_intents(::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new(parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_update_intents_client_stub.call_count - end - end - end - - def test_batch_delete_intents - # 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" - intents = [{}] - - batch_delete_intents_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::Dialogflow::V2::Intents::Rest::ServiceStub.stub :transcode_batch_delete_intents_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_delete_intents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.batch_delete_intents({ parent: parent, intents: intents }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.batch_delete_intents parent: parent, intents: intents do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.batch_delete_intents ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new(parent: parent, intents: intents) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.batch_delete_intents({ parent: parent, intents: intents }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.batch_delete_intents(::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new(parent: parent, intents: intents), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_delete_intents_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::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb deleted file mode 100644 index 4ae748e5c8c0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/intents_test.rb +++ /dev/null @@ -1,574 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/intent_pb" -require "google/cloud/dialogflow/v2/intents" - -class ::Google::Cloud::Dialogflow::V2::Intents::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_intents - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListIntentsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - language_code = "hello world" - intent_view = :INTENT_VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - - list_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_intents, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListIntentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["language_code"] - assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_intents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_intents({ parent: parent, language_code: language_code, intent_view: intent_view, 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 - c.list_intents parent: parent, language_code: language_code, intent_view: intent_view, 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 - c.list_intents ::Google::Cloud::Dialogflow::V2::ListIntentsRequest.new(parent: parent, language_code: language_code, intent_view: intent_view, 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 - c.list_intents({ parent: parent, language_code: language_code, intent_view: intent_view, 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 - c.list_intents(::Google::Cloud::Dialogflow::V2::ListIntentsRequest.new(parent: parent, language_code: language_code, intent_view: intent_view, 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_intents_client_stub.call_rpc_count - end - end - - def test_get_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Intent.new - grpc_operation = GRPC::ActiveCall::Operation.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" - language_code = "hello world" - intent_view = :INTENT_VIEW_UNSPECIFIED - - get_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_intent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetIntentRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["language_code"] - assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_intent({ name: name, language_code: language_code, intent_view: intent_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_intent name: name, language_code: language_code, intent_view: intent_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_intent ::Google::Cloud::Dialogflow::V2::GetIntentRequest.new(name: name, language_code: language_code, intent_view: intent_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_intent({ name: name, language_code: language_code, intent_view: intent_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_intent(::Google::Cloud::Dialogflow::V2::GetIntentRequest.new(name: name, language_code: language_code, intent_view: intent_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_intent_client_stub.call_rpc_count - end - end - - def test_create_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Intent.new - grpc_operation = GRPC::ActiveCall::Operation.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" - intent = {} - language_code = "hello world" - intent_view = :INTENT_VIEW_UNSPECIFIED - - create_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_intent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateIntentRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Intent), request["intent"] - assert_equal "hello world", request["language_code"] - assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_intent({ parent: parent, intent: intent, language_code: language_code, intent_view: intent_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_intent parent: parent, intent: intent, language_code: language_code, intent_view: intent_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_intent ::Google::Cloud::Dialogflow::V2::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code, intent_view: intent_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_intent({ parent: parent, intent: intent, language_code: language_code, intent_view: intent_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_intent(::Google::Cloud::Dialogflow::V2::CreateIntentRequest.new(parent: parent, intent: intent, language_code: language_code, intent_view: intent_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_intent_client_stub.call_rpc_count - end - end - - def test_update_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Intent.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - intent = {} - language_code = "hello world" - update_mask = {} - intent_view = :INTENT_VIEW_UNSPECIFIED - - update_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_intent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Intent), request["intent"] - assert_equal "hello world", request["language_code"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_intent intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_intent ::Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_intent({ intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.update_intent(::Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new(intent: intent, language_code: language_code, update_mask: update_mask, intent_view: intent_view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_intent_client_stub.call_rpc_count - end - end - - def test_delete_intent - # 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_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_intent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_intent({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_intent name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_intent ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_intent({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_intent(::Google::Cloud::Dialogflow::V2::DeleteIntentRequest.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_intent_client_stub.call_rpc_count - end - end - - def test_batch_update_intents - # 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" - intent_batch_uri = "hello world" - language_code = "hello world" - update_mask = {} - intent_view = :INTENT_VIEW_UNSPECIFIED - - batch_update_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_update_intents, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["intent_batch_uri"] - assert_equal :intent_batch_uri, request.intent_batch - assert_equal "hello world", request["language_code"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal :INTENT_VIEW_UNSPECIFIED, request["intent_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_update_intents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.batch_update_intents({ parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view }) 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 - c.batch_update_intents parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view 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 - c.batch_update_intents ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new(parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view) 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 - c.batch_update_intents({ parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view }, 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 - c.batch_update_intents(::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new(parent: parent, intent_batch_uri: intent_batch_uri, language_code: language_code, update_mask: update_mask, intent_view: intent_view), 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_intents_client_stub.call_rpc_count - end - end - - def test_batch_delete_intents - # 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" - intents = [{}] - - batch_delete_intents_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_delete_intents, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::Dialogflow::V2::Intent, request["intents"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_delete_intents_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.batch_delete_intents({ parent: parent, intents: intents }) 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 - c.batch_delete_intents parent: parent, intents: intents 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 - c.batch_delete_intents ::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new(parent: parent, intents: intents) 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 - c.batch_delete_intents({ parent: parent, intents: intents }, 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 - c.batch_delete_intents(::Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new(parent: parent, intents: intents), 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_delete_intents_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::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Intents::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::Dialogflow::V2::Intents::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Dialogflow::V2::Intents::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb deleted file mode 100644 index 4161ee267dcc..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_paths_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/knowledge_bases" - -class ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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_knowledge_base_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.knowledge_base_path project: "value0", knowledge_base: "value1" - assert_equal "projects/value0/knowledgeBases/value1", path - - path = client.knowledge_base_path project: "value0", location: "value1", knowledge_base: "value2" - assert_equal "projects/value0/locations/value1/knowledgeBases/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::Dialogflow::V2::KnowledgeBases::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_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::Dialogflow::V2::KnowledgeBases::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-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_rest_test.rb deleted file mode 100644 index 69bad67da39d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_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/dialogflow/v2/knowledge_base_pb" -require "google/cloud/dialogflow/v2/knowledge_bases/rest" - - -class ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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_knowledge_bases - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse.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_knowledge_bases_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_list_knowledge_bases_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_knowledge_bases_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_knowledge_bases({ 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 - c.list_knowledge_bases 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 - c.list_knowledge_bases ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.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 - c.list_knowledge_bases({ 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 - c.list_knowledge_bases(::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.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_knowledge_bases_client_stub.call_count - end - end - end - - def test_get_knowledge_base - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_knowledge_base_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_get_knowledge_base_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_knowledge_base_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_knowledge_base({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_knowledge_base name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_knowledge_base ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_knowledge_base({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_knowledge_base(::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_knowledge_base_client_stub.call_count - end - end - end - - def test_create_knowledge_base - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - knowledge_base = {} - - create_knowledge_base_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_create_knowledge_base_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_knowledge_base_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_knowledge_base({ parent: parent, knowledge_base: knowledge_base }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_knowledge_base parent: parent, knowledge_base: knowledge_base do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_knowledge_base ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new(parent: parent, knowledge_base: knowledge_base) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_knowledge_base({ parent: parent, knowledge_base: knowledge_base }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_knowledge_base(::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new(parent: parent, knowledge_base: knowledge_base), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_knowledge_base_client_stub.call_count - end - end - end - - def test_delete_knowledge_base - # 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" - force = true - - delete_knowledge_base_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_delete_knowledge_base_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_knowledge_base_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_knowledge_base({ name: name, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_knowledge_base name: name, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_knowledge_base ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new(name: name, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_knowledge_base({ name: name, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_knowledge_base(::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new(name: name, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_knowledge_base_client_stub.call_count - end - end - end - - def test_update_knowledge_base - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - knowledge_base = {} - update_mask = {} - - update_knowledge_base_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::Dialogflow::V2::KnowledgeBases::Rest::ServiceStub.stub :transcode_update_knowledge_base_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_knowledge_base_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_knowledge_base({ knowledge_base: knowledge_base, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_knowledge_base knowledge_base: knowledge_base, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_knowledge_base ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new(knowledge_base: knowledge_base, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_knowledge_base({ knowledge_base: knowledge_base, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_knowledge_base(::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new(knowledge_base: knowledge_base, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_knowledge_base_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::Dialogflow::V2::KnowledgeBases::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::Dialogflow::V2::KnowledgeBases::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_test.rb deleted file mode 100644 index 62fb20c1c93b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/knowledge_bases_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/dialogflow/v2/knowledge_base_pb" -require "google/cloud/dialogflow/v2/knowledge_bases" - -class ::Google::Cloud::Dialogflow::V2::KnowledgeBases::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_knowledge_bases - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_knowledge_bases_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_knowledge_bases, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest, 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_knowledge_bases_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_knowledge_bases({ 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 - c.list_knowledge_bases 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 - c.list_knowledge_bases ::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.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 - c.list_knowledge_bases({ 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 - c.list_knowledge_bases(::Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.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_knowledge_bases_client_stub.call_rpc_count - end - end - - def test_get_knowledge_base - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new - grpc_operation = GRPC::ActiveCall::Operation.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_knowledge_base_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_knowledge_base, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_knowledge_base_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_knowledge_base({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_knowledge_base name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_knowledge_base ::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_knowledge_base({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_knowledge_base(::Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.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_knowledge_base_client_stub.call_rpc_count - end - end - - def test_create_knowledge_base - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new - grpc_operation = GRPC::ActiveCall::Operation.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" - knowledge_base = {} - - create_knowledge_base_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_knowledge_base, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::KnowledgeBase), request["knowledge_base"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_knowledge_base_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_knowledge_base({ parent: parent, knowledge_base: knowledge_base }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_knowledge_base parent: parent, knowledge_base: knowledge_base do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_knowledge_base ::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new(parent: parent, knowledge_base: knowledge_base) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_knowledge_base({ parent: parent, knowledge_base: knowledge_base }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_knowledge_base(::Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new(parent: parent, knowledge_base: knowledge_base), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_knowledge_base_client_stub.call_rpc_count - end - end - - def test_delete_knowledge_base - # 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" - force = true - - delete_knowledge_base_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_knowledge_base, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_knowledge_base_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_knowledge_base({ name: name, force: force }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_knowledge_base name: name, force: force do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_knowledge_base ::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new(name: name, force: force) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_knowledge_base({ name: name, force: force }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_knowledge_base(::Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new(name: name, force: force), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_knowledge_base_client_stub.call_rpc_count - end - end - - def test_update_knowledge_base - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::KnowledgeBase.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - knowledge_base = {} - update_mask = {} - - update_knowledge_base_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_knowledge_base, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::KnowledgeBase), request["knowledge_base"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_knowledge_base_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_knowledge_base({ knowledge_base: knowledge_base, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_knowledge_base knowledge_base: knowledge_base, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_knowledge_base ::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new(knowledge_base: knowledge_base, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_knowledge_base({ knowledge_base: knowledge_base, 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 - c.update_knowledge_base(::Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new(knowledge_base: knowledge_base, 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_knowledge_base_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::Dialogflow::V2::KnowledgeBases::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::Dialogflow::V2::KnowledgeBases::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::Dialogflow::V2::KnowledgeBases::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb deleted file mode 100644 index be8e08f8567b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_paths_test.rb +++ /dev/null @@ -1,142 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/participants" - -class ::Google::Cloud::Dialogflow::V2::Participants::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_context_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.context_path project: "value0", session: "value1", context: "value2" - assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path - - path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path - - path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" - assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path - - path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/value5", 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::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.conversation_path project: "value0", conversation: "value1" - assert_equal "projects/value0/conversations/value1", path - - path = client.conversation_path project: "value0", location: "value1", conversation: "value2" - assert_equal "projects/value0/locations/value1/conversations/value2", path - end - end - - def test_message_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.message_path project: "value0", conversation: "value1", message: "value2" - assert_equal "projects/value0/conversations/value1/messages/value2", path - - path = client.message_path project: "value0", location: "value1", conversation: "value2", message: "value3" - assert_equal "projects/value0/locations/value1/conversations/value2/messages/value3", path - end - end - - def test_participant_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.participant_path project: "value0", conversation: "value1", participant: "value2" - assert_equal "projects/value0/conversations/value1/participants/value2", path - - path = client.participant_path project: "value0", location: "value1", conversation: "value2", participant: "value3" - assert_equal "projects/value0/locations/value1/conversations/value2/participants/value3", path - end - end - - def test_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", path - end - end - - def test_session_entity_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_entity_type_path project: "value0", session: "value1", entity_type: "value2" - assert_equal "projects/value0/agent/sessions/value1/entityTypes/value2", path - - path = client.session_entity_type_path project: "value0", environment: "value1", user: "value2", session: "value3", entity_type: "value4" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/entityTypes/value4", path - - path = client.session_entity_type_path project: "value0", location: "value1", session: "value2", entity_type: "value3" - assert_equal "projects/value0/locations/value1/agent/sessions/value2/entityTypes/value3", path - - path = client.session_entity_type_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", entity_type: "value5" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/entityTypes/value5", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb deleted file mode 100644 index a469b23ae7f3..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_rest_test.rb +++ /dev/null @@ -1,607 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/participant_pb" -require "google/cloud/dialogflow/v2/participants/rest" - - -class ::Google::Cloud::Dialogflow::V2::Participants::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_participant - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Participant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - participant = {} - - create_participant_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_create_participant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_participant_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_participant({ parent: parent, participant: participant }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_participant parent: parent, participant: participant do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_participant ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new(parent: parent, participant: participant) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_participant({ parent: parent, participant: participant }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_participant(::Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new(parent: parent, participant: participant), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_participant_client_stub.call_count - end - end - end - - def test_get_participant - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Participant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_participant_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_get_participant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_participant_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_participant({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_participant name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_participant ::Google::Cloud::Dialogflow::V2::GetParticipantRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_participant({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_participant(::Google::Cloud::Dialogflow::V2::GetParticipantRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_participant_client_stub.call_count - end - end - end - - def test_list_participants - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListParticipantsResponse.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_participants_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_list_participants_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_participants_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_participants({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_participants parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_participants ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest.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 - c.list_participants({ 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 - c.list_participants(::Google::Cloud::Dialogflow::V2::ListParticipantsRequest.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_participants_client_stub.call_count - end - end - end - - def test_update_participant - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Participant.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - participant = {} - update_mask = {} - - update_participant_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_update_participant_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_participant_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_participant({ participant: participant, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_participant participant: participant, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_participant ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new(participant: participant, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_participant({ participant: participant, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_participant(::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new(participant: participant, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_participant_client_stub.call_count - end - end - end - - def test_analyze_content - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - participant = "hello world" - text_input = {} - reply_audio_config = {} - query_params = {} - assist_query_params = {} - cx_parameters = {} - request_id = "hello world" - - analyze_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_analyze_content_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, analyze_content_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.analyze_content({ participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.analyze_content participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.analyze_content ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new(participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.analyze_content({ participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.analyze_content(::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new(participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, analyze_content_client_stub.call_count - end - end - end - - def test_suggest_articles - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - latest_message = "hello world" - context_size = 42 - assist_query_params = {} - - suggest_articles_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_suggest_articles_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, suggest_articles_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.suggest_articles({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.suggest_articles parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.suggest_articles ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.suggest_articles({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.suggest_articles(::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, suggest_articles_client_stub.call_count - end - end - end - - def test_suggest_faq_answers - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - latest_message = "hello world" - context_size = 42 - assist_query_params = {} - - suggest_faq_answers_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_suggest_faq_answers_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, suggest_faq_answers_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.suggest_faq_answers({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.suggest_faq_answers parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.suggest_faq_answers ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.suggest_faq_answers({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.suggest_faq_answers(::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, suggest_faq_answers_client_stub.call_count - end - end - end - - def test_suggest_smart_replies - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - current_text_input = {} - latest_message = "hello world" - context_size = 42 - - suggest_smart_replies_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_suggest_smart_replies_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, suggest_smart_replies_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.suggest_smart_replies({ parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.suggest_smart_replies parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.suggest_smart_replies ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new(parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.suggest_smart_replies({ parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.suggest_smart_replies(::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new(parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, suggest_smart_replies_client_stub.call_count - end - end - end - - def test_suggest_knowledge_assist - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - latest_message = "hello world" - context_size = 42 - previous_suggested_query = "hello world" - - suggest_knowledge_assist_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::Dialogflow::V2::Participants::Rest::ServiceStub.stub :transcode_suggest_knowledge_assist_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, suggest_knowledge_assist_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.suggest_knowledge_assist({ parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.suggest_knowledge_assist parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.suggest_knowledge_assist ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.suggest_knowledge_assist({ parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.suggest_knowledge_assist(::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, suggest_knowledge_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::Dialogflow::V2::Participants::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::Dialogflow::V2::Participants::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb deleted file mode 100644 index 758d586e2abf..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb +++ /dev/null @@ -1,786 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/participant_pb" -require "google/cloud/dialogflow/v2/participants" - -class ::Google::Cloud::Dialogflow::V2::Participants::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_participant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Participant.new - grpc_operation = GRPC::ActiveCall::Operation.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" - participant = {} - - create_participant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_participant, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Participant), request["participant"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_participant_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_participant({ parent: parent, participant: participant }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_participant parent: parent, participant: participant do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_participant ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new(parent: parent, participant: participant) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_participant({ parent: parent, participant: participant }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_participant(::Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new(parent: parent, participant: participant), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_participant_client_stub.call_rpc_count - end - end - - def test_get_participant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Participant.new - grpc_operation = GRPC::ActiveCall::Operation.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_participant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_participant, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetParticipantRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_participant_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_participant({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_participant name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_participant ::Google::Cloud::Dialogflow::V2::GetParticipantRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_participant({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_participant(::Google::Cloud::Dialogflow::V2::GetParticipantRequest.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_participant_client_stub.call_rpc_count - end - end - - def test_list_participants - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListParticipantsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_participants_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_participants, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, 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_participants_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_participants({ 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 - c.list_participants 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 - c.list_participants ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest.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 - c.list_participants({ 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 - c.list_participants(::Google::Cloud::Dialogflow::V2::ListParticipantsRequest.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_participants_client_stub.call_rpc_count - end - end - - def test_update_participant - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Participant.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - participant = {} - update_mask = {} - - update_participant_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_participant, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Participant), request["participant"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_participant_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_participant({ participant: participant, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_participant participant: participant, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_participant ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new(participant: participant, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_participant({ participant: participant, 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 - c.update_participant(::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new(participant: participant, 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_participant_client_stub.call_rpc_count - end - end - - def test_analyze_content - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - participant = "hello world" - text_input = {} - reply_audio_config = {} - query_params = {} - assist_query_params = {} - cx_parameters = {} - request_id = "hello world" - - analyze_content_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :analyze_content, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, request - assert_equal "hello world", request["participant"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::TextInput), request["text_input"] - assert_equal :text_input, request.input - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::OutputAudioConfig), request["reply_audio_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryParameters), request["query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), request["assist_query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), request["cx_parameters"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, analyze_content_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.analyze_content({ participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.analyze_content participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.analyze_content ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new(participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.analyze_content({ participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.analyze_content(::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new(participant: participant, text_input: text_input, reply_audio_config: reply_audio_config, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, analyze_content_client_stub.call_rpc_count - end - end - - def test_streaming_analyze_content - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse.new - grpc_operation = GRPC::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. - participant = "hello world" - audio_config = {} - reply_audio_config = {} - input_audio = "hello world" - query_params = {} - assist_query_params = {} - cx_parameters = {} - enable_extended_streaming = true - enable_partial_automated_agent_reply = true - output_multiple_utterances = true - enable_debugging_info = true - - streaming_analyze_content_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_analyze_content, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, streaming_analyze_content_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info - enum_input = [request_hash, request_proto].to_enum - c.streaming_analyze_content enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info - stream_input = Gapic::StreamInput.new - c.streaming_analyze_content stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, 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 = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info - enum_input = [request_hash, request_proto].to_enum - c.streaming_analyze_content enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_extended_streaming: enable_extended_streaming, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply, output_multiple_utterances: output_multiple_utterances, enable_debugging_info: enable_debugging_info - stream_input = Gapic::StreamInput.new - c.streaming_analyze_content stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, 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, streaming_analyze_content_client_stub.call_rpc_count - streaming_analyze_content_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest, r - assert_equal "hello world", r["participant"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::InputAudioConfig), r["audio_config"] - assert_equal :audio_config, r.config - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::OutputAudioConfig), r["reply_audio_config"] - assert_equal "hello world", r["input_audio"] - assert_equal :input_audio, r.input - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryParameters), r["query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), r["assist_query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), r["cx_parameters"] - assert_equal true, r["enable_extended_streaming"] - assert_equal true, r["enable_partial_automated_agent_reply"] - assert_equal true, r["output_multiple_utterances"] - assert_equal true, r["enable_debugging_info"] - end - end - end - end - - def test_suggest_articles - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - latest_message = "hello world" - context_size = 42 - assist_query_params = {} - - suggest_articles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :suggest_articles, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["latest_message"] - assert_equal 42, request["context_size"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), request["assist_query_params"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, suggest_articles_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.suggest_articles({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.suggest_articles parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.suggest_articles ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.suggest_articles({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.suggest_articles(::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, suggest_articles_client_stub.call_rpc_count - end - end - - def test_suggest_faq_answers - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - latest_message = "hello world" - context_size = 42 - assist_query_params = {} - - suggest_faq_answers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :suggest_faq_answers, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["latest_message"] - assert_equal 42, request["context_size"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), request["assist_query_params"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, suggest_faq_answers_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.suggest_faq_answers({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.suggest_faq_answers parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.suggest_faq_answers ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.suggest_faq_answers({ parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.suggest_faq_answers(::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, assist_query_params: assist_query_params), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, suggest_faq_answers_client_stub.call_rpc_count - end - end - - def test_suggest_smart_replies - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - current_text_input = {} - latest_message = "hello world" - context_size = 42 - - suggest_smart_replies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :suggest_smart_replies, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::TextInput), request["current_text_input"] - assert_equal "hello world", request["latest_message"] - assert_equal 42, request["context_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, suggest_smart_replies_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.suggest_smart_replies({ parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.suggest_smart_replies parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.suggest_smart_replies ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new(parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.suggest_smart_replies({ parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.suggest_smart_replies(::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new(parent: parent, current_text_input: current_text_input, latest_message: latest_message, context_size: context_size), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, suggest_smart_replies_client_stub.call_rpc_count - end - end - - def test_suggest_knowledge_assist - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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" - latest_message = "hello world" - context_size = 42 - previous_suggested_query = "hello world" - - suggest_knowledge_assist_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :suggest_knowledge_assist, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["latest_message"] - assert_equal 42, request["context_size"] - assert_equal "hello world", request["previous_suggested_query"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, suggest_knowledge_assist_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.suggest_knowledge_assist({ parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.suggest_knowledge_assist parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.suggest_knowledge_assist ::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.suggest_knowledge_assist({ parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.suggest_knowledge_assist(::Google::Cloud::Dialogflow::V2::SuggestKnowledgeAssistRequest.new(parent: parent, latest_message: latest_message, context_size: context_size, previous_suggested_query: previous_suggested_query), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, suggest_knowledge_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::Dialogflow::V2::Participants::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::Dialogflow::V2::Participants::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::Dialogflow::V2::Participants::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Participants::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_paths_test.rb deleted file mode 100644 index bca72ee4ce4d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_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/dialogflow/v2/session_entity_types" - -class ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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_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::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", session: "value1" - assert_equal "projects/value0/agent/sessions/value1", path - - path = client.session_path project: "value0", environment: "value1", user: "value2", session: "value3" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3", path - - path = client.session_path project: "value0", location: "value1", session: "value2" - assert_equal "projects/value0/locations/value1/agent/sessions/value2", path - - path = client.session_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4", path - end - end - - def test_session_entity_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_entity_type_path project: "value0", session: "value1", entity_type: "value2" - assert_equal "projects/value0/agent/sessions/value1/entityTypes/value2", path - - path = client.session_entity_type_path project: "value0", environment: "value1", user: "value2", session: "value3", entity_type: "value4" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/entityTypes/value4", path - - path = client.session_entity_type_path project: "value0", location: "value1", session: "value2", entity_type: "value3" - assert_equal "projects/value0/locations/value1/agent/sessions/value2/entityTypes/value3", path - - path = client.session_entity_type_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", entity_type: "value5" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/entityTypes/value5", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb deleted file mode 100644 index f6deec2a6f55..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_rest_test.rb +++ /dev/null @@ -1,373 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/session_entity_type_pb" -require "google/cloud/dialogflow/v2/session_entity_types/rest" - - -class ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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_session_entity_types - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse.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_session_entity_types_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_list_session_entity_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_session_entity_types_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_session_entity_types({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_session_entity_types parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_session_entity_types ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.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 - c.list_session_entity_types({ 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 - c.list_session_entity_types(::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.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_session_entity_types_client_stub.call_count - end - end - end - - def test_get_session_entity_type - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_session_entity_type_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_get_session_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_session_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_session_entity_type({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_session_entity_type name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_session_entity_type ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_session_entity_type({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_session_entity_type(::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_session_entity_type_client_stub.call_count - end - end - end - - def test_create_session_entity_type - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - session_entity_type = {} - - create_session_entity_type_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_create_session_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_session_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_session_entity_type({ parent: parent, session_entity_type: session_entity_type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_session_entity_type parent: parent, session_entity_type: session_entity_type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_session_entity_type ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new(parent: parent, session_entity_type: session_entity_type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_session_entity_type({ parent: parent, session_entity_type: session_entity_type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_session_entity_type(::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new(parent: parent, session_entity_type: session_entity_type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_session_entity_type_client_stub.call_count - end - end - end - - def test_update_session_entity_type - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - session_entity_type = {} - update_mask = {} - - update_session_entity_type_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_update_session_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_session_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_session_entity_type({ session_entity_type: session_entity_type, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_session_entity_type session_entity_type: session_entity_type, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_session_entity_type ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new(session_entity_type: session_entity_type, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_session_entity_type({ session_entity_type: session_entity_type, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_session_entity_type(::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new(session_entity_type: session_entity_type, 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_entity_type_client_stub.call_count - end - end - end - - def test_delete_session_entity_type - # 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_entity_type_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::Dialogflow::V2::SessionEntityTypes::Rest::ServiceStub.stub :transcode_delete_session_entity_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_session_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_session_entity_type({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_session_entity_type name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_session_entity_type ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_session_entity_type({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_session_entity_type(::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_session_entity_type_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::Dialogflow::V2::SessionEntityTypes::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::Dialogflow::V2::SessionEntityTypes::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb deleted file mode 100644 index b82fb67220d0..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/session_entity_types_test.rb +++ /dev/null @@ -1,407 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/session_entity_type_pb" -require "google/cloud/dialogflow/v2/session_entity_types" - -class ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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_session_entity_types - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_session_entity_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_session_entity_types, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest, 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_session_entity_types_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_session_entity_types({ 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 - c.list_session_entity_types 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 - c.list_session_entity_types ::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.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 - c.list_session_entity_types({ 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 - c.list_session_entity_types(::Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.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_session_entity_types_client_stub.call_rpc_count - end - end - - def test_get_session_entity_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new - grpc_operation = GRPC::ActiveCall::Operation.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_session_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_session_entity_type, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_session_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_session_entity_type({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_session_entity_type name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_session_entity_type ::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_session_entity_type({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_session_entity_type(::Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.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_session_entity_type_client_stub.call_rpc_count - end - end - - def test_create_session_entity_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new - grpc_operation = GRPC::ActiveCall::Operation.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_entity_type = {} - - create_session_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_session_entity_type, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SessionEntityType), request["session_entity_type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_session_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_session_entity_type({ parent: parent, session_entity_type: session_entity_type }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_session_entity_type parent: parent, session_entity_type: session_entity_type do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_session_entity_type ::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new(parent: parent, session_entity_type: session_entity_type) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_session_entity_type({ parent: parent, session_entity_type: session_entity_type }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_session_entity_type(::Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new(parent: parent, session_entity_type: session_entity_type), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_session_entity_type_client_stub.call_rpc_count - end - end - - def test_update_session_entity_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SessionEntityType.new - grpc_operation = GRPC::ActiveCall::Operation.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_entity_type = {} - update_mask = {} - - update_session_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_session_entity_type, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SessionEntityType), request["session_entity_type"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_session_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_session_entity_type({ session_entity_type: session_entity_type, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_session_entity_type session_entity_type: session_entity_type, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_session_entity_type ::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new(session_entity_type: session_entity_type, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_session_entity_type({ session_entity_type: session_entity_type, 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 - c.update_session_entity_type(::Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new(session_entity_type: session_entity_type, 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_entity_type_client_stub.call_rpc_count - end - end - - def test_delete_session_entity_type - # 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_entity_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_session_entity_type, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_session_entity_type_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_session_entity_type({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_session_entity_type name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_session_entity_type ::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_session_entity_type({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_session_entity_type(::Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.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_entity_type_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::Dialogflow::V2::SessionEntityTypes::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::Dialogflow::V2::SessionEntityTypes::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::Dialogflow::V2::SessionEntityTypes::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb deleted file mode 100644 index dcecf281b3ff..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_paths_test.rb +++ /dev/null @@ -1,118 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/sessions" - -class ::Google::Cloud::Dialogflow::V2::Sessions::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_context_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.context_path project: "value0", session: "value1", context: "value2" - assert_equal "projects/value0/agent/sessions/value1/contexts/value2", path - - path = client.context_path project: "value0", environment: "value1", user: "value2", session: "value3", context: "value4" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/contexts/value4", path - - path = client.context_path project: "value0", location: "value1", session: "value2", context: "value3" - assert_equal "projects/value0/locations/value1/agent/sessions/value2/contexts/value3", path - - path = client.context_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", context: "value5" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/contexts/value5", path - end - end - - def test_phrase_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.phrase_set_path project: "value0", location: "value1", phrase_set: "value2" - assert_equal "projects/value0/locations/value1/phraseSets/value2", 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::Dialogflow::V2::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_path project: "value0", session: "value1" - assert_equal "projects/value0/agent/sessions/value1", path - - path = client.session_path project: "value0", environment: "value1", user: "value2", session: "value3" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3", path - - path = client.session_path project: "value0", location: "value1", session: "value2" - assert_equal "projects/value0/locations/value1/agent/sessions/value2", path - - path = client.session_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4", path - end - end - - def test_session_entity_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.session_entity_type_path project: "value0", session: "value1", entity_type: "value2" - assert_equal "projects/value0/agent/sessions/value1/entityTypes/value2", path - - path = client.session_entity_type_path project: "value0", environment: "value1", user: "value2", session: "value3", entity_type: "value4" - assert_equal "projects/value0/agent/environments/value1/users/value2/sessions/value3/entityTypes/value4", path - - path = client.session_entity_type_path project: "value0", location: "value1", session: "value2", entity_type: "value3" - assert_equal "projects/value0/locations/value1/agent/sessions/value2/entityTypes/value3", path - - path = client.session_entity_type_path project: "value0", location: "value1", environment: "value2", user: "value3", session: "value4", entity_type: "value5" - assert_equal "projects/value0/locations/value1/agent/environments/value2/users/value3/sessions/value4/entityTypes/value5", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_rest_test.rb deleted file mode 100644 index e69255c6c078..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_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/dialogflow/v2/session_pb" -require "google/cloud/dialogflow/v2/sessions/rest" - - -class ::Google::Cloud::Dialogflow::V2::Sessions::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_detect_intent - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::DetectIntentResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - session = "hello world" - query_params = {} - query_input = {} - output_audio_config = {} - output_audio_config_mask = {} - input_audio = "hello world" - - detect_intent_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::Dialogflow::V2::Sessions::Rest::ServiceStub.stub :transcode_detect_intent_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, detect_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Sessions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.detect_intent ::Google::Cloud::Dialogflow::V2::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.detect_intent(::Google::Cloud::Dialogflow::V2::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, detect_intent_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::Dialogflow::V2::Sessions::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::Dialogflow::V2::Sessions::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb deleted file mode 100644 index 5d8620b0372e..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sessions_test.rb +++ /dev/null @@ -1,274 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/session_pb" -require "google/cloud/dialogflow/v2/sessions" - -class ::Google::Cloud::Dialogflow::V2::Sessions::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_detect_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::DetectIntentResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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 = "hello world" - query_params = {} - query_input = {} - output_audio_config = {} - output_audio_config_mask = {} - input_audio = "hello world" - - detect_intent_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :detect_intent, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DetectIntentRequest, request - assert_equal "hello world", request["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryParameters), request["query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryInput), request["query_input"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::OutputAudioConfig), request["output_audio_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["output_audio_config_mask"] - assert_equal "hello world", request["input_audio"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, detect_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.detect_intent session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.detect_intent ::Google::Cloud::Dialogflow::V2::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.detect_intent({ session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.detect_intent(::Google::Cloud::Dialogflow::V2::DetectIntentRequest.new(session: session, query_params: query_params, query_input: query_input, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, detect_intent_client_stub.call_rpc_count - end - end - - def test_streaming_detect_intent - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse.new - grpc_operation = GRPC::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. - session = "hello world" - query_params = {} - query_input = {} - single_utterance = true - output_audio_config = {} - output_audio_config_mask = {} - input_audio = "hello world" - enable_debugging_info = true - - streaming_detect_intent_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :streaming_detect_intent, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, streaming_detect_intent_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info - enum_input = [request_hash, request_proto].to_enum - c.streaming_detect_intent enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info - stream_input = Gapic::StreamInput.new - c.streaming_detect_intent stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse, 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 = { session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info - enum_input = [request_hash, request_proto].to_enum - c.streaming_detect_intent enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info } - request_proto = ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new session: session, query_params: query_params, query_input: query_input, single_utterance: single_utterance, output_audio_config: output_audio_config, output_audio_config_mask: output_audio_config_mask, input_audio: input_audio, enable_debugging_info: enable_debugging_info - stream_input = Gapic::StreamInput.new - c.streaming_detect_intent stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse, 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, streaming_detect_intent_client_stub.call_rpc_count - streaming_detect_intent_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest, r - assert_equal "hello world", r["session"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryParameters), r["query_params"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryInput), r["query_input"] - assert_equal true, r["single_utterance"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::OutputAudioConfig), r["output_audio_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), r["output_audio_config_mask"] - assert_equal "hello world", r["input_audio"] - assert_equal true, r["enable_debugging_info"] - end - end - 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::Dialogflow::V2::Sessions::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::Dialogflow::V2::Sessions::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::Dialogflow::V2::Sessions::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Sessions::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_paths_test.rb deleted file mode 100644 index b23ff6b61d6b..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_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/dialogflow/v2/sip_trunks" - -class ::Google::Cloud::Dialogflow::V2::SipTrunks::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_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::Dialogflow::V2::SipTrunks::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_sip_trunk_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.sip_trunk_path project: "value0", location: "value1", siptrunk: "value2" - assert_equal "projects/value0/locations/value1/sipTrunks/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_rest_test.rb deleted file mode 100644 index 4686a0bf59c8..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_rest_test.rb +++ /dev/null @@ -1,373 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/sip_trunk_pb" -require "google/cloud/dialogflow/v2/sip_trunks/rest" - - -class ::Google::Cloud::Dialogflow::V2::SipTrunks::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_sip_trunk - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SipTrunk.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - sip_trunk = {} - - create_sip_trunk_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_create_sip_trunk_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_sip_trunk_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_sip_trunk({ parent: parent, sip_trunk: sip_trunk }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_sip_trunk parent: parent, sip_trunk: sip_trunk do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_sip_trunk ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new(parent: parent, sip_trunk: sip_trunk) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_sip_trunk({ parent: parent, sip_trunk: sip_trunk }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_sip_trunk(::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new(parent: parent, sip_trunk: sip_trunk), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_sip_trunk_client_stub.call_count - end - end - end - - def test_delete_sip_trunk - # 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_sip_trunk_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_delete_sip_trunk_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_sip_trunk_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_sip_trunk({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_sip_trunk name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_sip_trunk ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_sip_trunk({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_sip_trunk(::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_sip_trunk_client_stub.call_count - end - end - end - - def test_list_sip_trunks - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse.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_sip_trunks_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_list_sip_trunks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_sip_trunks_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_sip_trunks({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_sip_trunks parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_sip_trunks ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.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 - c.list_sip_trunks({ 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 - c.list_sip_trunks(::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.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_sip_trunks_client_stub.call_count - end - end - end - - def test_get_sip_trunk - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SipTrunk.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_sip_trunk_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_get_sip_trunk_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_sip_trunk_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_sip_trunk({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_sip_trunk name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_sip_trunk ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_sip_trunk({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_sip_trunk(::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_sip_trunk_client_stub.call_count - end - end - end - - def test_update_sip_trunk - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::SipTrunk.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - sip_trunk = {} - update_mask = {} - - update_sip_trunk_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::Dialogflow::V2::SipTrunks::Rest::ServiceStub.stub :transcode_update_sip_trunk_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_sip_trunk_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_sip_trunk({ sip_trunk: sip_trunk, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_sip_trunk sip_trunk: sip_trunk, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_sip_trunk ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new(sip_trunk: sip_trunk, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_sip_trunk({ sip_trunk: sip_trunk, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_sip_trunk(::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new(sip_trunk: sip_trunk, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_sip_trunk_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::Dialogflow::V2::SipTrunks::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::Dialogflow::V2::SipTrunks::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_test.rb deleted file mode 100644 index faa605dde435..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/sip_trunks_test.rb +++ /dev/null @@ -1,407 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/sip_trunk_pb" -require "google/cloud/dialogflow/v2/sip_trunks" - -class ::Google::Cloud::Dialogflow::V2::SipTrunks::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_sip_trunk - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SipTrunk.new - grpc_operation = GRPC::ActiveCall::Operation.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" - sip_trunk = {} - - create_sip_trunk_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_sip_trunk, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SipTrunk), request["sip_trunk"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_sip_trunk_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_sip_trunk({ parent: parent, sip_trunk: sip_trunk }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_sip_trunk parent: parent, sip_trunk: sip_trunk do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_sip_trunk ::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new(parent: parent, sip_trunk: sip_trunk) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_sip_trunk({ parent: parent, sip_trunk: sip_trunk }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_sip_trunk(::Google::Cloud::Dialogflow::V2::CreateSipTrunkRequest.new(parent: parent, sip_trunk: sip_trunk), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_sip_trunk_client_stub.call_rpc_count - end - end - - def test_delete_sip_trunk - # 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_sip_trunk_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_sip_trunk, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_sip_trunk_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_sip_trunk({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_sip_trunk name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_sip_trunk ::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_sip_trunk({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_sip_trunk(::Google::Cloud::Dialogflow::V2::DeleteSipTrunkRequest.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_sip_trunk_client_stub.call_rpc_count - end - end - - def test_list_sip_trunks - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListSipTrunksResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_sip_trunks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sip_trunks, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest, 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_sip_trunks_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_sip_trunks({ 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 - c.list_sip_trunks 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 - c.list_sip_trunks ::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.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 - c.list_sip_trunks({ 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 - c.list_sip_trunks(::Google::Cloud::Dialogflow::V2::ListSipTrunksRequest.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_sip_trunks_client_stub.call_rpc_count - end - end - - def test_get_sip_trunk - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SipTrunk.new - grpc_operation = GRPC::ActiveCall::Operation.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_sip_trunk_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_sip_trunk, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_sip_trunk_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_sip_trunk({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_sip_trunk name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_sip_trunk ::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_sip_trunk({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_sip_trunk(::Google::Cloud::Dialogflow::V2::GetSipTrunkRequest.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_sip_trunk_client_stub.call_rpc_count - end - end - - def test_update_sip_trunk - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::SipTrunk.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - sip_trunk = {} - update_mask = {} - - update_sip_trunk_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_sip_trunk, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::SipTrunk), request["sip_trunk"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_sip_trunk_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::SipTrunks::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_sip_trunk({ sip_trunk: sip_trunk, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_sip_trunk sip_trunk: sip_trunk, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_sip_trunk ::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new(sip_trunk: sip_trunk, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_sip_trunk({ sip_trunk: sip_trunk, 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 - c.update_sip_trunk(::Google::Cloud::Dialogflow::V2::UpdateSipTrunkRequest.new(sip_trunk: sip_trunk, 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_sip_trunk_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::Dialogflow::V2::SipTrunks::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::Dialogflow::V2::SipTrunks::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::Dialogflow::V2::SipTrunks::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::SipTrunks::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_paths_test.rb deleted file mode 100644 index 7b5d667c1cde..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_paths_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/tools" - -class ::Google::Cloud::Dialogflow::V2::Tools::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_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::Dialogflow::V2::Tools::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_secret_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_version_path project: "value0", secret: "value1", version: "value2" - assert_equal "projects/value0/secrets/value1/versions/value2", path - end - end - - def test_service_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_path project: "value0", location: "value1", namespace: "value2", service: "value3" - assert_equal "projects/value0/locations/value1/namespaces/value2/services/value3", path - end - end - - def test_tool_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.tool_path project: "value0", location: "value1", tool: "value2" - assert_equal "projects/value0/locations/value1/tools/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_rest_test.rb deleted file mode 100644 index 07443b35c95c..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_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/dialogflow/v2/tool_pb" -require "google/cloud/dialogflow/v2/tools/rest" - - -class ::Google::Cloud::Dialogflow::V2::Tools::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_tool - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Tool.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - tool = {} - tool_id = "hello world" - - create_tool_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_create_tool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_tool_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_tool({ parent: parent, tool: tool, tool_id: tool_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_tool parent: parent, tool: tool, tool_id: tool_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_tool ::Google::Cloud::Dialogflow::V2::CreateToolRequest.new(parent: parent, tool: tool, tool_id: tool_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_tool({ parent: parent, tool: tool, tool_id: tool_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_tool(::Google::Cloud::Dialogflow::V2::CreateToolRequest.new(parent: parent, tool: tool, tool_id: tool_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_tool_client_stub.call_count - end - end - end - - def test_get_tool - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Tool.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_tool_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_get_tool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_tool_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_tool({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_tool name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_tool ::Google::Cloud::Dialogflow::V2::GetToolRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_tool({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_tool(::Google::Cloud::Dialogflow::V2::GetToolRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_tool_client_stub.call_count - end - end - end - - def test_list_tools - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListToolsResponse.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_tools_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_list_tools_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tools_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_tools({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_tools parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_tools ::Google::Cloud::Dialogflow::V2::ListToolsRequest.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 - c.list_tools({ 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 - c.list_tools(::Google::Cloud::Dialogflow::V2::ListToolsRequest.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_tools_client_stub.call_count - end - end - end - - def test_delete_tool - # 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_tool_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_delete_tool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_tool_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_tool({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_tool name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_tool ::Google::Cloud::Dialogflow::V2::DeleteToolRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_tool({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_tool(::Google::Cloud::Dialogflow::V2::DeleteToolRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_tool_client_stub.call_count - end - end - end - - def test_update_tool - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Tool.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - tool = {} - update_mask = {} - - update_tool_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::Dialogflow::V2::Tools::Rest::ServiceStub.stub :transcode_update_tool_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_tool_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_tool({ tool: tool, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_tool tool: tool, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_tool ::Google::Cloud::Dialogflow::V2::UpdateToolRequest.new(tool: tool, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_tool({ tool: tool, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_tool(::Google::Cloud::Dialogflow::V2::UpdateToolRequest.new(tool: tool, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_tool_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::Dialogflow::V2::Tools::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::Dialogflow::V2::Tools::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_test.rb deleted file mode 100644 index 9aeca6468aae..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/tools_test.rb +++ /dev/null @@ -1,409 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/tool_pb" -require "google/cloud/dialogflow/v2/tools" - -class ::Google::Cloud::Dialogflow::V2::Tools::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_tool - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Tool.new - grpc_operation = GRPC::ActiveCall::Operation.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" - tool = {} - tool_id = "hello world" - - create_tool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_tool, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateToolRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Tool), request["tool"] - assert_equal "hello world", request["tool_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_tool_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_tool({ parent: parent, tool: tool, tool_id: tool_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_tool parent: parent, tool: tool, tool_id: tool_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_tool ::Google::Cloud::Dialogflow::V2::CreateToolRequest.new(parent: parent, tool: tool, tool_id: tool_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_tool({ parent: parent, tool: tool, tool_id: tool_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_tool(::Google::Cloud::Dialogflow::V2::CreateToolRequest.new(parent: parent, tool: tool, tool_id: tool_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_tool_client_stub.call_rpc_count - end - end - - def test_get_tool - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Tool.new - grpc_operation = GRPC::ActiveCall::Operation.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_tool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_tool, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetToolRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_tool_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_tool({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_tool name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_tool ::Google::Cloud::Dialogflow::V2::GetToolRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_tool({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_tool(::Google::Cloud::Dialogflow::V2::GetToolRequest.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_tool_client_stub.call_rpc_count - end - end - - def test_list_tools - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListToolsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_tools_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tools, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListToolsRequest, 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_tools_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_tools({ 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 - c.list_tools 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 - c.list_tools ::Google::Cloud::Dialogflow::V2::ListToolsRequest.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 - c.list_tools({ 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 - c.list_tools(::Google::Cloud::Dialogflow::V2::ListToolsRequest.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_tools_client_stub.call_rpc_count - end - end - - def test_delete_tool - # 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_tool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_tool, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteToolRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_tool_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_tool({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_tool name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_tool ::Google::Cloud::Dialogflow::V2::DeleteToolRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_tool({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_tool(::Google::Cloud::Dialogflow::V2::DeleteToolRequest.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_tool_client_stub.call_rpc_count - end - end - - def test_update_tool - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Tool.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - tool = {} - update_mask = {} - - update_tool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_tool, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateToolRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Tool), request["tool"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_tool_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Tools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_tool({ tool: tool, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_tool tool: tool, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_tool ::Google::Cloud::Dialogflow::V2::UpdateToolRequest.new(tool: tool, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_tool({ tool: tool, 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 - c.update_tool(::Google::Cloud::Dialogflow::V2::UpdateToolRequest.new(tool: tool, 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_tool_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::Dialogflow::V2::Tools::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::Dialogflow::V2::Tools::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::Dialogflow::V2::Tools::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Tools::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_paths_test.rb deleted file mode 100644 index 2bb427ceb75f..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_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/dialogflow/v2/versions" - -class ::Google::Cloud::Dialogflow::V2::Versions::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_agent_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.agent_path project: "value0" - assert_equal "projects/value0/agent", path - - path = client.agent_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/agent", path - end - end - - def test_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.version_path project: "value0", version: "value1" - assert_equal "projects/value0/agent/versions/value1", path - - path = client.version_path project: "value0", location: "value1", version: "value2" - assert_equal "projects/value0/locations/value1/agent/versions/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb deleted file mode 100644 index 5c056f0c2d42..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_rest_test.rb +++ /dev/null @@ -1,373 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/version_pb" -require "google/cloud/dialogflow/v2/versions/rest" - - -class ::Google::Cloud::Dialogflow::V2::Versions::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_versions - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::ListVersionsResponse.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_versions_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_list_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_versions_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_versions({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_versions parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_versions ::Google::Cloud::Dialogflow::V2::ListVersionsRequest.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 - c.list_versions({ 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 - c.list_versions(::Google::Cloud::Dialogflow::V2::ListVersionsRequest.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_versions_client_stub.call_count - end - end - end - - def test_get_version - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Version.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_version_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_get_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_version_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_version ::Google::Cloud::Dialogflow::V2::GetVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_version(::Google::Cloud::Dialogflow::V2::GetVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_version_client_stub.call_count - end - end - end - - def test_create_version - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Version.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - version = {} - - create_version_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_create_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_version_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_version({ parent: parent, version: version }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_version parent: parent, version: version do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_version ::Google::Cloud::Dialogflow::V2::CreateVersionRequest.new(parent: parent, version: version) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_version({ parent: parent, version: version }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_version(::Google::Cloud::Dialogflow::V2::CreateVersionRequest.new(parent: parent, version: version), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_version_client_stub.call_count - end - end - end - - def test_update_version - # Create test objects. - client_result = ::Google::Cloud::Dialogflow::V2::Version.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - version = {} - update_mask = {} - - update_version_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_update_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_version_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_version({ version: version, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_version version: version, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_version ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new(version: version, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_version({ version: version, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_version(::Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new(version: version, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_version_client_stub.call_count - end - end - end - - def test_delete_version - # 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_version_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::Dialogflow::V2::Versions::Rest::ServiceStub.stub :transcode_delete_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_version_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_version ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_version(::Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_version_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::Dialogflow::V2::Versions::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::Dialogflow::V2::Versions::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb deleted file mode 100644 index 1136213b188d..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/versions_test.rb +++ /dev/null @@ -1,407 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/dialogflow/v2/version_pb" -require "google/cloud/dialogflow/v2/versions" - -class ::Google::Cloud::Dialogflow::V2::Versions::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_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::ListVersionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.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_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_versions, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::ListVersionsRequest, 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_versions_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_versions({ 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 - c.list_versions 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 - c.list_versions ::Google::Cloud::Dialogflow::V2::ListVersionsRequest.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 - c.list_versions({ 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 - c.list_versions(::Google::Cloud::Dialogflow::V2::ListVersionsRequest.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_versions_client_stub.call_rpc_count - end - end - - def test_get_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Version.new - grpc_operation = GRPC::ActiveCall::Operation.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_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_version, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::GetVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_version_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_version ::Google::Cloud::Dialogflow::V2::GetVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_version(::Google::Cloud::Dialogflow::V2::GetVersionRequest.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_version_client_stub.call_rpc_count - end - end - - def test_create_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Version.new - grpc_operation = GRPC::ActiveCall::Operation.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" - version = {} - - create_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_version, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::CreateVersionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Version), request["version"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_version_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_version({ parent: parent, version: version }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_version parent: parent, version: version do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_version ::Google::Cloud::Dialogflow::V2::CreateVersionRequest.new(parent: parent, version: version) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_version({ parent: parent, version: version }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_version(::Google::Cloud::Dialogflow::V2::CreateVersionRequest.new(parent: parent, version: version), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_version_client_stub.call_rpc_count - end - end - - def test_update_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::Dialogflow::V2::Version.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - version = {} - update_mask = {} - - update_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_version, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::Version), request["version"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_version_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_version({ version: version, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_version version: version, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_version ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new(version: version, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_version({ version: version, 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 - c.update_version(::Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new(version: version, 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_version_client_stub.call_rpc_count - end - end - - def test_delete_version - # 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_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_version, name - assert_kind_of ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_version_client_stub do - # Create client - c = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_version ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_version(::Google::Cloud::Dialogflow::V2::DeleteVersionRequest.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_version_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::Dialogflow::V2::Versions::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::Dialogflow::V2::Versions::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::Dialogflow::V2::Versions::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Dialogflow::V2::Versions::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-dialogflow-v2/test/helper.rb b/owl-bot-staging/google-cloud-dialogflow-v2/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-dialogflow-v2/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# 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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct"